Skip to content

Commit c475643

Browse files
committed
root: Add CI for terraform-provider-registry
1 parent 7697ccd commit c475643

File tree

2 files changed

+48
-18
lines changed

2 files changed

+48
-18
lines changed

.github/workflows/release.yml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
---
2-
name: goreleaser
3-
1+
name: release
42
on:
53
push:
64
tags:
7-
- '*'
8-
5+
- 'v*'
96
jobs:
107
goreleaser:
118
runs-on: ubuntu-latest
@@ -18,14 +15,22 @@ jobs:
1815
run: git fetch --prune --unshallow
1916
-
2017
name: Set up Go
21-
uses: actions/setup-go@v1
18+
uses: actions/setup-go@v2
2219
with:
23-
go-version: 1.14.x
20+
go-version: 1.14
21+
-
22+
name: Import GPG key
23+
id: import_gpg
24+
uses: paultyng/[email protected]
25+
env:
26+
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
27+
PASSPHRASE: ${{ secrets.PASSPHRASE }}
2428
-
2529
name: Run GoReleaser
26-
uses: goreleaser/goreleaser-action@v1
30+
uses: goreleaser/goreleaser-action@v2
2731
with:
2832
version: latest
2933
args: release --rm-dist
3034
env:
35+
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
3136
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.goreleaser.yml

Lines changed: 35 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,37 @@
1+
before:
2+
hooks:
3+
- go mod tidy
14
builds:
2-
- binary: terraform-provider-linuxkit_v{{.Version}}
3-
env:
4-
- CGO_ENABLED=0
5-
goos:
6-
- darwin
7-
- linux
8-
- windows
9-
goarch:
10-
- amd64
5+
- env:
6+
- CGO_ENABLED=0
7+
mod_timestamp: '{{ .CommitTimestamp }}'
8+
flags:
9+
- -trimpath
10+
ldflags:
11+
- '-s -w -X main.version={{.Version}} -X main.commit={{.Commit}}'
12+
goos:
13+
- windows
14+
- linux
15+
- darwin
16+
goarch:
17+
- amd64
18+
- arm
19+
- arm64
20+
binary: '{{ .ProjectName }}_v{{ .Version }}'
1121
archives:
12-
- format: zip
22+
- format: zip
23+
name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}'
24+
checksum:
25+
name_template: '{{ .ProjectName }}_{{ .Version }}_SHA256SUMS'
26+
algorithm: sha256
27+
signs:
28+
- artifacts: checksum
29+
args:
30+
- "--batch"
31+
- "--local-user"
32+
- "{{ .Env.GPG_FINGERPRINT }}" # set this environment variable for your signing key
33+
- "--output"
34+
- "${signature}"
35+
- "--detach-sign"
36+
- "${artifact}"
37+
release:

0 commit comments

Comments
 (0)