fix(ci): replace zip with tar for dashboard-ui packaging
Beta Release / deploy (push) Failing after 0s
Beta Release / deploy (push) Failing after 0s
This commit is contained in:
@@ -85,19 +85,19 @@ jobs:
|
||||
RELEASE_DATE="$(date -u +'%Y-%m-%dT%H:%M:%SZ')"
|
||||
REPO="${{ gitea.repository }}"
|
||||
SERVER="${{ gitea.server_url }}"
|
||||
cat > latest.json << ENDJSON
|
||||
{
|
||||
"version": "$VERSION",
|
||||
"release_date": "$RELEASE_DATE",
|
||||
"download_urls": {
|
||||
"server-core": "${SERVER}/${REPO}/releases/download/${VERSION}/server-core-linux-amd64",
|
||||
"device-agent-linux-amd64": "${SERVER}/${REPO}/releases/download/${VERSION}/nexus-device-agent-linux-amd64",
|
||||
"device-agent-linux-arm64": "${SERVER}/${REPO}/releases/download/${VERSION}/nexus-device-agent-linux-arm64",
|
||||
"device-agent-windows-amd64": "${SERVER}/${REPO}/releases/download/${VERSION}/nexus-device-agent-windows-amd64.exe",
|
||||
"dashboard-ui": "${SERVER}/${REPO}/releases/download/${VERSION}/dashboard-ui-dist.zip"
|
||||
}
|
||||
}
|
||||
ENDJSON
|
||||
cat > latest.json << ENDJSON
|
||||
{
|
||||
"version": "$VERSION",
|
||||
"release_date": "$RELEASE_DATE",
|
||||
"download_urls": {
|
||||
"server-core": "${SERVER}/${REPO}/releases/download/${VERSION}/server-core-linux-amd64",
|
||||
"device-agent-linux-amd64": "${SERVER}/${REPO}/releases/download/${VERSION}/nexus-device-agent-linux-amd64",
|
||||
"device-agent-linux-arm64": "${SERVER}/${REPO}/releases/download/${VERSION}/nexus-device-agent-linux-arm64",
|
||||
"device-agent-windows-amd64": "${SERVER}/${REPO}/releases/download/${VERSION}/nexus-device-agent-windows-amd64.exe",
|
||||
"dashboard-ui": "${SERVER}/${REPO}/releases/download/${VERSION}/dashboard-ui-dist.tar.gz"
|
||||
}
|
||||
}
|
||||
ENDJSON
|
||||
|
||||
- name: Create Release and upload assets
|
||||
env:
|
||||
@@ -185,19 +185,19 @@ jobs:
|
||||
"$API/repos/$REPO/releases/$RELEASE_ID/assets?name=nexus-device-agent-windows-amd64.exe"
|
||||
fi
|
||||
|
||||
# Dashboard UI dist
|
||||
if [ -d "apps/dashboard-ui/dist" ]; then
|
||||
echo "Creating dashboard-ui-dist.zip..."
|
||||
cd apps/dashboard-ui
|
||||
zip -r ../dashboard-ui-dist.zip dist/
|
||||
cd ..
|
||||
|
||||
echo "Uploading dashboard-ui-dist.zip..."
|
||||
curl -s -X POST \
|
||||
-H "Authorization: token $TOKEN" \
|
||||
-F "attachment=@dashboard-ui-dist.zip" \
|
||||
"$API/repos/$REPO/releases/$RELEASE_ID/assets?name=dashboard-ui-dist.zip"
|
||||
fi
|
||||
# Dashboard UI dist
|
||||
if [ -d "apps/dashboard-ui/dist" ]; then
|
||||
echo "Creating dashboard-ui-dist.tar.gz..."
|
||||
cd apps/dashboard-ui
|
||||
tar -czf ../dashboard-ui-dist.tar.gz dist/
|
||||
cd ..
|
||||
|
||||
echo "Uploading dashboard-ui-dist.tar.gz..."
|
||||
curl -s -X POST \
|
||||
-H "Authorization: token $TOKEN" \
|
||||
-F "attachment=@dashboard-ui-dist.tar.gz" \
|
||||
"$API/repos/$REPO/releases/$RELEASE_ID/assets?name=dashboard-ui-dist.tar.gz"
|
||||
fi
|
||||
|
||||
# latest.json
|
||||
if [ -f "latest.json" ]; then
|
||||
@@ -208,11 +208,11 @@ jobs:
|
||||
"$API/repos/$REPO/releases/$RELEASE_ID/assets?name=latest.json"
|
||||
fi
|
||||
|
||||
- name: Cleanup build artifacts
|
||||
if: always()
|
||||
run: |
|
||||
git config --global --remove-section http || true
|
||||
git config --global --unset-all core.askPass || true
|
||||
rm -f latest.json dashboard-ui-dist.zip
|
||||
rm -rf apps/server-core/bin apps/device-agent/bin apps/dashboard-ui/node_modules apps/dashboard-ui/dist
|
||||
echo "Cleanup done"
|
||||
- name: Cleanup build artifacts
|
||||
if: always()
|
||||
run: |
|
||||
git config --global --remove-section http || true
|
||||
git config --global --unset-all core.askPass || true
|
||||
rm -f latest.json dashboard-ui-dist.tar.gz
|
||||
rm -rf apps/server-core/bin apps/device-agent/bin apps/dashboard-ui/node_modules apps/dashboard-ui/dist
|
||||
echo "Cleanup done"
|
||||
Reference in New Issue
Block a user