3 Commits

Author SHA1 Message Date
463bb561e1 Merge pull request #111 from lordmathis/fix/cgo-enabled-build
fix: Add multiplatform CGO_ENABLED=1 build
2025-12-17 14:38:27 +01:00
ebdb9143c0 Remove separate windows build step 2025-12-17 14:32:10 +01:00
4269d04381 Update release.yaml 2025-12-17 14:25:50 +01:00

View File

@@ -45,15 +45,23 @@ jobs:
build: build:
name: Build Binaries name: Build Binaries
needs: build-webui needs: build-webui
runs-on: ubuntu-latest runs-on: ${{ matrix.runner }}
strategy: strategy:
matrix: matrix:
goos: [linux, windows, darwin] include:
goarch: [amd64, arm64] - goos: linux
exclude: goarch: amd64
# Windows ARM64 support is limited runner: ubuntu-latest
- goos: windows - goos: linux
goarch: arm64 goarch: arm64
runner: ubuntu-latest
cc: aarch64-linux-gnu-gcc
- goos: darwin
goarch: arm64
runner: macos-latest
- goos: windows
goarch: amd64
runner: windows-latest
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v4 uses: actions/checkout@v4
@@ -70,11 +78,19 @@ jobs:
name: webui-dist name: webui-dist
path: webui/dist/ path: webui/dist/
- name: Install cross-compilation tools (Linux ARM64 only)
if: matrix.cc != ''
run: |
sudo apt-get update
sudo apt-get install -y gcc-aarch64-linux-gnu
- name: Build binary - name: Build binary
env: env:
GOOS: ${{ matrix.goos }} GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }} GOARCH: ${{ matrix.goarch }}
CGO_ENABLED: 0 CGO_ENABLED: 1
CC: ${{ matrix.cc }}
shell: bash
run: | run: |
# Set binary extension for Windows # Set binary extension for Windows
BINARY_NAME="llamactl" BINARY_NAME="llamactl"
@@ -91,8 +107,10 @@ jobs:
ARCHIVE_OS="macos" ARCHIVE_OS="macos"
fi fi
ARCHIVE_NAME="llamactl-${{ github.ref_name }}-${ARCHIVE_OS}-${{ matrix.goarch }}" ARCHIVE_NAME="llamactl-${{ github.ref_name }}-${ARCHIVE_OS}-${{ matrix.goarch }}"
if [ "${{ matrix.goos }}" = "windows" ]; then if [ "${{ matrix.goos }}" = "windows" ]; then
zip "${ARCHIVE_NAME}.zip" "${BINARY_NAME}" # Use 7z on Windows (pre-installed)
7z a "${ARCHIVE_NAME}.zip" "${BINARY_NAME}"
echo "ASSET_PATH=${ARCHIVE_NAME}.zip" >> $GITHUB_ENV echo "ASSET_PATH=${ARCHIVE_NAME}.zip" >> $GITHUB_ENV
else else
tar -czf "${ARCHIVE_NAME}.tar.gz" "${BINARY_NAME}" tar -czf "${ARCHIVE_NAME}.tar.gz" "${BINARY_NAME}"
@@ -179,4 +197,4 @@ jobs:
with: with:
files: assets/checksums.txt files: assets/checksums.txt
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}