-
Notifications
You must be signed in to change notification settings - Fork 66
52 lines (50 loc) · 2.05 KB
/
build-release.yaml
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
name: Build Release
on:
release:
types: [published]
jobs:
releases-matrix:
name: Release Go Binary
runs-on: ubuntu-latest
strategy:
matrix:
# build and publish in parallel: linux/386, linux/amd64, linux/arm64, windows/386, windows/amd64, darwin/amd64, darwin/arm64
goos: [ linux, windows, darwin ]
goarch: [ amd64, arm64 ]
exclude:
- goarch: arm64
goos: windows
steps:
- uses: actions/checkout@v3
- name: Codebase security check
continue-on-error: true
uses: snyk/actions/golang@master
with:
go-version: '1.20'
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
- name: Set CC environment variable for cross-compilation
run: |
if [ "${{ matrix.goarch }}" = "arm64" ]; then
echo "CC=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
elif [ "${{ matrix.goarch }}" = "amd64" ]; then
echo "CC=x86_64-linux-gnu-gcc" >> $GITHUB_ENV
fi
- uses: wangyoucao577/[email protected]
env:
MIXPANEL_PROJECT_TOKEN: ${{ secrets.MIXPANEL_PROJECT_TOKEN }}
LILICO_TOKEN: ${{ secrets.LILICO_TOKEN }}
APP_VERSION: $(basename ${GITHUB_REF})
BUILD_TIME: $(date --iso-8601=seconds)
VERSION: ${{github.ref_name}}
COMMIT: ${{ github.sha }}
CGO_ENABLED: 1
CGO_FLAGS: "-O2 -D__BLST_PORTABLE__"
with:
pre_command: apt-get update && apt-get -y install gcc-aarch64-linux-gnu && make generate
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
goversion: "1.20"
project_path: "./cmd/flow"
ldflags: -X "github.com/onflow/flow-cli/build.commit=${{ env.COMMIT }}" -X "github.com/onflow/flow-cli/build.semver=${{ env.VERSION }}" -X "github.com/onflow/flow-cli/internal/command.mixpanelToken=${{ env.MIXPANEL_PROJECT_TOKEN }}" -X "github.com/onflow/flow-cli/internal/accounts.accountToken=${{ env.LILICO_TOKEN }}"