From 870a08ae58017998d6bc06e5d6b1814df6a2ed4c Mon Sep 17 00:00:00 2001 From: datadunia Date: Sat, 30 May 2026 17:31:56 +0700 Subject: [PATCH] fix(ci): rewrite deploy_call.yaml with correct YAML indentation --- .gitea/workflows/deploy_call.yaml | 69 +++++++++++++------------------ 1 file changed, 29 insertions(+), 40 deletions(-) diff --git a/.gitea/workflows/deploy_call.yaml b/.gitea/workflows/deploy_call.yaml index 1d3e192..96cba9f 100644 --- a/.gitea/workflows/deploy_call.yaml +++ b/.gitea/workflows/deploy_call.yaml @@ -23,7 +23,6 @@ jobs: TOKEN="${{ secrets.BUILD_TOKEN }}" git clone -c credential.helper="" \ https://token:$TOKEN@git.datadunia.com/nexusguard/Nexus-Guard-Suite.git . - - name: Clone submodules run: | TOKEN="${{ secrets.BUILD_TOKEN }}" @@ -36,33 +35,27 @@ jobs: # Dashboard UI git clone -c credential.helper="" \ https://token:$TOKEN@git.datadunia.com/nexusguard/nexus-dashboard-ui.git apps/dashboard-ui - - name: Setup Go uses: actions/setup-go@v5 with: go-version: '1.25' - - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: '24' - - name: Download Go modules run: | cd apps/server-core go mod download - - name: Generate Swagger docs run: | go install github.com/swaggo/swag/cmd/swag@v1.16.6 cd apps/server-core swag init -g main.go --parseDependency --parseInternal - - name: Build Server Core run: | cd apps/server-core go build -o bin/server-core . - - name: Build Device Agent Cross-platform run: | cd apps/device-agent @@ -72,33 +65,30 @@ jobs: CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -o bin/nexus-device-agent-linux-arm64 . # Windows amd64 CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o bin/nexus-device-agent-windows-amd64.exe . - - name: Build Dashboard UI run: | cd apps/dashboard-ui npm ci || npm install npm run build - - name: Generate latest.json run: | VERSION="${{ gitea.ref_name }}" 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.tar.gz" - } - } - 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: TOKEN: ${{ secrets.BUILD_TOKEN }} @@ -199,20 +189,19 @@ jobs: "$API/repos/$REPO/releases/$RELEASE_ID/assets?name=dashboard-ui-dist.tar.gz" fi - # latest.json - if [ -f "latest.json" ]; then - echo "Uploading latest.json..." - curl -s -X POST \ - -H "Authorization: token $TOKEN" \ - -F "attachment=@latest.json" \ - "$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.tar.gz - rm -rf apps/server-core/bin apps/device-agent/bin apps/dashboard-ui/node_modules apps/dashboard-ui/dist - echo "Cleanup done" \ No newline at end of file + # latest.json + if [ -f "latest.json" ]; then + echo "Uploading latest.json..." + curl -s -X POST \ + -H "Authorization: token $TOKEN" \ + -F "attachment=@latest.json" \ + "$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.tar.gz + rm -rf apps/server-core/bin apps/device-agent/bin apps/dashboard-ui/node_modules apps/dashboard-ui/dist + echo "Cleanup done" \ No newline at end of file