Skip to content

Commit

Permalink
chore(goreleaser): update config (#24)
Browse files Browse the repository at this point in the history
Clean up config and include plugin documentation as a zip file.
  • Loading branch information
peknur authored Feb 22, 2022
1 parent 0239528 commit 5cc0ff3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 25 deletions.
41 changes: 18 additions & 23 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -1,60 +1,53 @@
env:
- CGO_ENABLED=0

before:
hooks:
- go test ./...

- make ci-release-docs
- make plugin-check
builds:
-
-
id: plugin-check
mod_timestamp: '{{ .CommitTimestamp }}'
hooks:
post:
- cmd: |
go install github.com/hashicorp/packer/cmd/packer-plugins-check@latest &&
packer-plugins-check -load={{ .Name }}
dir: "{{ dir .Path}}"
mod_timestamp: "{{ .CommitTimestamp }}"
flags:
- -trimpath #removes all file system paths from the compiled executable
ldflags:
- '-s -w -X main.Version={{.Version}} -X main.VersionPrerelease= '
- "-s -w -X {{ .ModulePath }}/version.Version={{.Version}} -X {{ .ModulePath }}/version.VersionPrerelease= "
goos:
- linux
goarch:
- amd64
binary: '{{ .ProjectName }}_v{{ .Version }}_{{ .Env.API_VERSION }}_{{ .Os }}_{{ .Arch }}'
binary: "{{ .ProjectName }}_v{{ .Version }}_{{ .Env.API_VERSION }}_{{ .Os }}_{{ .Arch }}"
-
mod_timestamp: '{{ .CommitTimestamp }}'
mod_timestamp: "{{ .CommitTimestamp }}"
flags:
- -trimpath #removes all file system paths from the compiled executable
ldflags:
- '-s -w -X main.version={{.Version}} -X main.VersionPrerelease= '
- "-s -w -X {{ .ModulePath }}/version.Version={{.Version}} -X {{ .ModulePath }}/version.VersionPrerelease= "
goos:
- freebsd
- windows
- linux
- darwin
goarch:
- amd64
- '386'
- "386"
- arm
- arm64
ignore:
- goos: darwin
goarch: '386'
goarch: "386"
- goos: linux
goarch: amd64
binary: '{{ .ProjectName }}_v{{ .Version }}_{{ .Env.API_VERSION }}_{{ .Os }}_{{ .Arch }}'

binary: "{{ .ProjectName }}_v{{ .Version }}_{{ .Env.API_VERSION }}_{{ .Os }}_{{ .Arch }}"
archives:
- format: zip
name_template: '{{ .ProjectName }}_v{{ .Version }}_{{ .Env.API_VERSION }}_{{ .Os }}_{{ .Arch }}'

- format: zip
files:
- none*
name_template: "{{ .ProjectName }}_v{{ .Version }}_{{ .Env.API_VERSION }}_{{ .Os }}_{{ .Arch }}"
checksum:
name_template: '{{ .ProjectName }}_v{{ .Version }}_SHA256SUMS'
name_template: "{{ .ProjectName }}_v{{ .Version }}_SHA256SUMS"
algorithm: sha256

signs:
- artifacts: checksum
args:
Expand All @@ -67,6 +60,8 @@ signs:
- "${artifact}"
release:
draft: true
extra_files:
- glob: ./docs.zip

changelog:
skip: true
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ install: build
install-packer-sdc: ## Install packer sofware development command
go install github.com/hashicorp/packer-plugin-sdk/cmd/packer-sdc@$(HASHICORP_PACKER_PLUGIN_SDK_VERSION)

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

plugin-check: install-packer-sdc build
Expand Down

0 comments on commit 5cc0ff3

Please sign in to comment.