Skip to content

Commit 5a26e3a

Browse files
committed
ci: enable CGO (provides mDNS support)
1 parent eb48191 commit 5a26e3a

File tree

6 files changed

+119
-23
lines changed

6 files changed

+119
-23
lines changed

.github/workflows/release.yml

Lines changed: 68 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,56 @@ permissions:
99
contents: write
1010

1111
jobs:
12+
build-darwin:
13+
runs-on: macos-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v3
17+
with:
18+
fetch-depth: 0
19+
- name: Setup Go
20+
uses: actions/setup-go@v3
21+
with:
22+
go-version: stable
23+
- name: Build
24+
uses: goreleaser/goreleaser-action@v4
25+
with:
26+
version: latest
27+
args: release --skip-publish --config .goreleaser.darwin.yml
28+
env:
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30+
- name: Upload
31+
uses: actions/upload-artifact@v3
32+
with:
33+
name: tron-darwin
34+
path: dist/tron*
35+
build-linux:
36+
runs-on: ubuntu-latest
37+
steps:
38+
- name: Checkout
39+
uses: actions/checkout@v3
40+
with:
41+
fetch-depth: 0
42+
- name: Setup Go
43+
uses: actions/setup-go@v3
44+
with:
45+
go-version: stable
46+
- name: Install cross-compiler for linux/arm64
47+
run: sudo apt-get -y install gcc-aarch64-linux-gnu
48+
- name: Build
49+
uses: goreleaser/goreleaser-action@v4
50+
with:
51+
version: latest
52+
args: release --skip-publish --config .goreleaser.linux.yml
53+
env:
54+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55+
- name: Upload
56+
uses: actions/upload-artifact@v3
57+
with:
58+
name: tron-linux
59+
path: dist/tron*
1260
release:
61+
needs: [build-darwin, build-linux]
1362
runs-on: ubuntu-latest
1463
steps:
1564
- name: Checkout
@@ -20,10 +69,27 @@ jobs:
2069
uses: actions/setup-go@v3
2170
with:
2271
go-version: stable
23-
- name: Run GoReleaser
72+
- name: Download darwin binaries
73+
uses: actions/download-artifact@v3
74+
with:
75+
name: tron-darwin
76+
path: ./tron-build/darwin
77+
- name: Download linux binaries
78+
uses: actions/download-artifact@v3
79+
with:
80+
name: tron-linux
81+
path: ./tron-build/linux
82+
- name: Merge checksums
83+
run: |
84+
cd tron-build
85+
cat ./darwin/tron*checksums.txt >> checksums.txt
86+
cat ./linux/tron*checksums.txt >> checksums.txt
87+
rm ./darwin/tron*checksums.txt
88+
rm ./linux/tron*checksums.txt
89+
- name: Release
2490
uses: goreleaser/goreleaser-action@v4
2591
with:
2692
version: latest
27-
args: release --rm-dist
93+
args: release --config .goreleaser.release.yml
2894
env:
2995
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,6 @@ Session.vim
2222

2323
# GoReleaser output
2424
dist/
25+
26+
# GitHub artifacts
27+
tron-build/

.goreleaser.darwin.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
before:
2+
hooks:
3+
- go mod tidy
4+
builds:
5+
- env:
6+
- CGO_ENABLED=1
7+
goos:
8+
- darwin
9+
goarch:
10+
- amd64
11+
- arm64
12+
snapshot:
13+
name_template: "{{ .Tag }}-next"

.goreleaser.linux.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
before:
2+
hooks:
3+
- go mod tidy
4+
builds:
5+
- env:
6+
- CGO_ENABLED=1
7+
goos:
8+
- linux
9+
goarch:
10+
- amd64
11+
- arm64
12+
overrides:
13+
- goos: linux
14+
goarch: amd64
15+
env:
16+
- CC=gcc
17+
- goos: linux
18+
goarch: arm64
19+
env:
20+
- CC=aarch64-linux-gnu-gcc
21+
snapshot:
22+
name_template: "{{ .Tag }}-next"

.goreleaser.release.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
builds:
2+
- skip: true
3+
changelog:
4+
sort: asc
5+
filters:
6+
exclude:
7+
- "^ci:"
8+
- "^docs:"
9+
- "^test:"
10+
release:
11+
extra_files:
12+
- glob: ./tron-build/**/*
13+
- glob: ./tron-build/checksums.txt

.goreleaser.yml

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)