Skip to content

Commit 252aebc

Browse files
committed
fix: add different jobs for windows and darwin with expected Go envs
1 parent 05cf85e commit 252aebc

File tree

2 files changed

+38
-4
lines changed

2 files changed

+38
-4
lines changed

.github/workflows/release.yaml

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,37 @@ on:
33
types: [created]
44

55
jobs:
6-
releases-matrix:
6+
- releases-windows:
7+
name: Release Authorizer Binary
8+
runs-on: ubuntu-latest
9+
strategy:
10+
matrix:
11+
# build and publish in parallel: linux/386, linux/amd64, windows/386, windows/amd64, darwin/amd64
12+
goos: [windows]
13+
goarch: [amd64]
14+
# goarch: ['386', amd64]
15+
# exclude:
16+
# - goarch: '386'
17+
# goos: darwin
18+
steps:
19+
- uses: actions/checkout@v2
20+
- name: Install dependencies
21+
run: sudo apt-get install build-essential gcc_mingw64
22+
- name: Set VERSION env
23+
run: echo VERSION=$(basename ${GITHUB_REF}) >> ${GITHUB_ENV}
24+
- name: Set GO env
25+
env:
26+
- CGO_ENABLED=1
27+
- CC=x86_64-w64-mingw32-gcc
28+
- uses: wangyoucao577/[email protected]
29+
with:
30+
github_token: ${{ secrets.RELEASE_TOKEN }}
31+
goos: ${{ matrix.goos }}
32+
goarch: ${{ matrix.goarch }}
33+
build_command: make clean && make
34+
md5sum: FALSE
35+
extra_files: .env.sample app build template
36+
- releases-darwin:
737
name: Release Authorizer Binary
838
runs-on: ubuntu-latest
939
strategy:
@@ -17,10 +47,14 @@ jobs:
1747
# goos: darwin
1848
steps:
1949
- uses: actions/checkout@v2
20-
- name: Install xmllint
21-
run: sudo apt-get install build-essential
50+
- name: Install dependencies
51+
run: sudo apt-get install build-essential gcc g++ zlib1g-dev libmpc-dev libmpfr-dev libgmp-dev
2252
- name: Set VERSION env
2353
run: echo VERSION=$(basename ${GITHUB_REF}) >> ${GITHUB_ENV}
54+
- name: Set GO env
55+
env:
56+
- CGO_ENABLED=1
57+
- CC=o64-clang
2458
- uses: wangyoucao577/[email protected]
2559
with:
2660
github_token: ${{ secrets.RELEASE_TOKEN }}

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ DEFAULT_VERSION=0.1.0-local
22
VERSION := $(or $(VERSION),$(DEFAULT_VERSION))
33

44
cmd:
5-
cd server && CGO_ENABLED=1 go build -ldflags "-w -X main.Version=$(VERSION)" -o '../build/server'
5+
cd server && go build -ldflags "-w -X main.Version=$(VERSION)" -o '../build/server'
66
clean:
77
rm -rf build

0 commit comments

Comments
 (0)