-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (64 loc) · 1.86 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: Release llmcat
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
build:
strategy:
matrix:
include:
- os: ubuntu-latest
targets: linux
setup: |
sudo apt-get update
sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu libc6-dev-arm64-cross
echo "CC_ARM64=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
echo "CXX_ARM64=aarch64-linux-gnu-g++" >> $GITHUB_ENV
- os: macos-latest
targets: darwin
setup: ""
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.21'
- name: Setup cross-compilation
run: ${{ matrix.setup }}
- name: Build binaries
run: |
OS=${{ matrix.targets }}
# Build amd64
make bin/$OS/amd64/llmcat
# Build arm64 (with cross-compiler for Linux)
if [ "$OS" = "linux" ]; then
CC=$CC_ARM64 CXX=$CXX_ARM64 make bin/$OS/arm64/llmcat
else
make bin/$OS/arm64/llmcat
fi
# Rename for release
cd bin
for arch in amd64 arm64; do
mv $OS/$arch/llmcat llmcat-$OS-$arch
done
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: binaries-${{ matrix.targets }}
path: bin/llmcat-*
release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
- name: Create Release
uses: softprops/action-gh-release@v1
with:
generate_release_notes: true
files: |
binaries-*/llmcat-*