Skip to content

Commit 683949c

Browse files
committed
Set up GitHub Actions based releasing
Adding signing w/ cosign along the way..
1 parent a18ba36 commit 683949c

File tree

3 files changed

+45
-3
lines changed

3 files changed

+45
-3
lines changed

.github/workflows/release.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
permissions:
9+
contents: write
10+
id-token: write
11+
12+
jobs:
13+
goreleaser:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
- uses: actions/setup-go@v5
20+
with:
21+
go-version-file: "go.mod"
22+
cache: true
23+
- name: Install Cosign
24+
uses: sigstore/cosign-installer@dc72c7d5c4d10cd6bcb8cf6e3fd625a9e5e537da
25+
- name: Run GoReleaser
26+
uses: goreleaser/goreleaser-action@9ed2f89a662bf1735a48bc8557fd212fa902bebf
27+
with:
28+
args: release --clean
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
HOMEBREW_TAP_PUBLISH_TOKEN: ${{ secrets.HOMEBREW_TAP_PUBLISH_TOKEN }}

.goreleaser.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,22 @@ builds:
1111
goarch:
1212
- amd64
1313
- arm64
14+
signs:
15+
- cmd: cosign
16+
signature: "${artifact}.sig"
17+
certificate: "${artifact}.pem"
18+
args:
19+
- sign-blob
20+
- "--oidc-provider=github-actions"
21+
- "--output-certificate=${certificate}"
22+
- "--output-signature=${signature}"
23+
- "${artifact}"
24+
- --yes
25+
artifacts: all
26+
output: true
1427
brews:
1528
- name: git-wip
1629
repository:
1730
owner: carhartl
1831
name: homebrew-tap
32+
token: "{{ .Env.HOMEBREW_TAP_PUBLISH_TOKEN }}"

release.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,5 @@
22

33
set -eu
44

5-
git stash --include-untracked # make way for Goreleaser
65
git tag "v$1" -m "Release v$1"
76
git push --tags
8-
goreleaser release --clean
9-
git stash pop --index

0 commit comments

Comments
 (0)