Skip to content

Commit ff31c7f

Browse files
author
Jan Berčič
committed
feat(build): Fix USB in macOS releases
As an aside, also add Linux aarch64 builds.
1 parent b1a4a4b commit ff31c7f

3 files changed

Lines changed: 53 additions & 7 deletions

File tree

.github/workflows/release.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ permissions:
1111
jobs:
1212
goreleaser:
1313
runs-on: ubuntu-latest
14+
container:
15+
image: ghcr.io/goreleaser/goreleaser-cross:v1.22.3
16+
options: --user 1001
1417
steps:
1518
- name: Checkout
1619
uses: actions/checkout@v4

.goreleaser.yaml

Lines changed: 49 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,67 @@ before:
55
- go mod tidy
66

77
universal_binaries:
8-
- replace: true
8+
- id: oasis-darwin-universal
9+
ids:
10+
- oasis-darwin-amd64
11+
- oasis-darwin-arm64
12+
replace: true
913
name_template: oasis
1014

15+
env:
16+
- CGO_ENABLED=1
17+
1118
builds:
12-
- binary: oasis
19+
- &build-common
20+
id: oasis-linux-amd64
21+
binary: oasis
22+
env:
23+
- CC=x86_64-linux-gnu-gcc
24+
- CXX=x86_64-linux-gnu-g++
25+
goos:
26+
- linux
27+
goarch:
28+
- amd64
1329
flags:
1430
- -trimpath
1531
ldflags:
1632
- -buildid=
1733
- "{{.Env.GOLDFLAGS_VERSION}}"
18-
targets:
19-
- linux_amd64
20-
- darwin_amd64
21-
- darwin_arm64
34+
- <<: *build-common
35+
id: oasis-linux-arm64
36+
env:
37+
- CC=aarch64-linux-gnu-gcc
38+
- CXX=aarch64-linux-gnu-g++
39+
goos:
40+
- linux
41+
goarch:
42+
- arm64
43+
- <<: *build-common
44+
id: oasis-darwin-amd64
45+
env:
46+
- CC=o64-clang
47+
- CXX=o64-clang++
48+
goos:
49+
- darwin
50+
goarch:
51+
- amd64
52+
- <<: *build-common
53+
id: oasis-darwin-arm64
54+
env:
55+
- CC=oa64-clang
56+
- CXX=oa64-clang++
57+
goos:
58+
- darwin
59+
goarch:
60+
- arm64
2261

2362
archives:
2463
- name_template: "{{replace .ProjectName \" \" \"_\" | tolower}}_{{.Version}}_{{.Os}}_{{.Arch}}"
2564
wrap_in_directory: true
65+
builds:
66+
- oasis-linux-amd64
67+
- oasis-linux-arm64
68+
- oasis-darwin-universal
2669

2770
checksum:
2871
name_template: SHA256SUMS-{{.Version}}.txt

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ lint: $(lint-targets)
5656

5757
# Release.
5858
release-build:
59-
@goreleaser release --rm-dist
59+
@goreleaser release --clean
6060

6161
# Test.
6262
test-targets := test-unit

0 commit comments

Comments
 (0)