Skip to content

Commit a1dd8ef

Browse files
committed
ci: Update the GoReleaser configuration.
1 parent e0b5924 commit a1dd8ef

File tree

1 file changed

+89
-218
lines changed

1 file changed

+89
-218
lines changed

.goreleaser.yml

+89-218
Original file line numberDiff line numberDiff line change
@@ -1,247 +1,118 @@
11
---
2-
# Pro License
3-
variables:
4-
SourceOrg: ''
5-
SourceRepo: terraform-provider-corefunc
6-
Description: Utilities that should have been Terraform_core functions.
7-
MaintainerName: Northwood Labs
8-
MaintainerEmail: ''
9-
AppleCertificateID: ''
10-
GPGKeyID: ''
11-
122
project_name: terraform-provider-corefunc
133
dist: ./dist
144

15-
changelog:
16-
skip: false
5+
# https://goreleaser.com/customization/reportsizes/
6+
report_sizes: true
177

18-
archives:
19-
- id: linux-archive
20-
builds:
21-
- linux
22-
allow_different_binary_count: false
23-
wrap_in_directory: false
24-
format: zip
25-
files:
26-
- none*
27-
name_template: '{{ .ProjectName }}_v{{ .Version }}_{{ .Os }}_{{ .Arch }}'
28-
29-
- id: windows-archive
30-
builds:
31-
- windows
32-
allow_different_binary_count: false
33-
wrap_in_directory: false
34-
format: zip
35-
files:
36-
- none*
37-
name_template: '{{ .ProjectName }}_v{{ .Version }}_{{ .Os }}_{{ .Arch }}'
38-
39-
- id: macos-archive
40-
builds:
41-
- macos-universal
42-
allow_different_binary_count: false
43-
wrap_in_directory: false
44-
format: zip
45-
files:
46-
- none*
47-
name_template: '{{ .ProjectName }}_v{{ .Version }}_{{ .Os }}_universal'
8+
before:
9+
hooks:
10+
- make tidy
4811

12+
# https://goreleaser.com/customization/builds/
4913
builds:
50-
#-----------------------------------------------------------------------------
51-
# Linux
52-
53-
- id: linux
54-
dir: .
55-
main: .
56-
binary: '{{ .ProjectName }}_v{{ .Version }}'
57-
skip: false
58-
ldflags:
59-
- -s -w
60-
- -X main.commit={{.Commit}}
61-
- -X main.date={{.Date}}
62-
- -X main.version={{.Version}}
63-
env:
14+
- env:
6415
- CGO_ENABLED=0
65-
goos:
66-
- linux
67-
goarch:
68-
- amd64
69-
- arm64
70-
# GOAMD64 to build when GOARCH is amd64. https://en.wikipedia.org/wiki/X86-64#Microarchitecture_levels
71-
# goamd64:
72-
# - v1 # (general purpose)
73-
# - v2 # (c. 2009, QEMU)
74-
# - v3 # (c. 2015)
75-
# - v4 # (c. 2021)
76-
hooks:
77-
pre:
78-
- make build-release-prep
79-
post:
80-
# any binary signatures that should happen
81-
82-
#-----------------------------------------------------------------------------
83-
# Windows
84-
85-
- id: windows
86-
dir: .
87-
main: .
88-
binary: '{{ .ProjectName }}_v{{ .Version }}'
89-
skip: false
16+
mod_timestamp: '{{ .CommitTimestamp }}'
17+
flags:
18+
- -trimpath
9019
ldflags:
91-
- -s -w
92-
- -X main.commit={{.Commit}}
93-
- -X main.date={{.Date}}
94-
- -X main.version={{.Version}}
95-
env:
96-
- CGO_ENABLED=0
20+
- -s -w -X github.com/northwood-labs/terraform-provider-corefunc/cmd.Version={{.Version}}
9721
goos:
22+
- freebsd
23+
- openbsd
24+
- solaris
9825
- windows
99-
goarch:
100-
- amd64
101-
- arm64
102-
# GOAMD64 to build when GOARCH is amd64. https://en.wikipedia.org/wiki/X86-64#Microarchitecture_levels
103-
# goamd64:
104-
# - v1 # (general purpose)
105-
# - v2 # (c. 2009, QEMU)
106-
# - v3 # (c. 2015)
107-
# - v4 # (c. 2021)
108-
hooks:
109-
pre:
110-
- make build-release-prep
111-
post:
112-
# any binary signatures that should happen
113-
114-
#-----------------------------------------------------------------------------
115-
# macOS
116-
117-
- id: macos
118-
dir: .
119-
main: .
120-
binary: '{{ .ProjectName }}_v{{ .Version }}'
121-
skip: false
122-
ldflags:
123-
- -s -w
124-
- -X main.commit={{.Commit}}
125-
- -X main.date={{.Date}}
126-
- -X main.version={{.Version}}
127-
env:
128-
- CGO_ENABLED=0
129-
goos:
26+
- linux
13027
- darwin
13128
goarch:
13229
- amd64
30+
- '386'
31+
- arm
13332
- arm64
134-
# GOAMD64 to build when GOARCH is amd64. https://en.wikipedia.org/wiki/X86-64#Microarchitecture_levels
135-
# goamd64:
136-
# - v1 # (general purpose)
137-
# - v2 # (c. 2009, QEMU)
138-
# - v3 # (c. 2015)
139-
# - v4 # (c. 2021)
140-
hooks:
141-
pre:
142-
- make build-release-prep
33+
ignore:
34+
- goos: darwin
35+
goarch: '386'
36+
- goos: openbsd
37+
goarch: arm
38+
- goos: openbsd
39+
goarch: arm64
40+
binary: '{{ .ProjectName }}_v{{ .Version }}'
14341

144-
universal_binaries:
145-
- id: macos-universal
146-
ids:
147-
- macos
148-
name_template: '{{ .ProjectName }}_v{{ .Version }}'
149-
replace: true
150-
hooks:
151-
post:
152-
# Apple Account
153-
# https://developer.apple.com/account/resources/certificates/
154-
- codesign -s {{.Var.AppleCertificateID}} -o runtime -v './dist/macos-universal_darwin_all/{{.ProjectName}}_v{{ .Version
155-
}}'
42+
# https://goreleaser.com/customization/archive/
43+
archives:
44+
- format: zip
45+
name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}'
15646

47+
# https://goreleaser.com/customization/checksum/
15748
checksum:
158-
name_template: '{{ .ProjectName }}-checksums.txt'
49+
name_template: '{{ .ProjectName }}_{{ .Version }}_SHA256SUMS'
15950
algorithm: sha256
16051

52+
# https://goreleaser.com/customization/sign/
16153
signs:
162-
- id: gpg
163-
ids:
164-
- linux-archive
165-
- windows-archive
166-
signature: ${artifact}.sig
167-
cmd: gpg2
168-
args: [-u, '{{ .Var.GPGKeyID }}', --output, '${signature}', --detach-sign, '${artifact}']
169-
artifacts: all
170-
171-
- id: gatekeeper
172-
ids:
173-
- macos-archive
174-
signature: ${artifact}
175-
cmd: xcrun
176-
args: [notarytool, submit, './dist/{{ .ProjectName }}_v{{ .Version }}_darwin_universal.zip', --apple-id, '{{ .Env.AC_APPLE_ID
177-
}}', --password, '{{ .Env.AC_PASSWORD }}', --team-id, '{{ .Env.AC_TEAM_ID }}', --progress, --wait]
178-
artifacts: all
179-
54+
- artifacts: checksum
55+
args:
56+
- --batch
57+
- --local-user
58+
- '{{ .Env.GPG_FINGERPRINT }}' # set this environment variable for your signing key
59+
- --output
60+
- ${signature}
61+
- --detach-sign
62+
- ${artifact}
63+
64+
# https://goreleaser.com/customization/release/
18065
release:
181-
# Repo in which the release will be created.
182-
# Default is extracted from the origin remote URL or empty if its private hosted.
183-
github:
184-
owner: '{{ .Var.SourceOrg }}'
185-
name: '{{ .Var.SourceRepo }}'
186-
187-
# IDs of the archives to use.
188-
# Defaults to all.
189-
# ids:
190-
# - foo
191-
# - bar
192-
193-
# If set to true, will not auto-publish the release.
194-
# Default is false.
66+
# Visit your project's GitHub Releases page to publish this release.
19567
draft: true
196-
197-
# If set to auto, will mark the release as not ready for production
198-
# in case there is an indicator for this in the tag e.g. v1.0.0-rc1
199-
# If set to true, will mark the release as not ready for production.
200-
# Default is false.
20168
prerelease: auto
202-
203-
# What to do with the release notes in case there the release already exists.
204-
#
205-
# Valid options are:
206-
# - `keep-existing`: keep the existing notes
207-
# - `append`: append the current release notes to the existing notes
208-
# - `prepend`: prepend the current release notes to the existing notes
209-
# - `replace`: replace existing notes
210-
#
211-
# Default is `keep-existing`.
21269
mode: replace
213-
214-
# Header template for the release body.
215-
# Defaults to empty.
216-
header: |
217-
## What's Changed
218-
219-
# Footer template for the release body.
220-
# Defaults to empty.
70+
extra_files:
71+
- glob: terraform-registry-manifest.json
72+
name_template: '{{ .ProjectName }}_{{ .Version }}_manifest.json'
22173
footer: |
222-
## Verifying Assets
223-
224-
Learn how to verify releases at @TODO.
74+
## Asset Naming
22575
226-
# You can change the name of the release.
227-
# Default is `{{.Tag}}` on OSS and `{{.PrefixedTag}}` on Pro.
228-
# name_template: "{{.ProjectName}}-v{{.Version}} {{.Env.USER}}"
76+
| Synonyms | Description |
77+
|-----------------------|------------------------------|
78+
| `x86_64` and `amd64` | 64-bit Intel and/or AMD CPUs |
79+
| `aarch64` and `arm64` | 64-bit ARM CPUs |
22980
230-
# You can disable this pipe in order to not create the release on any SCM.
231-
# Keep in mind that this might also break things that depend on the release URL, for instance, homebrew taps.
232-
#
233-
# Defaults to false.
234-
# disable: true
81+
name_template: '{{.Version}} — {{time "2006-01-02"}}'
23582

236-
# You can add extra pre-existing files to the release.
237-
# The filename on the release will be the last part of the path (base).
238-
# If another file with the same name exists, the last one found will be used.
239-
# These globs can also include templates.
240-
#
241-
# Defaults to empty.
242-
# extra_files:
243-
# - glob: ./path/to/file.txt
244-
# - glob: ./glob/**/to/**/file/**/*
245-
# - glob: ./glob/foo/to/bar/file/foobar/override_from_previous
246-
# - glob: ./single_file.txt
247-
# name_template: file.txt # note that this only works if glob matches 1 file only
83+
# https://goreleaser.com/customization/changelog/
84+
changelog:
85+
skip: false
86+
use: github
87+
sort: asc
88+
abbrev: 0
89+
groups:
90+
- title: Features
91+
regexp: ^.*?feat(\([[:word:]]+\))??!?:.+$
92+
order: 0
93+
- title: Bug fixes
94+
regexp: ^.*?fix(\([[:word:]]+\))??!?:.+$
95+
order: 1
96+
- title: Refactoring
97+
regexp: ^.*?refactor(\([[:word:]]+\))??!?:.+$
98+
order: 2
99+
- title: Documentation
100+
regexp: ^.*?docs(\([[:word:]]+\))??!?:.+$
101+
order: 3
102+
- title: Chores
103+
regexp: ^.*?chore(\([[:word:]]+\))??!?:.+$
104+
order: 4
105+
- title: Continuous integration
106+
regexp: ^.*?ci(\([[:word:]]+\))??!?:.+$
107+
order: 5
108+
- title: Project building
109+
regexp: ^.*?build(\([[:word:]]+\))??!?:.+$
110+
order: 6
111+
- title: Linting and static analysis
112+
regexp: ^.*?build(\([[:word:]]+\))??!?:.+$
113+
order: 7
114+
- title: Release preparation
115+
regexp: ^.*?relprep(\([[:word:]]+\))??!?:.+$
116+
order: 8
117+
- title: Other
118+
order: 999

0 commit comments

Comments
 (0)