Skip to content

Commit ce925d5

Browse files
committed
Add release workflow
1 parent eab7b14 commit ce925d5

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

.github/workflows/release.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# This GitHub action can publish assets for release when a tag is created.
2+
# Currently its setup to run on any tag that matches the pattern "v*" (ie. v0.1.0).
3+
#
4+
# This uses an action (crazy-max/ghaction-import-gpg) that assumes you set your
5+
# private key in the `GPG_PRIVATE_KEY` secret and passphrase in the `PASSPHRASE`
6+
# secret. If you would rather own your own GPG handling, please fork this action
7+
# or use an alternative one for key handling.
8+
#
9+
# You will need to pass the `--batch` flag to `gpg` in your signing step
10+
# in `goreleaser` to indicate this is being used in a non-interactive mode.
11+
#
12+
13+
---
14+
name: release
15+
16+
on:
17+
push:
18+
tags:
19+
- "v*"
20+
21+
jobs:
22+
goreleaser:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v5
27+
with:
28+
fetch-depth: 0
29+
30+
- name: Setup Go env
31+
uses: actions/setup-go@v5
32+
with:
33+
go-version-file: "go.mod"
34+
35+
- name: Import GPG key
36+
id: import_gpg
37+
uses: crazy-max/ghaction-import-gpg@v6
38+
with:
39+
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
40+
passphrase: ${{ secrets.PASSPHRASE }}
41+
42+
- name: Run GoReleaser
43+
uses: goreleaser/goreleaser-action@v6
44+
with:
45+
version: "~> v2"
46+
args: release --clean
47+
env:
48+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49+
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}

0 commit comments

Comments
 (0)