Skip to content

Commit 55ff750

Browse files
committed
fix(ci): simplify Docker to single QEMU build, remove version from binary names
1 parent eae9181 commit 55ff750

3 files changed

Lines changed: 12 additions & 55 deletions

File tree

.github/workflows/docker.yml

Lines changed: 10 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,16 @@ env:
1010

1111
jobs:
1212
build:
13-
runs-on: ${{ matrix.runner }}
14-
strategy:
15-
matrix:
16-
include:
17-
- platform: linux/amd64
18-
runner: ubuntu-latest
19-
suffix: amd64
20-
- platform: linux/arm64
21-
runner: ubuntu-24.04-arm
22-
suffix: arm64
13+
runs-on: ubuntu-latest
2314
permissions:
2415
contents: read
2516
packages: write
2617

2718
steps:
2819
- uses: actions/checkout@v4
2920

21+
- uses: docker/setup-qemu-action@v3
22+
3023
- uses: docker/setup-buildx-action@v3
3124

3225
- uses: docker/login-action@v3
@@ -40,50 +33,17 @@ jobs:
4033
with:
4134
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
4235
tags: |
43-
type=semver,pattern={{version}},suffix=-${{ matrix.suffix }}
44-
type=sha,suffix=-${{ matrix.suffix }}
36+
type=semver,pattern={{version}}
37+
type=semver,pattern={{major}}.{{minor}}
38+
type=raw,value=latest
39+
type=sha
4540
4641
- uses: docker/build-push-action@v6
4742
with:
4843
context: .
49-
platforms: ${{ matrix.platform }}
44+
platforms: linux/amd64,linux/arm64
5045
push: true
5146
tags: ${{ steps.meta.outputs.tags }}
5247
labels: ${{ steps.meta.outputs.labels }}
53-
provenance: false
54-
cache-from: type=gha,scope=${{ matrix.platform }}
55-
cache-to: type=gha,mode=max,scope=${{ matrix.platform }}
56-
57-
manifest:
58-
runs-on: ubuntu-latest
59-
needs: build
60-
permissions:
61-
contents: read
62-
packages: write
63-
64-
steps:
65-
- uses: docker/setup-buildx-action@v3
66-
67-
- uses: docker/login-action@v3
68-
with:
69-
registry: ${{ env.REGISTRY }}
70-
username: ${{ github.actor }}
71-
password: ${{ secrets.GITHUB_TOKEN }}
72-
73-
- uses: docker/metadata-action@v5
74-
id: meta
75-
with:
76-
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
77-
tags: |
78-
type=semver,pattern={{version}}
79-
type=semver,pattern={{major}}.{{minor}}
80-
type=raw,value=latest
81-
82-
- name: Create and push manifest
83-
run: |
84-
version="${GITHUB_REF#refs/tags/v}"
85-
for tag in $(jq -cr '.tags[]' <<< "$DOCKER_METADATA_OUTPUT_JSON"); do
86-
docker buildx imagetools create -t "$tag" \
87-
"${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${version}-amd64" \
88-
"${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${version}-arm64"
89-
done
48+
cache-from: type=gha
49+
cache-to: type=gha,mode=max

.github/workflows/release.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,4 @@ jobs:
5151
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5252
run: |
5353
tag="${GITHUB_REF#refs/tags/}"
54-
version="${tag#v}"
55-
mv sluice_darwin_arm64 "sluice_${version}_darwin_arm64"
56-
mv sluice_darwin_amd64 "sluice_${version}_darwin_amd64"
57-
gh release upload "$tag" "sluice_${version}_darwin_arm64" "sluice_${version}_darwin_amd64"
54+
gh release upload "$tag" sluice_darwin_arm64 sluice_darwin_amd64

.goreleaser.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ archives:
2525
builds:
2626
- sluice
2727
format: binary
28-
name_template: "sluice_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
28+
name_template: "sluice_{{ .Os }}_{{ .Arch }}"
2929

3030
changelog:
3131
disable: true

0 commit comments

Comments
 (0)