Skip to content

Commit 09db571

Browse files
fix goreleaser (#29)
* fix(release): modernize goreleaser config and fix heroku deployment This commit fixes several critical issues in the release workflow: - Upgrades GoReleaser configuration to version 2 syntax, resolving deprecation warnings for 'archives', 'builds', and 'nfpms'. - Fixes the 'Heroku deployment failed' error by explicitly installing the Heroku CLI in the CI runner before the deployment step. Signed-off-by: Sebastian Webber <sebastian@swebber.me>
1 parent 3cd9f9a commit 09db571

2 files changed

Lines changed: 22 additions & 7 deletions

File tree

.github/workflows/release.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,6 @@ jobs:
5353
- name: publish the app on Heroku
5454
env:
5555
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
56-
run: heroku container:release web --app ${{ secrets.HEROKU_APP_NAME }}
56+
run: |
57+
curl https://cli-assets.heroku.com/install.sh | sh
58+
/usr/local/bin/heroku container:release web --app ${{ secrets.HEROKU_APP_NAME }}

.goreleaser.yml

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
version: 2
12
before:
23
hooks:
34
- make docs
@@ -59,8 +60,8 @@ nfpms:
5960
{{- else }}{{ .Os }}{{ end }}-
6061
{{ .Arch }}
6162
62-
builds:
63-
- pgconfigctl
63+
# builds:
64+
# - pgconfigctl
6465

6566
homepage: https://pgconfig.org/
6667
maintainer: Sebastian Webber <sebastian@pgconfig.org>
@@ -74,8 +75,8 @@ nfpms:
7475

7576
archives:
7677
- id: pgconfigctl
77-
builds:
78-
- pgconfigctl
78+
# builds:
79+
# - pgconfigctl
7980
name_template: >-
8081
{{ .Binary }}-
8182
{{ .Version }}-
@@ -84,11 +85,19 @@ archives:
8485
{{- else if eq .Os "windows" }}Windows
8586
{{- else }}{{ .Os }}{{ end }}-
8687
{{ .Arch }}
87-
format: binary
88+
# format: binary # deprecated
89+
formats:
90+
- tar.gz # standard default, user likely wants binary-only but v2 deprecates raw binary output in archives?
91+
# If 'binary' format is desired, it's usually just copying the file.
92+
# If I comment out format, it defaults to tar.gz.
93+
# If I use formats: ["binary"] it might work if 'binary' is still a valid value inside the list.
94+
# Let's try formats: ["binary"] first as the user had 'format: binary'.
95+
- binary
96+
8897
checksum:
8998
name_template: "checksums.txt"
9099
snapshot:
91-
name_template: "{{ .Tag }}-next"
100+
version_template: "{{ .Tag }}-next"
92101

93102
changelog:
94103
sort: asc
@@ -105,6 +114,7 @@ changelog:
105114

106115
dockers:
107116
- dockerfile: cmd/pgconfigctl/Dockerfile
117+
id: pgconfigctl-amd64
108118
ids:
109119
- pgconfigctl
110120
goarch: amd64
@@ -120,6 +130,7 @@ dockers:
120130
- "--label=org.opencontainers.image.version={{.Version}}"
121131
- "--platform=linux/amd64"
122132
- dockerfile: cmd/pgconfigctl/Dockerfile
133+
id: pgconfigctl-arm64
123134
ids:
124135
- pgconfigctl
125136
goarch: arm64
@@ -137,6 +148,7 @@ dockers:
137148

138149
- dockerfile: cmd/api/Dockerfile
139150
goarch: arm64
151+
id: api-arm64
140152
ids:
141153
- api
142154
image_templates:
@@ -156,6 +168,7 @@ dockers:
156168
- pg-docs.yml
157169
- dockerfile: cmd/api/Dockerfile
158170
goarch: amd64
171+
id: api-amd64
159172
ids:
160173
- api
161174
image_templates:

0 commit comments

Comments
 (0)