Skip to content

Commit 5cc0ff3

Browse files
authored
chore(goreleaser): update config (#24)
Clean up config and include plugin documentation as a zip file.
1 parent 0239528 commit 5cc0ff3

File tree

2 files changed

+19
-25
lines changed

2 files changed

+19
-25
lines changed

.goreleaser.yaml

Lines changed: 18 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,53 @@
11
env:
22
- CGO_ENABLED=0
3-
43
before:
54
hooks:
65
- go test ./...
7-
6+
- make ci-release-docs
7+
- make plugin-check
88
builds:
9-
-
9+
-
1010
id: plugin-check
11-
mod_timestamp: '{{ .CommitTimestamp }}'
12-
hooks:
13-
post:
14-
- cmd: |
15-
go install github.com/hashicorp/packer/cmd/packer-plugins-check@latest &&
16-
packer-plugins-check -load={{ .Name }}
17-
dir: "{{ dir .Path}}"
11+
mod_timestamp: "{{ .CommitTimestamp }}"
1812
flags:
1913
- -trimpath #removes all file system paths from the compiled executable
2014
ldflags:
21-
- '-s -w -X main.Version={{.Version}} -X main.VersionPrerelease= '
15+
- "-s -w -X {{ .ModulePath }}/version.Version={{.Version}} -X {{ .ModulePath }}/version.VersionPrerelease= "
2216
goos:
2317
- linux
2418
goarch:
2519
- amd64
26-
binary: '{{ .ProjectName }}_v{{ .Version }}_{{ .Env.API_VERSION }}_{{ .Os }}_{{ .Arch }}'
20+
binary: "{{ .ProjectName }}_v{{ .Version }}_{{ .Env.API_VERSION }}_{{ .Os }}_{{ .Arch }}"
2721
-
28-
mod_timestamp: '{{ .CommitTimestamp }}'
22+
mod_timestamp: "{{ .CommitTimestamp }}"
2923
flags:
3024
- -trimpath #removes all file system paths from the compiled executable
3125
ldflags:
32-
- '-s -w -X main.version={{.Version}} -X main.VersionPrerelease= '
26+
- "-s -w -X {{ .ModulePath }}/version.Version={{.Version}} -X {{ .ModulePath }}/version.VersionPrerelease= "
3327
goos:
3428
- freebsd
3529
- windows
3630
- linux
3731
- darwin
3832
goarch:
3933
- amd64
40-
- '386'
34+
- "386"
4135
- arm
4236
- arm64
4337
ignore:
4438
- goos: darwin
45-
goarch: '386'
39+
goarch: "386"
4640
- goos: linux
4741
goarch: amd64
48-
binary: '{{ .ProjectName }}_v{{ .Version }}_{{ .Env.API_VERSION }}_{{ .Os }}_{{ .Arch }}'
49-
42+
binary: "{{ .ProjectName }}_v{{ .Version }}_{{ .Env.API_VERSION }}_{{ .Os }}_{{ .Arch }}"
5043
archives:
51-
- format: zip
52-
name_template: '{{ .ProjectName }}_v{{ .Version }}_{{ .Env.API_VERSION }}_{{ .Os }}_{{ .Arch }}'
53-
44+
- format: zip
45+
files:
46+
- none*
47+
name_template: "{{ .ProjectName }}_v{{ .Version }}_{{ .Env.API_VERSION }}_{{ .Os }}_{{ .Arch }}"
5448
checksum:
55-
name_template: '{{ .ProjectName }}_v{{ .Version }}_SHA256SUMS'
49+
name_template: "{{ .ProjectName }}_v{{ .Version }}_SHA256SUMS"
5650
algorithm: sha256
57-
5851
signs:
5952
- artifacts: checksum
6053
args:
@@ -67,6 +60,8 @@ signs:
6760
- "${artifact}"
6861
release:
6962
draft: true
63+
extra_files:
64+
- glob: ./docs.zip
7065

7166
changelog:
7267
skip: true

Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ install: build
3636
install-packer-sdc: ## Install packer sofware development command
3737
go install github.com/hashicorp/packer-plugin-sdk/cmd/packer-sdc@$(HASHICORP_PACKER_PLUGIN_SDK_VERSION)
3838

39-
ci-release-docs: install-packer-sdc
40-
@$(PACKER_SDC_RENDER_DOCS)
39+
ci-release-docs: install-packer-sdc generate
4140
@/bin/sh -c "[ -d docs ] && zip -r docs.zip docs/"
4241

4342
plugin-check: install-packer-sdc build

0 commit comments

Comments
 (0)