11# SPDX-License-Identifier: MPL-2.0
22
3- # This is an example goreleaser.yaml file with some defaults.
4- # Make sure to check the documentation at http://goreleaser.com
3+ version : 2
4+
55env :
66 - CGO_ENABLED=0
7+
78before :
89 hooks :
9- # We strongly recommend running tests to catch any regression before release.
10- # Even though, this an optional step.
10+ # Clean up any cached test data.
11+ - go clean -testcache
12+ # Run tests to ensure that the plugin is compatible with the current version of Packer.
1113 - go test ./...
12- # Check plugin compatibility with required version of the Packer SDK
14+ # Check plugin compatibility with required version of the Packer SDK.
1315 - make plugin-check
14- # Copy LICENSE file for inclusion in zip archive
16+ # Copy LICENSE file for inclusion in zip archive.
1517 - cp LICENSE LICENSE.txt
18+
1619builds :
17- # A separated build to run the packer-plugins-check only once for a linux_amd64 binary
18- -
19- id : plugin-check
20- mod_timestamp : ' {{ .CommitTimestamp }}'
20+ - id : plugin-check
21+ mod_timestamp : " {{ .CommitTimestamp }}"
2122 flags :
22- - -trimpath # removes all file system paths from the compiled executable
23+ - -trimpath
2324 ldflags :
24- - ' -s -w -X {{ .ModulePath }}/version.Version={{.Version}} -X {{ .ModulePath }}/version.VersionPrerelease= '
25+ - " -s -w -X {{ .ModulePath }}/version.Version={{.Version}} -X {{ .ModulePath }}/version.VersionPrerelease= "
2526 goos :
2627 - linux
2728 goarch :
2829 - amd64
29- binary : ' {{ .ProjectName }}_v{{ .Version }}_{{ .Env.API_VERSION }}_{{ .Os }}_{{ .Arch }}'
30- -
31- id : linux-builds
32- mod_timestamp : ' {{ .CommitTimestamp }}'
30+ binary : " {{ .ProjectName }}_v{{ .Version }}_{{ .Env.API_VERSION }}_{{ .Os }}_{{ .Arch }}"
31+ - id : linux-builds
32+ mod_timestamp : " {{ .CommitTimestamp }}"
3333 flags :
34- - -trimpath # removes all file system paths from the compiled executable
34+ - -trimpath
3535 ldflags :
36- - ' -s -w -X {{ .ModulePath }}/version.Version={{.Version}} -X {{ .ModulePath }}/version.VersionPrerelease= '
36+ - " -s -w -X {{ .ModulePath }}/version.Version={{.Version}} -X {{ .ModulePath }}/version.VersionPrerelease= "
3737 goos :
3838 - linux
3939 goarch :
4040 - amd64
41- - ' 386'
42- - arm
41+ - " 386"
4342 - arm64
4443 ignore :
45- - goos : linux
44+ - goos : linux # Already built during plugin-check.
4645 goarch : amd64
47- binary : ' {{ .ProjectName }}_v{{ .Version }}_{{ .Env.API_VERSION }}_{{ .Os }}_{{ .Arch }}'
48- -
49- id : darwin-builds
50- mod_timestamp : ' {{ .CommitTimestamp }}'
46+ binary : " {{ .ProjectName }}_v{{ .Version }}_{{ .Env.API_VERSION }}_{{ .Os }}_{{ .Arch }}"
47+ - id : darwin-builds
48+ mod_timestamp : " {{ .CommitTimestamp }}"
5149 flags :
52- - -trimpath # removes all file system paths from the compiled executable
50+ - -trimpath
5351 ldflags :
54- - ' -s -w -X {{ .ModulePath }}/version.Version={{.Version}} -X {{ .ModulePath }}/version.VersionPrerelease= '
52+ - " -s -w -X {{ .ModulePath }}/version.Version={{.Version}} -X {{ .ModulePath }}/version.VersionPrerelease= "
5553 goos :
5654 - darwin
5755 goarch :
5856 - amd64
5957 - arm64
60- binary : ' {{ .ProjectName }}_v{{ .Version }}_{{ .Env.API_VERSION }}_{{ .Os }}_{{ .Arch }}'
61- -
62- id : other-builds
63- mod_timestamp : ' {{ .CommitTimestamp }}'
58+ binary : " {{ .ProjectName }}_v{{ .Version }}_{{ .Env.API_VERSION }}_{{ .Os }}_{{ .Arch }}"
59+ - id : other-builds
60+ mod_timestamp : " {{ .CommitTimestamp }}"
6461 flags :
65- - -trimpath # removes all file system paths from the compiled executable
62+ - -trimpath
6663 ldflags :
67- - ' -s -w -X {{ .ModulePath }}/version.Version={{.Version}} -X {{ .ModulePath }}/version.VersionPrerelease= '
64+ - " -s -w -X {{ .ModulePath }}/version.Version={{.Version}} -X {{ .ModulePath }}/version.VersionPrerelease= "
6865 goos :
6966 - netbsd
7067 - openbsd
@@ -73,28 +70,31 @@ builds:
7370 - solaris
7471 goarch :
7572 - amd64
76- - ' 386'
73+ - " 386"
7774 - arm
7875 ignore :
7976 - goos : windows
8077 goarch : arm
8178 - goos : solaris
8279 goarch : arm
8380 - goos : solaris
84- goarch : ' 386'
85- binary : ' {{ .ProjectName }}_v{{ .Version }}_{{ .Env.API_VERSION }}_{{ .Os }}_{{ .Arch }}'
81+ goarch : " 386"
82+ binary : " {{ .ProjectName }}_v{{ .Version }}_{{ .Env.API_VERSION }}_{{ .Os }}_{{ .Arch }}"
83+
8684archives :
87- - format : zip
88- files :
89- - " LICENSE.txt"
85+ - id : default
86+ name_template : " {{ .ProjectName }}_v{{ .Version }}_{{ .Env.API_VERSION }}_{{ .Os }}_{{ .Arch }}"
87+ files :
88+ - " LICENSE.txt"
89+ formats : ["zip"]
9090
91- name_template : ' {{ .ProjectName }}_v{{ .Version }}_{{ .Env.API_VERSION }}_{{ .Os }}_{{ .Arch }}'
9291checksum :
93- name_template : ' {{ .ProjectName }}_v{{ .Version }}_SHA256SUMS'
92+ name_template : " {{ .ProjectName }}_v{{ .Version }}_SHA256SUMS"
9493 algorithm : sha256
94+
9595signs :
96- - artifacts : checksum
97- args :
96+ - artifacts : checksum
97+ args :
9898 # if you are using this is in a GitHub action or some other automated pipeline, you
9999 # need to pass the batch flag to indicate its not interactive.
100100 - " --batch"
0 commit comments