Skip to content

Commit 0a99b81

Browse files
committed
chore(gh): update release workflow
Update release workflow. Signed-off-by: Ryan Johnson <[email protected]>
1 parent dae929f commit 0a99b81

File tree

3 files changed

+44
-53
lines changed

3 files changed

+44
-53
lines changed

.github/workflows/release.yml

+5-12
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Release
33
on:
44
push:
55
tags:
6-
- 'v*'
6+
- "v*"
77

88
permissions:
99
contents: write
@@ -12,21 +12,14 @@ jobs:
1212
goreleaser:
1313
runs-on: ubuntu-latest
1414
steps:
15-
- name: Checkout
15+
- name: Checkout Repository
1616
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
1717
with:
1818
fetch-depth: 0
1919
- name: Setup Go
2020
uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
2121
with:
22-
go-version-file: 'go.mod'
23-
- name: golangci-lint
24-
uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # v6.1.1
25-
with:
26-
version: v1.61
27-
args: --issues-exit-code=1 --timeout=30m
28-
skip-pkg-cache: true
29-
skip-build-cache: true
22+
go-version-file: "go.mod"
3023
- name: Import GPG Key
3124
id: import_gpg
3225
uses: crazy-max/ghaction-import-gpg@cb9bde2e2525e640591a934b1fd28eef1dcaf5e5 # v6.2.0
@@ -37,7 +30,7 @@ jobs:
3730
uses: goreleaser/goreleaser-action@9ed2f89a662bf1735a48bc8557fd212fa902bebf # v6.1.0
3831
with:
3932
version: latest
40-
args: release --rm-dist --release-header .goreleaser.tmpl
33+
args: release --clean --timeout 60m --release-header-tmpl .goreleaser.tmpl
4134
env:
4235
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43-
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
36+
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}

.goreleaser.yml

+33-41
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,52 @@
1-
# Visit https://goreleaser.com for documentation on how to customize this
2-
# behavior.
1+
version: 2
2+
33
before:
44
hooks:
5-
# this is just an example and not a requirement for provider building/publishing
65
- go mod tidy
76
builds:
8-
- env:
9-
# goreleaser does not work with CGO, it could also complicate
10-
# usage by users in CI/CD systems like Terraform Cloud where
11-
# they are unable to install libraries.
12-
- CGO_ENABLED=0
13-
mod_timestamp: '{{ .CommitTimestamp }}'
14-
flags:
15-
- -trimpath
16-
ldflags:
17-
- '-s -w -X main.version={{.Version}} -X main.commit={{.Commit}}'
18-
goos:
19-
- freebsd
20-
- windows
21-
- linux
22-
- darwin
23-
goarch:
24-
- amd64
25-
- '386'
26-
- arm
27-
- arm64
28-
ignore:
29-
- goos: darwin
30-
goarch: '386'
31-
binary: '{{ .ProjectName }}_v{{ .Version }}'
7+
- env:
8+
- CGO_ENABLED=0
9+
mod_timestamp: '{{ .CommitTimestamp }}'
10+
flags:
11+
- -trimpath
12+
ldflags:
13+
- '-s -w -X main.version={{.Version}} -X main.commit={{.Commit}}'
14+
goos:
15+
- freebsd
16+
- windows
17+
- linux
18+
- darwin
19+
goarch:
20+
- amd64
21+
- '386'
22+
- arm
23+
- arm64
24+
ignore:
25+
- goos: darwin
26+
goarch: '386'
27+
binary: '{{ .ProjectName }}_v{{ .Version }}'
3228
archives:
33-
- format: zip
34-
name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}'
29+
- format: zip
30+
name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}'
3531
checksum:
32+
extra_files:
33+
- glob: 'terraform-registry-manifest.json'
34+
name_template: '{{ .ProjectName }}_{{ .Version }}_manifest.json'
3635
name_template: '{{ .ProjectName }}_{{ .Version }}_SHA256SUMS'
3736
algorithm: sha256
3837
signs:
3938
- artifacts: checksum
4039
args:
41-
# if you are using this is a GitHub action or some other automated pipeline, you
42-
# need to pass the batch flag to indicate it's not interactive.
4340
- "--batch"
4441
- "--local-user"
45-
- "{{ .Env.GPG_FINGERPRINT }}" # set this environment variable for your signing key
42+
- "{{ .Env.GPG_FINGERPRINT }}"
4643
- "--output"
4744
- "${signature}"
4845
- "--detach-sign"
4946
- "${artifact}"
5047
release:
51-
# Visit your project's GitHub Releases page to publish this release.
52-
draft: true
48+
extra_files:
49+
- glob: 'terraform-registry-manifest.json'
50+
name_template: '{{ .ProjectName }}_{{ .Version }}_manifest.json'
5351
changelog:
54-
filters:
55-
exclude:
56-
- '^docs:'
57-
- '^test:'
58-
- Merge pull request
59-
- Merge branch
60-
- go mod tidy
52+
disable: true

terraform-registry-manifest.json

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"version": 1,
3+
"metadata": {
4+
"protocol_versions": ["5.0"]
5+
}
6+
}

0 commit comments

Comments
 (0)