fix(ci): rewrite deploy_call.yaml with correct YAML indentation
Beta Release / deploy (push) Successful in 1m52s
Beta Release / deploy (push) Successful in 1m52s
This commit is contained in:
@@ -23,7 +23,6 @@ jobs:
|
|||||||
TOKEN="${{ secrets.BUILD_TOKEN }}"
|
TOKEN="${{ secrets.BUILD_TOKEN }}"
|
||||||
git clone -c credential.helper="" \
|
git clone -c credential.helper="" \
|
||||||
https://token:$TOKEN@git.datadunia.com/nexusguard/Nexus-Guard-Suite.git .
|
https://token:$TOKEN@git.datadunia.com/nexusguard/Nexus-Guard-Suite.git .
|
||||||
|
|
||||||
- name: Clone submodules
|
- name: Clone submodules
|
||||||
run: |
|
run: |
|
||||||
TOKEN="${{ secrets.BUILD_TOKEN }}"
|
TOKEN="${{ secrets.BUILD_TOKEN }}"
|
||||||
@@ -36,33 +35,27 @@ jobs:
|
|||||||
# Dashboard UI
|
# Dashboard UI
|
||||||
git clone -c credential.helper="" \
|
git clone -c credential.helper="" \
|
||||||
https://token:$TOKEN@git.datadunia.com/nexusguard/nexus-dashboard-ui.git apps/dashboard-ui
|
https://token:$TOKEN@git.datadunia.com/nexusguard/nexus-dashboard-ui.git apps/dashboard-ui
|
||||||
|
|
||||||
- name: Setup Go
|
- name: Setup Go
|
||||||
uses: actions/setup-go@v5
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version: '1.25'
|
go-version: '1.25'
|
||||||
|
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: '24'
|
node-version: '24'
|
||||||
|
|
||||||
- name: Download Go modules
|
- name: Download Go modules
|
||||||
run: |
|
run: |
|
||||||
cd apps/server-core
|
cd apps/server-core
|
||||||
go mod download
|
go mod download
|
||||||
|
|
||||||
- name: Generate Swagger docs
|
- name: Generate Swagger docs
|
||||||
run: |
|
run: |
|
||||||
go install github.com/swaggo/swag/cmd/swag@v1.16.6
|
go install github.com/swaggo/swag/cmd/swag@v1.16.6
|
||||||
cd apps/server-core
|
cd apps/server-core
|
||||||
swag init -g main.go --parseDependency --parseInternal
|
swag init -g main.go --parseDependency --parseInternal
|
||||||
|
|
||||||
- name: Build Server Core
|
- name: Build Server Core
|
||||||
run: |
|
run: |
|
||||||
cd apps/server-core
|
cd apps/server-core
|
||||||
go build -o bin/server-core .
|
go build -o bin/server-core .
|
||||||
|
|
||||||
- name: Build Device Agent Cross-platform
|
- name: Build Device Agent Cross-platform
|
||||||
run: |
|
run: |
|
||||||
cd apps/device-agent
|
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 .
|
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -o bin/nexus-device-agent-linux-arm64 .
|
||||||
# Windows amd64
|
# Windows amd64
|
||||||
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o bin/nexus-device-agent-windows-amd64.exe .
|
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o bin/nexus-device-agent-windows-amd64.exe .
|
||||||
|
|
||||||
- name: Build Dashboard UI
|
- name: Build Dashboard UI
|
||||||
run: |
|
run: |
|
||||||
cd apps/dashboard-ui
|
cd apps/dashboard-ui
|
||||||
npm ci || npm install
|
npm ci || npm install
|
||||||
npm run build
|
npm run build
|
||||||
|
|
||||||
- name: Generate latest.json
|
- name: Generate latest.json
|
||||||
run: |
|
run: |
|
||||||
VERSION="${{ gitea.ref_name }}"
|
VERSION="${{ gitea.ref_name }}"
|
||||||
RELEASE_DATE="$(date -u +'%Y-%m-%dT%H:%M:%SZ')"
|
RELEASE_DATE="$(date -u +'%Y-%m-%dT%H:%M:%SZ')"
|
||||||
REPO="${{ gitea.repository }}"
|
REPO="${{ gitea.repository }}"
|
||||||
SERVER="${{ gitea.server_url }}"
|
SERVER="${{ gitea.server_url }}"
|
||||||
cat > latest.json << ENDJSON
|
cat > latest.json << ENDJSON
|
||||||
{
|
{
|
||||||
"version": "$VERSION",
|
"version": "$VERSION",
|
||||||
"release_date": "$RELEASE_DATE",
|
"release_date": "$RELEASE_DATE",
|
||||||
"download_urls": {
|
"download_urls": {
|
||||||
"server-core": "${SERVER}/${REPO}/releases/download/${VERSION}/server-core-linux-amd64",
|
"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-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-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",
|
"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"
|
"dashboard-ui": "${SERVER}/${REPO}/releases/download/${VERSION}/dashboard-ui-dist.tar.gz"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ENDJSON
|
ENDJSON
|
||||||
|
|
||||||
- name: Create Release and upload assets
|
- name: Create Release and upload assets
|
||||||
env:
|
env:
|
||||||
TOKEN: ${{ secrets.BUILD_TOKEN }}
|
TOKEN: ${{ secrets.BUILD_TOKEN }}
|
||||||
@@ -199,20 +189,19 @@ jobs:
|
|||||||
"$API/repos/$REPO/releases/$RELEASE_ID/assets?name=dashboard-ui-dist.tar.gz"
|
"$API/repos/$REPO/releases/$RELEASE_ID/assets?name=dashboard-ui-dist.tar.gz"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# latest.json
|
# latest.json
|
||||||
if [ -f "latest.json" ]; then
|
if [ -f "latest.json" ]; then
|
||||||
echo "Uploading latest.json..."
|
echo "Uploading latest.json..."
|
||||||
curl -s -X POST \
|
curl -s -X POST \
|
||||||
-H "Authorization: token $TOKEN" \
|
-H "Authorization: token $TOKEN" \
|
||||||
-F "attachment=@latest.json" \
|
-F "attachment=@latest.json" \
|
||||||
"$API/repos/$REPO/releases/$RELEASE_ID/assets?name=latest.json"
|
"$API/repos/$REPO/releases/$RELEASE_ID/assets?name=latest.json"
|
||||||
fi
|
fi
|
||||||
|
- name: Cleanup build artifacts
|
||||||
- name: Cleanup build artifacts
|
if: always()
|
||||||
if: always()
|
run: |
|
||||||
run: |
|
git config --global --remove-section http || true
|
||||||
git config --global --remove-section http || true
|
git config --global --unset-all core.askPass || true
|
||||||
git config --global --unset-all core.askPass || true
|
rm -f latest.json dashboard-ui-dist.tar.gz
|
||||||
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
|
||||||
rm -rf apps/server-core/bin apps/device-agent/bin apps/dashboard-ui/node_modules apps/dashboard-ui/dist
|
echo "Cleanup done"
|
||||||
echo "Cleanup done"
|
|
||||||
Reference in New Issue
Block a user