Skip to content

Commit df68854

Browse files
authored
chore: Add multi-arch docker image (#503)
* chore: Add multi-arch docker image Also switch `setup-go` to use `go.mod` version to avoid discrepancies * chore: Only update coverage on master branch --------- Co-authored-by: jb-abbadie <jb-abbadie@users.noreply.github.com>
1 parent 2df9fac commit df68854

File tree

5 files changed

+19
-29
lines changed

5 files changed

+19
-29
lines changed

.github/workflows/go-test.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- name: Set up Go
1818
uses: actions/setup-go@v5
1919
with:
20-
go-version: 1.22
20+
go-version-file: go.mod
2121

2222
- name: Build
2323
run: go build -v ./...
@@ -26,9 +26,9 @@ jobs:
2626
run: go test -v ./...
2727

2828
- name: Update coverage report
29+
if: github.ref == 'refs/heads/master'
2930
uses: ncruces/go-coverage-report@21fa4b59396f242b81896a3cd212a463589b6742
3031
with:
3132
report: 'false'
3233
chart: 'true'
3334
amend: 'false'
34-

.github/workflows/golangci-lint.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818

1919
- uses: actions/setup-go@v5
2020
with:
21-
go-version: '1.22'
21+
go-version-file: go.mod
2222

2323
- name: golangci-lint
2424
uses: golangci/golangci-lint-action@v6

.github/workflows/release.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,7 @@ jobs:
2121
- name: Set up Go
2222
uses: actions/setup-go@v5
2323
with:
24-
go-version: 1.22
25-
26-
- name: Install cross-compile package
27-
run: |
28-
sudo apt update
29-
sudo apt install -y gcc gcc-aarch64-linux-gnu musl build-essential
24+
go-version-file: go.mod
3025

3126
- name: Set up Docker Buildx
3227
uses: docker/setup-buildx-action@v3

.goreleaser.yml

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
---
2+
version: 2
23
before:
34
hooks:
45
- go mod tidy
@@ -27,31 +28,25 @@ builds:
2728
- -trimpath={{.Env.GOPATH}}/src
2829

2930
dockers:
30-
- goos: linux
31-
goarch: amd64
32-
image_templates:
33-
- "contentsquareplatform/chproxy:{{ .Tag }}"
31+
- image_templates:
3432
- "contentsquareplatform/chproxy:{{ .Tag }}-amd64"
3533
use: buildx
3634
build_flag_templates:
3735
- "--platform=linux/amd64"
38-
# - goos: linux
39-
# goarch: arm64
40-
# image_templates:
41-
# - "contentsquareplatform/chproxy:{{ .Tag }}-arm64"
42-
# use: buildx
43-
# build_flag_templates:
44-
# - "--platform=linux/arm64"
45-
# - goos: linux
46-
# goarch: arm64
47-
# image_templates:
48-
# - "contentsquareplatform/chproxy:{{ .Tag }}-arm64v8"
49-
# use: buildx
50-
# build_flag_templates:
51-
# - "--platform=linux/arm64/v8"
36+
- image_templates:
37+
- "contentsquareplatform/chproxy:{{ .Tag }}-arm64v8"
38+
use: buildx
39+
build_flag_templates:
40+
- "--platform=linux/arm64/v8"
41+
42+
docker_manifests:
43+
- name_template: "contentsquareplatform/chproxy:{{ .Tag }}"
44+
image_templates:
45+
- "contentsquareplatform/chproxy:{{ .Tag }}-amd64"
46+
- "contentsquareplatform/chproxy:{{ .Tag }}-arm64v8"
5247

5348
snapshot:
54-
name_template: "{{ .FullCommit }}-SNAPSHOT"
49+
version_template: "{{ .FullCommit }}-SNAPSHOT"
5550

5651
release:
5752
# Repo in which the release will be created.

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM debian
1+
FROM debian:12
22

33
RUN apt update && apt install -y ca-certificates curl
44

0 commit comments

Comments
 (0)