File tree Expand file tree Collapse file tree 2 files changed +16
-3
lines changed
Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -46,12 +46,18 @@ jobs:
4646 go-version-file : ' go.mod'
4747 cache : true
4848
49- - name : Install build dependencies (Linux)
50- if : matrix.goos == 'linux'
49+ - name : Install build dependencies (Linux amd64 )
50+ if : matrix.goos == 'linux' && matrix.goarch == 'amd64'
5151 run : |
5252 sudo apt-get update
5353 sudo apt-get install -y gcc libsqlite3-dev
5454
55+ - name : Install build dependencies (Linux arm64)
56+ if : matrix.goos == 'linux' && matrix.goarch == 'arm64'
57+ run : |
58+ sudo apt-get update
59+ sudo apt-get install -y gcc-aarch64-linux-gnu libsqlite3-dev
60+
5561 - name : Get version info
5662 id : version
5763 run : |
6773 CGO_ENABLED : ${{ matrix.cgo }}
6874 GOOS : ${{ matrix.goos }}
6975 GOARCH : ${{ matrix.goarch }}
76+ CC : ${{ matrix.goarch == 'arm64' && matrix.goos == 'linux' && 'aarch64-linux-gnu-gcc' || '' }}
7077 run : |
7178 go build -ldflags "-X github.com/inference-gateway/cli/cmd.version=${{ steps.version.outputs.version }} -X github.com/inference-gateway/cli/cmd.commit=${{ steps.version.outputs.commit }} -X github.com/inference-gateway/cli/cmd.date=${{ steps.version.outputs.date }}" -o infer-${{ matrix.goos }}-${{ matrix.goarch }} .
7279
Original file line number Diff line number Diff line change @@ -155,7 +155,13 @@ tasks:
155155 cmds :
156156 - mkdir -p dist
157157 - CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -ldflags "-X github.com/inference-gateway/cli/cmd.version={{.VERSION}} -X github.com/inference-gateway/cli/cmd.commit={{.COMMIT}} -X github.com/inference-gateway/cli/cmd.date={{.DATE}}" -o dist/{{.BINARY_NAME}}-linux-amd64 {{.MAIN_PACKAGE}}
158- - CGO_ENABLED=1 GOOS=linux GOARCH=arm64 go build -ldflags "-X github.com/inference-gateway/cli/cmd.version={{.VERSION}} -X github.com/inference-gateway/cli/cmd.commit={{.COMMIT}} -X github.com/inference-gateway/cli/cmd.date={{.DATE}}" -o dist/{{.BINARY_NAME}}-linux-arm64 {{.MAIN_PACKAGE}}
158+ - |
159+ if command -v aarch64-linux-gnu-gcc >/dev/null 2>&1; then
160+ CC=aarch64-linux-gnu-gcc CGO_ENABLED=1 GOOS=linux GOARCH=arm64 go build -ldflags "-X github.com/inference-gateway/cli/cmd.version={{.VERSION}} -X github.com/inference-gateway/cli/cmd.commit={{.COMMIT}} -X github.com/inference-gateway/cli/cmd.date={{.DATE}}" -o dist/{{.BINARY_NAME}}-linux-arm64 {{.MAIN_PACKAGE}}
161+ else
162+ echo "⚠ ARM64 cross-compiler not found, skipping linux-arm64 build"
163+ echo " Install: gcc-aarch64-linux-gnu (or build on ARM64 machine)"
164+ fi
159165 - cd dist && sha256sum {{.BINARY_NAME}}-* > checksums.txt
160166 - |
161167 if command -v cosign >/dev/null 2>&1; then
You can’t perform that action at this time.
0 commit comments