54 lines
2.0 KiB
YAML
54 lines
2.0 KiB
YAML
name: Build Agent Binaries
|
|
on:
|
|
push:
|
|
branches: [master]
|
|
paths: ['agents/agent.py', '.gitea/workflows/build-binaries.yml']
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build-linux:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Install PyInstaller + libpython
|
|
run: |
|
|
sudo apt-get update -qq && sudo apt-get install -y -qq python3-dev libpython3.12 >/dev/null
|
|
pip install --break-system-packages pyinstaller || pip install pyinstaller
|
|
- name: Bake token + build
|
|
env:
|
|
AGENT_TOKEN: ${{ secrets.NEXUS_AGENT_TOKEN }}
|
|
run: |
|
|
sed "s/__AGENT_TOKEN__/$AGENT_TOKEN/" agents/agent.py > baked.py
|
|
pyinstaller --onefile --name NexusAgent-linux baked.py
|
|
- uses: actions/upload-artifact@v4
|
|
with: {name: NexusAgent-linux, path: dist/}
|
|
|
|
build-macos:
|
|
runs-on: macos-latest # host runner on drjones' MacBook
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- run: pip3 install --user pyinstaller || pip3 install --break-system-packages pyinstaller
|
|
- name: Bake token + build
|
|
env:
|
|
AGENT_TOKEN: ${{ secrets.NEXUS_AGENT_TOKEN }}
|
|
run: |
|
|
sed "s/__AGENT_TOKEN__/$AGENT_TOKEN/" agents/agent.py > baked.py
|
|
pyinstaller --onefile --name NexusAgent-macos baked.py
|
|
- uses: actions/upload-artifact@v4
|
|
with: {name: NexusAgent-macos, path: dist/}
|
|
|
|
build-windows:
|
|
runs-on: windows-latest # host runner on GamingPC — pends until that host registers
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- run: pip install pyinstaller
|
|
- name: Bake token + build
|
|
shell: pwsh
|
|
env:
|
|
AGENT_TOKEN: ${{ secrets.NEXUS_AGENT_TOKEN }}
|
|
run: |
|
|
(Get-Content agents/agent.py) -replace '__AGENT_TOKEN__', $env:AGENT_TOKEN | Set-Content baked.py
|
|
pyinstaller --onefile --name NexusAgent-windows baked.py
|
|
- uses: actions/upload-artifact@v4
|
|
with: {name: NexusAgent-windows, path: dist/}
|