Skip to content

Commit 9cef5a2

Browse files
authored
fix(releasing): Ensure GoReleaser creates a tar for linux_amd64 (#1294)
Signed-off-by: James Alseth <james@jalseth.me>
1 parent 45a3835 commit 9cef5a2

2 files changed

Lines changed: 25 additions & 9 deletions

File tree

.github/workflows/release.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
uses: goreleaser/goreleaser-action@ec59f474b9834571250b370d4735c50f8e2d1e29 # ratchet:goreleaser/goreleaser-action@v7.0.0
2525
with:
2626
args: check
27-
version: "~> v1"
27+
version: "~> v2"
2828

2929
docker-conftest:
3030
runs-on: ubuntu-latest
@@ -106,11 +106,12 @@ jobs:
106106
uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # ratchet:actions/setup-go@v6
107107
with:
108108
go-version-file: 'go.mod'
109+
cache: false
109110

110111
- name: release
111112
uses: goreleaser/goreleaser-action@ec59f474b9834571250b370d4735c50f8e2d1e29 # ratchet:goreleaser/goreleaser-action@v7.0.0
112113
with:
113114
args: release --clean
114-
version: "~> v1"
115+
version: "~> v2"
115116
env:
116117
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.goreleaser.yml

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
version: 1
1+
version: 2
22

33
before:
44
hooks:
55
- go mod download
66

77
builds:
8-
- main: ./main.go
8+
- id: conftest
9+
main: ./main.go
910
env:
1011
- CGO_ENABLED=0
1112
goos:
@@ -23,7 +24,8 @@ builds:
2324
- "-X github.com/open-policy-agent/conftest/internal/version.Version={{.Version}}"
2425

2526
archives:
26-
- name_template: >-
27+
- ids: [conftest]
28+
name_template: >-
2729
{{ .ProjectName }}_
2830
{{- .Version }}_
2931
{{- if eq .Os "linux" }}Linux
@@ -33,10 +35,10 @@ archives:
3335
{{- if eq .Arch "386" }}i386
3436
{{- else if eq .Arch "amd64" }}x86_64
3537
{{- else }}{{ .Arch }}{{ end }}
36-
format: tar.gz
38+
formats: [tar.gz]
3739
format_overrides:
3840
- goos: windows
39-
format: zip
41+
formats: [zip]
4042
files:
4143
- LICENSE
4244
- README.md
@@ -57,20 +59,33 @@ changelog:
5759
- title: OPA Changes
5860
regexp: '(?i)bump (opa|github.com/open-policy-agent/opa)'
5961
order: 5
62+
- title: Documentation Updates
63+
regexp: '^.*?(docs|documentation)(\([[:word:]]+\))??!?:.+$'
64+
order: 10
6065
- title: Other Changes
6166
order: 999
6267
sort: asc
6368
filters:
6469
exclude:
65-
- '^.*?docs(\([[:word:]]+\))??!?:.+$'
6670
- '^.*?test(\([[:word:]]+\))??!?:.+$'
6771
- '^.*?misc(\([[:word:]]+\))??!?:.+$'
6872
- '^.*?typo(\([[:word:]]+\))??!?:.+$'
6973
- '(?i) typo( |\.|\r?\n)'
7074

7175
# Publishes the deb and rpm files to the GitHub releases page.
7276
nfpms:
73-
- bindir: /usr/bin
77+
- ids: [conftest]
78+
file_name_template: >-
79+
{{ .ProjectName }}_
80+
{{- .Version }}_
81+
{{- if eq .Os "linux" }}Linux
82+
{{- else if eq .Os "windows" }}Windows
83+
{{- else if eq .Os "darwin" }}Darwin
84+
{{- else }}{{ .Os }}{{ end }}_
85+
{{- if eq .Arch "386" }}i386
86+
{{- else if eq .Arch "amd64" }}x86_64
87+
{{- else }}{{ .Arch }}{{ end }}
88+
bindir: /usr/bin
7489
description: "Test your configuration using Open Policy Agent"
7590
formats:
7691
- deb

0 commit comments

Comments
 (0)