Skip to content

Commit b76f68a

Browse files
committed
chore(build): modernize goreleaser configuration
- Migrate from deprecated brews to homebrew_casks - Replace dockers/docker_manifests with dockers_v2 - Add ignore rule for unsupported windows_arm targets - Update Dockerfile to support multi-platform builds with TARGETPLATFORM - Simplify Docker configuration (~75% reduction in config lines)
1 parent 9e7b2c9 commit b76f68a

2 files changed

Lines changed: 34 additions & 92 deletions

File tree

.goreleaser.yml

Lines changed: 31 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ builds:
2121
goarm:
2222
- "6"
2323
- "7"
24+
ignore:
25+
- goos: windows
26+
goarch: arm
2427
id: lin
2528
# hooks:
2629
# post:
@@ -40,10 +43,13 @@ changelog:
4043
- '^docs:'
4144
- '^test:'
4245

43-
brews:
44-
- homepage: 'https://github.com/sgaunet/jwt-cli'
45-
description: ''
46-
directory: Formula
46+
homebrew_casks:
47+
- name: jwt-cli
48+
homepage: 'https://github.com/sgaunet/jwt-cli'
49+
description: 'CLI tool for encoding and decoding JWT tokens'
50+
directory: Casks
51+
binaries:
52+
- jwt-cli
4753
commit_author:
4854
name: sgaunet
4955
email: 1552102+sgaunet@users.noreply.github.com
@@ -52,92 +58,26 @@ brews:
5258
name: homebrew-tools
5359
# Token with 'repo' scope is required for pushing to a different repository
5460
token: '{{ .Env.HOMEBREW_TAP_TOKEN }}'
55-
url_template: 'https://github.com/sgaunet/jwt-cli/releases/download/{{ .Tag }}/{{ .ArtifactName }}'
56-
install: |
57-
bin.install "{{ .ArtifactName }}" => "jwt-cli"
58-
test: |
59-
system "#{bin}/jwt-cli", "--help"
61+
url:
62+
template: 'https://github.com/sgaunet/jwt-cli/releases/download/{{ .Tag }}/{{ .ArtifactName }}'
6063

6164

62-
dockers:
63-
# https://goreleaser.com/customization/docker/
64-
- use: buildx
65-
goos: linux
66-
goarch: amd64
67-
image_templates:
68-
- "ghcr.io/sgaunet/{{ .ProjectName }}:{{ .Version }}-amd64"
69-
- "ghcr.io/sgaunet/{{ .ProjectName }}:latest-amd64"
70-
build_flag_templates:
71-
- "--platform=linux/amd64"
72-
- "--label=org.opencontainers.image.created={{.Date}}"
73-
- "--label=org.opencontainers.image.title={{.ProjectName}}"
74-
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
75-
- "--label=org.opencontainers.image.version={{.Version}}"
76-
# extra_files:
77-
# - src
78-
# - resources
79-
80-
- use: buildx
81-
goos: linux
82-
goarch: arm64
83-
image_templates:
84-
- "ghcr.io/sgaunet/{{ .ProjectName }}:{{ .Version }}-arm64v8"
85-
- "ghcr.io/sgaunet/{{ .ProjectName }}:latest-arm64v8"
86-
build_flag_templates:
87-
- "--platform=linux/arm64/v8"
88-
- "--label=org.opencontainers.image.created={{.Date}}"
89-
- "--label=org.opencontainers.image.title={{.ProjectName}}"
90-
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
91-
- "--label=org.opencontainers.image.version={{.Version}}"
92-
# extra_files:
93-
# - src
94-
# - resources
95-
96-
- use: buildx
97-
goos: linux
98-
goarch: arm
99-
goarm: "6"
100-
image_templates:
101-
- "ghcr.io/sgaunet/{{ .ProjectName }}:{{ .Version }}-armv6"
102-
- "ghcr.io/sgaunet/{{ .ProjectName }}:latest-armv6"
103-
build_flag_templates:
104-
- "--platform=linux/arm/v6"
105-
- "--label=org.opencontainers.image.created={{.Date}}"
106-
- "--label=org.opencontainers.image.title={{.ProjectName}}"
107-
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
108-
- "--label=org.opencontainers.image.version={{.Version}}"
109-
# extra_files:
110-
# - src
111-
# - resources
112-
113-
- use: buildx
114-
goos: linux
115-
goarch: arm
116-
goarm: "7"
117-
image_templates:
118-
- "ghcr.io/sgaunet/{{ .ProjectName }}:{{ .Version }}-armv7"
119-
- "ghcr.io/sgaunet/{{ .ProjectName }}:latest-armv7"
120-
build_flag_templates:
121-
- "--platform=linux/arm/v7"
122-
- "--label=org.opencontainers.image.created={{.Date}}"
123-
- "--label=org.opencontainers.image.title={{.ProjectName}}"
124-
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
125-
- "--label=org.opencontainers.image.version={{.Version}}"
126-
# extra_files:
127-
# - src
128-
# - resources
129-
130-
docker_manifests:
131-
# https://goreleaser.com/customization/docker_manifest/
132-
- name_template: ghcr.io/sgaunet/{{ .ProjectName }}:{{ .Version }}
133-
image_templates:
134-
- ghcr.io/sgaunet/{{ .ProjectName }}:{{ .Version }}-amd64
135-
- ghcr.io/sgaunet/{{ .ProjectName }}:{{ .Version }}-arm64v8
136-
- ghcr.io/sgaunet/{{ .ProjectName }}:{{ .Version }}-armv6
137-
- ghcr.io/sgaunet/{{ .ProjectName }}:{{ .Version }}-armv7
138-
- name_template: ghcr.io/sgaunet/{{ .ProjectName }}:latest
139-
image_templates:
140-
- ghcr.io/sgaunet/{{ .ProjectName }}:latest-amd64
141-
- ghcr.io/sgaunet/{{ .ProjectName }}:latest-arm64v8
142-
- ghcr.io/sgaunet/{{ .ProjectName }}:latest-armv6
143-
- ghcr.io/sgaunet/{{ .ProjectName }}:latest-armv7
65+
dockers_v2:
66+
# https://goreleaser.com/customization/dockers_v2/
67+
- id: jwt-cli
68+
dockerfile: Dockerfile
69+
images:
70+
- "ghcr.io/sgaunet/{{ .ProjectName }}"
71+
tags:
72+
- "{{ .Version }}"
73+
- "latest"
74+
platforms:
75+
- linux/amd64
76+
- linux/arm64
77+
- linux/arm/v6
78+
- linux/arm/v7
79+
labels:
80+
"org.opencontainers.image.created": "{{ .Date }}"
81+
"org.opencontainers.image.title": "{{ .ProjectName }}"
82+
"org.opencontainers.image.revision": "{{ .FullCommit }}"
83+
"org.opencontainers.image.version": "{{ .Version }}"

Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
FROM scratch
2-
COPY jwt-cli /jwt-cli
2+
ARG TARGETPLATFORM
3+
COPY $TARGETPLATFORM/jwt-cli /jwt-cli
4+
ENTRYPOINT ["/jwt-cli"]

0 commit comments

Comments
 (0)