Files
Nexus-Guard-Suite/.gitea/workflows/build_device_agent.yaml
T
datadunia 9a2212d691
CI / build-server-core (push) Successful in 5m41s
CI / server-core-test (push) Has been skipped
CI / device-agent-test (push) Has been skipped
CI / dashboard-test (push) Has been skipped
CI / build-device-agent (push) Successful in 2m11s
CI / build-dashboard (push) Successful in 1m11s
CI / build-docs (push) Successful in 1m9s
CI / release (push) Successful in 29s
revert(ci): remove actions/cache@v4 - hangs on act_runner v0.6.1
actions/cache@v4 not compatible with self-hosted act_runner.
Builds complete in 3-5min without cache - acceptable.
2026-06-17 13:54:58 +07:00

59 lines
1.8 KiB
YAML

name: Build Device Agent
on:
workflow_call:
jobs:
cross-build:
runs-on: ubuntu-latest
steps:
- name: Configure git auth for submodules
run: git config --global url."https://x-access-token:${{ secrets.BUILD_TOKEN }}@git.datadunia.com/".insteadOf "https://git.datadunia.com/"
- uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
token: ${{ secrets.BUILD_TOKEN }}
persist-credentials: true
- uses: actions/setup-go@v5
with:
go-version: '1.26'
- name: Build all platforms
working-directory: apps/device-agent
shell: bash
run: |
set -e
mkdir -p bin
for PAIR in linux/amd64 linux/arm64 windows/amd64; do
GOOS="${PAIR%%/*}"
GOARCH="${PAIR##*/}"
EXT=""
if [ "$GOOS" = "windows" ]; then EXT=".exe"; fi
OUT="bin/nexus-device-agent-${GOOS}-${GOARCH}${EXT}"
echo "Building $OUT ..."
CGO_ENABLED=0 GOOS="$GOOS" GOARCH="$GOARCH" go build -o "$OUT" .
done
echo "=== Build output ==="
ls -la bin/
- name: Upload linux/amd64
uses: actions/upload-artifact@v3
with:
name: nexus-device-agent-linux-amd64
path: apps/device-agent/bin/nexus-device-agent-linux-amd64
- name: Upload linux/arm64
uses: actions/upload-artifact@v3
with:
name: nexus-device-agent-linux-arm64
path: apps/device-agent/bin/nexus-device-agent-linux-arm64
- name: Upload windows/amd64
uses: actions/upload-artifact@v3
with:
name: nexus-device-agent-windows-amd64
path: apps/device-agent/bin/nexus-device-agent-windows-amd64.exe