Skip to content

Commit bc630c5

Browse files
committed
Update release action/goreleaser to the latest version per https://developer.hashicorp.com/terraform/registry/providers/publishing
1 parent 9c870c4 commit bc630c5

File tree

2 files changed

+26
-34
lines changed

2 files changed

+26
-34
lines changed

.github/workflows/release.yml

Lines changed: 23 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,41 @@
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 (hashicorp/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-
name: release
1+
# Terraform Provider release workflow.
2+
name: Release
3+
4+
# This GitHub action creates a release when a tag that matches the pattern
5+
# "v*" (e.g. v0.1.0) is created.
136
on:
147
push:
158
tags:
169
- 'v*'
10+
11+
# Releases need permissions to read and write the repository contents.
12+
# GitHub considers creating releases and uploading assets as writing contents.
13+
permissions:
14+
contents: write
15+
1716
jobs:
1817
goreleaser:
1918
runs-on: ubuntu-latest
2019
steps:
21-
-
22-
name: Checkout
23-
uses: actions/checkout@v3
24-
-
25-
name: Unshallow
26-
run: git fetch --prune --unshallow
27-
-
28-
name: Set up Go
29-
uses: actions/setup-go@v3
20+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
21+
with:
22+
# Allow goreleaser to access older tag information.
23+
fetch-depth: 0
24+
- uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
3025
with:
3126
go-version-file: 'go.mod'
3227
cache: true
33-
-
34-
name: Import GPG key
28+
- name: Import GPG key
29+
uses: crazy-max/ghaction-import-gpg@cb9bde2e2525e640591a934b1fd28eef1dcaf5e5 # v6.2.0
3530
id: import_gpg
36-
uses: crazy-max/ghaction-import-gpg@v5
3731
with:
38-
# These secrets will need to be configured for the repository:
3932
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
4033
passphrase: ${{ secrets.PASSPHRASE }}
41-
-
42-
name: Run GoReleaser
43-
uses: goreleaser/[email protected]
34+
- name: Run GoReleaser
35+
uses: goreleaser/goreleaser-action@026299872805cb2db698e02dd7fb506a4da5122d # v6.2.0
4436
with:
45-
version: '~> v1'
46-
args: release --rm-dist
37+
args: release --clean
4738
env:
48-
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
49-
# GitHub sets this automatically
39+
# GitHub sets the GITHUB_TOKEN secret automatically.
5040
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41+
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}

.goreleaser.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
# Visit https://goreleaser.com for documentation on how to customize this
22
# behavior.
3+
version: 2
34
before:
45
hooks:
56
# this is just an example and not a requirement for provider building/publishing
67
- go mod tidy
78
builds:
89
- env:
910
# goreleaser does not work with CGO, it could also complicate
10-
# usage by users in CI/CD systems like Terraform Cloud where
11+
# usage by users in CI/CD systems like HCP Terraform where
1112
# they are unable to install libraries.
1213
- CGO_ENABLED=0
1314
mod_timestamp: '{{ .CommitTimestamp }}'
@@ -56,4 +57,4 @@ release:
5657
name_template: '{{ .ProjectName }}_{{ .Version }}_manifest.json'
5758
draft: true
5859
changelog:
59-
skip: true
60+
disable: true

0 commit comments

Comments
 (0)