Skip to content

Commit d00e21f

Browse files
committed
ci: added Go based relase workflow
Dropped Intel Mac along the way
1 parent 1a46308 commit d00e21f

1 file changed

Lines changed: 57 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v[0-9]*.[0-9]*.[0-9]*'
7+
8+
jobs:
9+
build:
10+
strategy:
11+
matrix:
12+
include:
13+
- runner: macos-latest
14+
target: aarch64-apple-darwin
15+
- runner: ubuntu-latest
16+
target: x86_64-unknown-linux-gnu
17+
- runner: ubuntu-24.04-arm
18+
target: aarch64-unknown-linux-gnu
19+
runs-on: ${{ matrix.runner }}
20+
steps:
21+
- uses: actions/checkout@v4
22+
- uses: actions/setup-go@v5
23+
with:
24+
go-version-file: go.mod
25+
- name: Build
26+
run: |
27+
CGO_ENABLED=1 go build \
28+
-ldflags "-X main.version=${GITHUB_REF_NAME}" \
29+
-o dryrun \
30+
./cmd/dryrun
31+
tar -cJf dry_run_cli-${{ matrix.target }}.tar.xz dryrun
32+
- uses: actions/upload-artifact@v4
33+
with:
34+
name: ${{ matrix.target }}
35+
path: dry_run_cli-${{ matrix.target }}.tar.xz
36+
retention-days: 1
37+
38+
release:
39+
needs: build
40+
runs-on: ubuntu-latest
41+
permissions:
42+
contents: write
43+
steps:
44+
- uses: actions/download-artifact@v4
45+
with:
46+
merge-multiple: true
47+
path: dist/
48+
- name: Checksums
49+
run: shasum -a 256 dist/*.tar.xz > dist/checksums.txt
50+
- name: Publish release
51+
run: |
52+
gh release create "$GITHUB_REF_NAME" \
53+
--title "$GITHUB_REF_NAME" \
54+
--generate-notes \
55+
dist/*.tar.xz dist/checksums.txt
56+
env:
57+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)