-
Notifications
You must be signed in to change notification settings - Fork 1
35 lines (33 loc) · 1.26 KB
/
binaries.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
name: Release Binaries
on:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [ '1.21.x' ]
go-os: [ 'darwin', 'linux', 'windows' ]
go-arch: [ 'amd64', 'arm64' ]
steps:
- uses: actions/checkout@v4
- name: Setup Go ${{ matrix.go-version }}
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: Download Dependencies
run: go mod download
- name: Binary Name Unix
if: ${{ matrix.go-os != 'windows' }}
run: echo "BINARY_NAME=go-fitz-formpost-${{ github.ref_name }}-${{ matrix.go-os }}-${{ matrix.go-arch }}" >> $GITHUB_ENV
- name: Binary Name Windows
if: ${{ matrix.go-os == 'windows' }}
run: echo "BINARY_NAME=go-fitz-formpost-${{ github.ref_name }}-${{ matrix.go-os }}-${{ matrix.go-arch }}.exe" >> $GITHUB_ENV
- name: Go Build
run: GOOS=${{ matrix.go-os }} GOARCH=${{ matrix.go-arch }} go build -ldflags="-s -w" -o ${{ env.BINARY_NAME }}
- name: Upload Asset
# Note: "Settings > Actions > Workflow permissions > Read and write permissions" must be set
uses: softprops/action-gh-release@v1
with:
files: ${{ env.BINARY_NAME }}