Files
Sylve/.github/workflows/build.yaml
T

87 lines
2.1 KiB
YAML

name: Build
on:
push:
branches:
- "**"
paths-ignore:
- "docs/**"
tags-ignore:
- tip
jobs:
build-web:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v5
with:
node-version: 24
- name: Build Web Assets
run: |
make frontend
- name: Upload Web Assets
uses: actions/upload-artifact@v4
with:
name: web-assets
path: internal/assets/web-files/
build-freebsd:
needs: build-web
runs-on: ubuntu-latest
env:
FREEBSD_VERSION: 15.0-RELEASE
strategy:
fail-fast: false
matrix:
include:
- arch: amd64
- arch: arm64
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.26.x"
- name: Install cross-build toolchain
run: |
sudo apt-get update
sudo apt-get install -y clang lld xz-utils tar file
- name: Download Web Assets
uses: actions/download-artifact@v4
with:
name: web-assets
path: internal/assets/web-files
- name: Cache FreeBSD sysroot
uses: actions/cache@v4
with:
path: .cache/freebsd/${{ matrix.arch }}-${{ env.FREEBSD_VERSION }}
key: freebsd-sysroot-${{ runner.os }}-${{ matrix.arch }}-${{ env.FREEBSD_VERSION }}
- name: Build FreeBSD binary on Linux (${{ matrix.arch }})
run: |
make cross-build-${{ matrix.arch }} FREEBSD_VERSION=${{ env.FREEBSD_VERSION }}
- name: Verify binary format
run: |
set -euo pipefail
file bin/sylve | tee /tmp/sylve-file.txt
grep -q "FreeBSD" /tmp/sylve-file.txt
if [ "${{ matrix.arch }}" = "amd64" ]; then
grep -Eq "x86-64|amd64" /tmp/sylve-file.txt
else
grep -Eq "aarch64|arm64|ARM aarch64" /tmp/sylve-file.txt
fi
- name: Upload Binary
uses: actions/upload-artifact@v4
with:
name: sylve-${{ matrix.arch }}
path: bin/sylve