Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
988a332249 | ||
29d91d1133 | |||
f40c54ebc1 |
@@ -33,22 +33,34 @@ jobs:
|
|||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
uses: actions/setup-go@v4
|
uses: actions/setup-go@v4
|
||||||
with:
|
with:
|
||||||
go-version: 'stable'
|
go-version: '1.24.5'
|
||||||
|
|
||||||
|
- name: Cache Go modules
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/.cache/go-build
|
||||||
|
~/go/pkg/mod
|
||||||
|
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-go-
|
||||||
|
|
||||||
|
- name: Download Go dependencies
|
||||||
|
run: go mod download
|
||||||
|
|
||||||
- name: Build binaries
|
- name: Build binaries
|
||||||
run: |
|
run: |
|
||||||
OUTPUT="bin/${{ env.APP_NAME }}-${{ matrix.os }}-${{ matrix.arch }}"
|
OUTPUT="bin/${APP_NAME}-${{ matrix.os }}-${{ matrix.arch }}"
|
||||||
if [ "${{ matrix.arm_version }}" != "" ]; then
|
if [ -n "${{ matrix.arm_version }}" ]; then
|
||||||
OUTPUT="${OUTPUT}v${{ matrix.arm_version }}"
|
OUTPUT="${OUTPUT}v${{ matrix.arm_version }}"
|
||||||
|
export GOARM=${{ matrix.arm_version }}
|
||||||
fi
|
fi
|
||||||
OUTPUT="${OUTPUT}${{ matrix.ext }}"
|
OUTPUT="${OUTPUT}${{ matrix.ext }}"
|
||||||
echo "Building $OUTPUT"
|
echo "Building $OUTPUT"
|
||||||
GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} \
|
GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} go build -ldflags="-s -w" -trimpath -o "$OUTPUT"
|
||||||
{{ matrix.arm_version && format('GOARM={0}', matrix.arm_version) || '' }} \
|
|
||||||
go build -ldflags="-s -w" -trimpath -o "$OUTPUT"
|
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: Upload artifacts
|
- name: Upload artifacts
|
||||||
|
Reference in New Issue
Block a user