Skip to content

Commit

Permalink
Update goreleaser configuration
Browse files Browse the repository at this point in the history
The Exercism installer requires the exercism windows archivess to be
named slightly differently. In order to generate the archives as part
of the release process, goreleaser has been split into two builds:
release-build and installer-build. The two builds are then archived
separately using the name_template configuration to generate the
properly named zip files. These archives are included in the final
release checksum.
  • Loading branch information
nywilken committed Aug 23, 2023
1 parent a68ebba commit 313b14a
Showing 1 changed file with 70 additions and 33 deletions.
103 changes: 70 additions & 33 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,48 @@
# You can find the GoReleaser documentation at http://goreleaser.com
project_name: exercism

env:
- CGO_ENABLED=0
builds:
- env:
- CGO_ENABLED=0
main: ./exercism/main.go
mod_timestamp: '{{ .CommitTimestamp }}'
flags:
- -trimpath # removes file system paths from compiled executable
ldflags:
- '-s -w -X {{ .ModulePath }}/cmd.Version={{.Version}}' # sets binary version to match tag without 'v' prefix
goos:
- darwin
- linux
- windows
- freebsd
- openbsd
goarch:
- amd64
- 386
- arm
- arm64
- ppc64
goarm:
- 5
- 6
ignore:
- goos: openbsd
goarch: arm
- goos: freebsd
goarch: arm

checksum:
name_template: '{{ .ProjectName }}_checksums.txt'
- id: release-build
main: ./exercism/main.go
mod_timestamp: '{{ .CommitTimestamp }}'
flags:
- -trimpath # removes file system paths from compiled executable
ldflags:
- '-s -w -X {{ .ModulePath }}/cmd.Version={{.Version}}' # sets binary version to match tag without 'v' prefix
goos:
- darwin
- linux
- windows
- freebsd
- openbsd
goarch:
- amd64
- 386
- arm
- arm64
- ppc64
goarm:
- 5
- 6
ignore:
- goos: openbsd
goarch: arm
- goos: freebsd
goarch: arm
- id: installer-build
main: ./exercism/main.go
mod_timestamp: '{{ .CommitTimestamp }}'
flags:
- -trimpath # removes file system paths from compiled executable
ldflags:
- '-s -w -X {{ .ModulePath }}/cmd.Version={{.Version}}' # sets binary version to match tag without 'v' prefix
goos:
- windows
goarch:
- amd64
- 386

changelog:
sort: asc
Expand All @@ -42,7 +52,10 @@ changelog:
- '^test:'

archives:
- name_template: >-
- id: release-archives
builds:
- release-build
name_template: >-
{{- .ProjectName }}-
{{- .Version }}-
{{- .Os }}-
Expand All @@ -54,9 +67,33 @@ archives:
- goos: windows
format: zip
files:
- shell/**/*
- shell/**
- LICENSE
- README.md
- id: installer-archives
builds:
- installer-build
name_template: >-
{{- .ProjectName }}-
{{- .Version }}-
{{- .Os }}-
{{- if eq .Arch "amd64" }}64bit
{{- else if eq .Arch "386" }}32bit
{{- else }}{{- .Arch }}{{ end }}
{{- if .Arm }}v{{- .Arm }}{{ end }}
format_overrides:
- goos: windows
format: zip
files:
- shell/**
- LICENSE
- README.md

checksum:
name_template: '{{ .ProjectName }}_checksums.txt'
ids:
- release-archives
- installer-archives

signs:
- artifacts: checksum
Expand Down

0 comments on commit 313b14a

Please sign in to comment.