Skip to content

Add build artifact workflow #4

Add build artifact workflow

Add build artifact workflow #4

Workflow file for this run

name: Build with Nix Cross-Compilation
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
jobs:
build:
name: Cross-compile to ARM64
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Nix
run: |
curl --proto '=https' --tlsv1.2 -sSf -L https://install.lix.systems/lix | sh -s -- install --no-confirm
- name: Set version
id: version
run: echo "VERSION=$(cat version)" >> $GITHUB_OUTPUT
- name: Build ARM64 with Nix
run: |
sudo tee -a /etc/nix/nix.conf > /dev/null <<EOF
extra-substituters = https://d17qv3gttz4z4k.cloudfront.net
extra-trusted-public-keys = gglite-nix-cache-1:Zdz1mEqn//xa8ORxHkc76auwxmX8/6C2K/zWRjmq8Co=
extra-platforms = aarch64-linux
log-lines = 0
EOF
sudo $(which nix) build -L .#packages.aarch64-linux.default --system aarch64-linux
- name: Create package
run: |
mkdir -p ${{ github.workspace }}/zipfile
cp result/bin/system-log-forwarder ./
zip -9 ${{ github.workspace }}/zipfile/system-log-forwarder-arm64-${{ steps.version.outputs.VERSION }}.zip system-log-forwarder
- name: md5sums
run: |
md5sum ${{ github.workspace }}/zipfile/*
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: system-log-forwarder-arm64-${{ steps.version.outputs.VERSION }}
path: |
${{ github.workspace }}/zipfile/*
retention-days: 1