Skip to content

Commit 53dd93e

Browse files
committed
add release flow
1 parent 4c9c76c commit 53dd93e

File tree

3 files changed

+91
-1
lines changed

3 files changed

+91
-1
lines changed

Diff for: .github/workflows/release.yml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v[0-9]+.[0-9]+.[0-9]+'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
goreleaser:
13+
runs-on: ubuntu-22.04
14+
steps:
15+
- uses: actions/[email protected]
16+
with:
17+
fetch-depth: 0
18+
19+
- uses: actions/[email protected]
20+
with:
21+
go-version-file: 'go.mod'
22+
cache: false
23+
24+
- name: Import GPG key
25+
uses: crazy-max/[email protected]
26+
id: import_gpg
27+
with:
28+
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
29+
passphrase: ${{ secrets.PASSPHRASE }}
30+
31+
- name: Run GoReleaser
32+
uses: goreleaser/[email protected]
33+
with:
34+
args: release --clean
35+
env:
36+
GITHUB_TOKEN: ${{ github.token }}
37+
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}

Diff for: .goreleaser.yml

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
before:
2+
hooks:
3+
- go mod tidy
4+
builds:
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+
- freebsd
14+
- windows
15+
- linux
16+
- darwin
17+
goarch:
18+
- amd64
19+
- '386'
20+
- arm
21+
- arm64
22+
ignore:
23+
- goos: darwin
24+
goarch: '386'
25+
binary: '{{ .ProjectName }}_v{{ .Version }}'
26+
archives:
27+
- format: zip
28+
name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}'
29+
checksum:
30+
extra_files:
31+
- glob: 'terraform-registry-manifest.json'
32+
name_template: '{{ .ProjectName }}_{{ .Version }}_manifest.json'
33+
name_template: '{{ .ProjectName }}_{{ .Version }}_SHA256SUMS'
34+
algorithm: sha256
35+
signs:
36+
- artifacts: checksum
37+
args:
38+
- "--batch"
39+
- "--local-user"
40+
- "{{ .Env.GPG_FINGERPRINT }}"
41+
- "--output"
42+
- "${signature}"
43+
- "--detach-sign"
44+
- "${artifact}"
45+
release:
46+
extra_files:
47+
- glob: 'terraform-registry-manifest.json'
48+
name_template: '{{ .ProjectName }}_{{ .Version }}_manifest.json'
49+
changelog:
50+
skip: true

Diff for: Makefile

+4-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,7 @@ path := $$HOME/.terraform.d/plugins/github.com/murtll/regru/${version}/linux_amd
33

44
build:
55
mkdir -p ${path}
6-
go build -o ${path}/terraform-provider-regru_${version}
6+
go build -o ${path}/terraform-provider-regru_${version}
7+
8+
get-go-version:
9+
@grep ^go go.mod | awk '{ print $$2 }'

0 commit comments

Comments
 (0)