Skip to content

Commit 373ebd3

Browse files
authored
Merge pull request #306 from cjc7373/chore/update-goreleaser-v2
chore: support building arm image by updating to goreleaser v2
2 parents 1c29d27 + c9d7e2a commit 373ebd3

File tree

5 files changed

+39
-26
lines changed

5 files changed

+39
-26
lines changed

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ jobs:
2525
run: echo ${{ secrets.DOCKER_PASSWORD }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin
2626
-
2727
name: Run GoReleaser
28-
uses: goreleaser/goreleaser-action@v5
28+
uses: goreleaser/goreleaser-action@v6
2929
with:
30-
version: latest
30+
version: '~> v2'
3131
args: release --clean --debug
3232
env:
3333
# create personal access token: https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line

.goreleaser.yml

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
version: 2
2+
13
before:
24
hooks:
35
- go mod download
@@ -17,7 +19,7 @@ archives:
1719
- id: default
1820
format_overrides:
1921
- goos: windows
20-
format: zip
22+
formats: [ 'zip' ]
2123
files:
2224
- LICENSE.md
2325
- CHANGELOG.md
@@ -40,7 +42,7 @@ release:
4042
disable: false
4143
draft: false
4244

43-
brews:
45+
homebrew_casks:
4446
-
4547
repository:
4648
owner: deviceinsight
@@ -50,7 +52,7 @@ brews:
5052
name: goreleaserbot
5153
5254

53-
folder: Formula
55+
directory: Formula
5456

5557
homepage: https://www.device-insight.com/
5658

@@ -80,21 +82,29 @@ winget:
8082
name: winget-pkgs
8183
branch: master
8284

83-
dockers:
84-
-
85-
skip_push: false
85+
dockers_v2:
86+
- id: ubuntu
8687
dockerfile: Dockerfile.Ubuntu
87-
image_templates:
88-
- "deviceinsight/kafkactl:latest-ubuntu"
89-
- "deviceinsight/kafkactl:{{ .Tag }}-ubuntu"
90-
- "deviceinsight/kafkactl:latest"
91-
- "deviceinsight/kafkactl:{{ .Tag }}"
92-
-
93-
skip_push: false
88+
images:
89+
- "deviceinsight/kafkactl"
90+
tags:
91+
- "latest-ubuntu"
92+
- "{{ .Tag }}-ubuntu"
93+
- "latest"
94+
- "{{ .Tag }}"
95+
platforms:
96+
- linux/amd64
97+
- linux/arm64
98+
- id: scratch
9499
dockerfile: Dockerfile.Scratch
95-
image_templates:
96-
- "deviceinsight/kafkactl:latest-scratch"
97-
- "deviceinsight/kafkactl:{{ .Tag }}-scratch"
100+
images:
101+
- "deviceinsight/kafkactl"
102+
tags:
103+
- "latest-scratch"
104+
- "{{ .Tag }}-scratch"
105+
platforms:
106+
- linux/amd64
107+
- linux/arm64
98108

99109
publishers:
100110
- name: aur-kafkactl

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

77
## [Unreleased]
8+
- [#306](https://github.com/deviceinsight/kafkactl/pull/306) Support building arm image by updating to goreleaser v2
89

910
## 5.15.0 - 2025-11-13
1011

Dockerfile.Scratch

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
FROM alpine:latest as certs
1+
FROM alpine:latest AS certs
22
RUN apk --update --no-cache add ca-certificates && update-ca-certificates
33

44
FROM scratch
5-
ENV USER docker
6-
COPY kafkactl /
5+
ARG TARGETPLATFORM
6+
ENV USER=docker
7+
COPY $TARGETPLATFORM/kafkactl /
78
COPY --from=certs /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
89

910
# add extra paths for files
10-
ENV EXTRA_PATHS "/etc/ssl/certs/kafkactl"
11+
ENV EXTRA_PATHS="/etc/ssl/certs/kafkactl"
1112

1213
ENTRYPOINT ["/kafkactl"]

Dockerfile.Ubuntu

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
FROM ubuntu:latest
2-
ENV USER docker
3-
COPY kafkactl /usr/local/bin
2+
ARG TARGETPLATFORM
3+
ENV USER=docker
4+
COPY $TARGETPLATFORM/kafkactl /usr/local/bin
45
RUN apt-get update && apt-get install -y bash-completion
56

67
# install bash completion script
@@ -22,14 +23,14 @@ RUN echo '[[ -n $TERM_HEIGHT ]] && stty rows $TERM_HEIGHT cols $TERM_WIDTH' >> /
2223
# Install CA certificates
2324
RUN apt-get update && apt-get install -y \
2425
ca-certificates \
25-
&& rm -rf /var/lib/apt/lists/*
26+
&& rm -rf /var/lib/apt/lists/*
2627

2728
WORKDIR /home/kafkactl
2829
RUN chown -R kafkactl:kafkactl /home/kafkactl
2930

3031
USER kafkactl
3132

3233
# add extra paths for files
33-
ENV EXTRA_PATHS "/etc/ssl/certs/kafkactl"
34+
ENV EXTRA_PATHS="/etc/ssl/certs/kafkactl"
3435

3536
ENTRYPOINT ["kafkactl"]

0 commit comments

Comments
 (0)