Skip to content

Commit 107e741

Browse files
techknowlogicktechknowlogick
authored andcommitted
github action to publish binaries to release (#10)
when tags are synch'd to github, this'll run and build the binaries and attach them to the release for use by terraform registry Reviewed-on: https://gitea.com/gitea/terraform-provider-gitea/pulls/10 Co-authored-by: techknowlogick <[email protected]> Co-committed-by: techknowlogick <[email protected]>
1 parent acf6b12 commit 107e741

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

.github/workflows/release.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: release
2+
on:
3+
push:
4+
tags:
5+
- 'v*'
6+
7+
permissions:
8+
contents: write
9+
10+
jobs:
11+
goreleaser:
12+
if: github.repository == 'go-gitea/terraform-provider-gitea'
13+
runs-on: ubuntu-latest
14+
steps:
15+
-
16+
name: Checkout
17+
uses: actions/checkout@v3
18+
name: Unshallow
19+
run: git fetch --prune --unshallow
20+
-
21+
name: Set up Go
22+
uses: actions/setup-go@v4
23+
with:
24+
go-version-file: 'go.mod'
25+
cache: true
26+
-
27+
name: Import GPG key
28+
uses: crazy-max/ghaction-import-gpg@v5
29+
id: import_gpg
30+
with:
31+
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
32+
passphrase: ${{ secrets.PASSPHRASE }}
33+
-
34+
name: Run GoReleaser
35+
uses: goreleaser/goreleaser-action@v4
36+
with:
37+
version: latest
38+
args: release --rm-dist
39+
env:
40+
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
41+
# GitHub sets this automatically
42+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)