Skip to content
This repository was archived by the owner on May 9, 2024. It is now read-only.

Commit a8a16eb

Browse files
authored
Merge pull request #141 from OpenVPN/update-goreleaser
Update goreleaser
2 parents c2b1b6d + 69cf2d2 commit a8a16eb

File tree

3 files changed

+35
-23
lines changed

3 files changed

+35
-23
lines changed

.github/workflows/release.yml

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,22 @@
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+
#
112
name: release
2-
313
on:
414
push:
515
tags:
6-
- "v[0-9]+.[0-9]+.[0-9]+*"
16+
- "v*"
17+
18+
permissions:
19+
contents: write
720

821
jobs:
922
goreleaser:
@@ -15,15 +28,14 @@ jobs:
1528
- name: Unshallow
1629
run: git fetch --prune --unshallow
1730

18-
- name: Set up Go
19-
uses: actions/setup-go@v5
31+
- uses: actions/setup-go@v5
2032
with:
2133
go-version-file: "go.mod"
2234
cache: true
2335

2436
- name: Import GPG key
37+
uses: crazy-max/ghaction-import-gpg@v6
2538
id: import_gpg
26-
uses: crazy-max/ghaction-import-gpg@v6.0.0
2739
with:
2840
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
2941
passphrase: ${{ secrets.PASSPHRASE }}
@@ -32,7 +44,7 @@ jobs:
3244
uses: goreleaser/goreleaser-action@v5.0.0
3345
with:
3446
version: latest
35-
args: release --rm-dist
47+
args: release --clean
3648
env:
37-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3849
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
50+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.goreleaser.yml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,42 @@
11
# Visit https://goreleaser.com for documentation on how to customize this
22
# behavior.
3+
34
before:
45
hooks:
5-
# this is just an example and not a requirement for provider building/publishing
66
- go mod tidy
77
builds:
88
- env:
99
# goreleaser does not work with CGO, it could also complicate
1010
# usage by users in CI/CD systems like Terraform Cloud where
1111
# they are unable to install libraries.
1212
- CGO_ENABLED=0
13-
mod_timestamp: '{{ .CommitTimestamp }}'
13+
mod_timestamp: "{{ .CommitTimestamp }}"
1414
flags:
1515
- -trimpath
1616
ldflags:
17-
- '-s -w -X main.version={{.Version}} -X main.commit={{.Commit}}'
17+
- "-s -w -X main.version={{.Version}} -X main.commit={{.Commit}}"
1818
goos:
1919
- freebsd
2020
- windows
2121
- linux
2222
- darwin
2323
goarch:
2424
- amd64
25-
- '386'
25+
- "386"
2626
- arm
2727
- arm64
2828
ignore:
2929
- goos: darwin
30-
goarch: '386'
31-
binary: '{{ .ProjectName }}_v{{ .Version }}'
30+
goarch: "386"
31+
binary: "{{ .ProjectName }}_v{{ .Version }}"
3232
archives:
3333
- format: zip
34-
name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}'
34+
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
3535
checksum:
3636
extra_files:
37-
- glob: 'terraform-registry-manifest.json'
38-
name_template: '{{ .ProjectName }}_{{ .Version }}_manifest.json'
39-
name_template: '{{ .ProjectName }}_{{ .Version }}_SHA256SUMS'
37+
- glob: "terraform-registry-manifest.json"
38+
name_template: "{{ .ProjectName }}_{{ .Version }}_manifest.json"
39+
name_template: "{{ .ProjectName }}_{{ .Version }}_SHA256SUMS"
4040
algorithm: sha256
4141
signs:
4242
- artifacts: checksum
@@ -45,16 +45,16 @@ signs:
4545
# need to pass the batch flag to indicate its not interactive.
4646
- "--batch"
4747
- "--local-user"
48-
- "{{ .Env.GPG_FINGERPRINT }}" # set this environment variable for your signing key
48+
- "{{ .Env.GPG_FINGERPRINT }}"
4949
- "--output"
5050
- "${signature}"
5151
- "--detach-sign"
5252
- "${artifact}"
5353
release:
5454
extra_files:
55-
- glob: 'terraform-registry-manifest.json'
56-
name_template: '{{ .ProjectName }}_{{ .Version }}_manifest.json'
57-
# If you want to manually examine the release before its live, uncomment this line:
58-
# draft: true
55+
- glob: "terraform-registry-manifest.json"
56+
name_template: "{{ .ProjectName }}_{{ .Version }}_manifest.json"
57+
# Manually examine the release before it goes live:
58+
draft: true
5959
changelog:
6060
skip: true

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ build:
1111
go build -o ${BINARY}
1212

1313
release:
14-
goreleaser release --rm-dist --snapshot --skip-publish --skip-sign
14+
goreleaser release --clean --snapshot --skip-publish --skip-sign
1515

1616
install: build
1717
mkdir -p ~/.terraform.d/plugins/${HOSTNAME}/${NAMESPACE}/${NAME}/${VERSION}/${OS_ARCH}

0 commit comments

Comments
 (0)