Files
Nexus-Guard-Suite/.gitea/workflows/build_device_agent.yaml
T

50 lines
1.4 KiB
YAML

name: Build Device Agent
on:
workflow_call:
jobs:
cross-build:
runs-on: ubuntu-latest
strategy:
matrix:
goos: [linux, windows]
goarch: [amd64, arm64]
exclude:
- goos: windows
goarch: arm64
defaults:
run:
working-directory: apps/device-agent
steps:
- name: Rewrite submodule URLs
run: |
git config --global url."http://172.20.8.90:3000/".insteadOf "https://git.datadunia.com/"
git config --global url."http://172.20.8.90:3000/".insteadOf "http://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
env:
CGO_ENABLED: '0'
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
run: |
EXT=""
if [ "${{ matrix.goos }}" = "windows" ]; then EXT=".exe"; fi
go build -o bin/nexus-device-agent-${{ matrix.goos }}-${{ matrix.goarch }}${EXT} .
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: nexus-device-agent-${{ matrix.goos }}-${{ matrix.goarch }}
path: apps/device-agent/bin/nexus-device-agent-*