mirror of
https://github.com/lordmathis/llamactl.git
synced 2025-12-22 17:14:22 +00:00
Update release.yaml
This commit is contained in:
72
.github/workflows/release.yaml
vendored
72
.github/workflows/release.yaml
vendored
@@ -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,20 +78,23 @@ jobs:
|
|||||||
name: webui-dist
|
name: webui-dist
|
||||||
path: webui/dist/
|
path: webui/dist/
|
||||||
|
|
||||||
- name: Build binary
|
- 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 (Unix)
|
||||||
|
if: matrix.goos != 'windows'
|
||||||
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
|
|
||||||
BINARY_NAME="llamactl"
|
|
||||||
if [ "${{ matrix.goos }}" = "windows" ]; then
|
|
||||||
BINARY_NAME="${BINARY_NAME}.exe"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Build the binary
|
# Build the binary
|
||||||
go build -ldflags="-s -w -X main.version=${{ github.ref_name }} -X main.commit=${{ github.sha }} -X main.date=$(date -u +%Y-%m-%dT%H:%M:%SZ)" -o "${BINARY_NAME}" ./cmd/server
|
go build -ldflags="-s -w -X main.version=${{ github.ref_name }} -X main.commit=${{ github.sha }} -X main.date=$(date -u +%Y-%m-%dT%H:%M:%SZ)" -o llamactl ./cmd/server
|
||||||
|
|
||||||
# Create archive
|
# Create archive
|
||||||
ARCHIVE_OS="${{ matrix.goos }}"
|
ARCHIVE_OS="${{ matrix.goos }}"
|
||||||
@@ -91,16 +102,33 @@ 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
|
tar -czf "${ARCHIVE_NAME}.tar.gz" llamactl
|
||||||
zip "${ARCHIVE_NAME}.zip" "${BINARY_NAME}"
|
|
||||||
echo "ASSET_PATH=${ARCHIVE_NAME}.zip" >> $GITHUB_ENV
|
|
||||||
else
|
|
||||||
tar -czf "${ARCHIVE_NAME}.tar.gz" "${BINARY_NAME}"
|
|
||||||
echo "ASSET_PATH=${ARCHIVE_NAME}.tar.gz" >> $GITHUB_ENV
|
echo "ASSET_PATH=${ARCHIVE_NAME}.tar.gz" >> $GITHUB_ENV
|
||||||
fi
|
|
||||||
|
|
||||||
echo "ASSET_NAME=${ARCHIVE_NAME}" >> $GITHUB_ENV
|
echo "ASSET_NAME=${ARCHIVE_NAME}" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Build binary (Windows)
|
||||||
|
if: matrix.goos == 'windows'
|
||||||
|
env:
|
||||||
|
GOOS: ${{ matrix.goos }}
|
||||||
|
GOARCH: ${{ matrix.goarch }}
|
||||||
|
CGO_ENABLED: 1
|
||||||
|
shell: pwsh
|
||||||
|
run: |
|
||||||
|
# Build the binary
|
||||||
|
$version = "${{ github.ref_name }}"
|
||||||
|
$commit = "${{ github.sha }}"
|
||||||
|
$date = (Get-Date).ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ssZ")
|
||||||
|
$ldflags = "-s -w -X main.version=$version -X main.commit=$commit -X main.date=$date"
|
||||||
|
|
||||||
|
go build -ldflags="$ldflags" -o llamactl.exe ./cmd/server
|
||||||
|
|
||||||
|
# Create archive
|
||||||
|
$archiveName = "llamactl-${{ github.ref_name }}-windows-${{ matrix.goarch }}"
|
||||||
|
Compress-Archive -Path llamactl.exe -DestinationPath "$archiveName.zip"
|
||||||
|
|
||||||
|
echo "ASSET_PATH=$archiveName.zip" >> $env:GITHUB_ENV
|
||||||
|
echo "ASSET_NAME=$archiveName" >> $env:GITHUB_ENV
|
||||||
|
|
||||||
- name: Upload build artifacts
|
- name: Upload build artifacts
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
|
|||||||
Reference in New Issue
Block a user