Skip to content

Commit f3f5ef3

Browse files
committed
Fix release: use goreleaser-cross for CGO cross-compilation
goreleaser-cross has pre-installed cross-compilers for all target platforms, allowing CGO_ENABLED=1 builds for the crypto11/pkcs11 dependency. This replaces the failed native-runners approach (--split/--merge is GoReleaser Pro only).
1 parent 2556bdf commit f3f5ef3

2 files changed

Lines changed: 7 additions & 45 deletions

File tree

.github/workflows/release.yml

Lines changed: 5 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,8 @@ concurrency:
1313
cancel-in-progress: false
1414

1515
jobs:
16-
build:
17-
strategy:
18-
matrix:
19-
include:
20-
- runner: ubuntu-latest
21-
goos: linux
22-
- runner: macos-latest
23-
goos: darwin
24-
- runner: windows-latest
25-
goos: windows
26-
runs-on: ${{ matrix.runner }}
16+
release:
17+
runs-on: ubuntu-latest
2718

2819
steps:
2920
- name: Checkout
@@ -37,42 +28,11 @@ jobs:
3728
go-version-file: go.mod
3829
cache: true
3930

40-
- name: Build (split)
41-
uses: goreleaser/goreleaser-action@v6
42-
with:
43-
version: "~> v2"
44-
args: release --split
45-
env:
46-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47-
GOOS: ${{ matrix.goos }}
48-
49-
- name: Upload dist
50-
uses: actions/upload-artifact@v4
51-
with:
52-
name: dist-${{ matrix.goos }}
53-
path: dist/
54-
55-
publish:
56-
needs: build
57-
runs-on: ubuntu-latest
58-
59-
steps:
60-
- name: Checkout
61-
uses: actions/checkout@v4
62-
with:
63-
fetch-depth: 0
64-
65-
- name: Download all dist artifacts
66-
uses: actions/download-artifact@v4
67-
with:
68-
pattern: dist-*
69-
path: dist/
70-
merge-multiple: true
71-
72-
- name: Publish release
31+
- name: Publish release assets
7332
uses: goreleaser/goreleaser-action@v6
7433
with:
34+
distribution: goreleaser-cross
7535
version: "~> v2"
76-
args: continue --merge
36+
args: release --clean
7737
env:
7838
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.goreleaser.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ builds:
1010
- id: dci
1111
main: .
1212
binary: dci
13+
env:
14+
- CGO_ENABLED=1
1315
goos:
1416
- darwin
1517
- linux

0 commit comments

Comments
 (0)