Skip to content

Commit

Permalink
Don't rebuild binaries when releasing docker images
Browse files Browse the repository at this point in the history
  • Loading branch information
prymitive committed Dec 19, 2023
1 parent 5526769 commit f910752
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 16 deletions.
7 changes: 7 additions & 0 deletions .github/Dockerfile.amd64
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM debian:stable-20231120
RUN apt-get update --yes && \
apt-get install --no-install-recommends --yes git ca-certificates && \
rm -rf /var/lib/apt/lists/*
COPY pint-linux-amd64 /usr/local/bin/pint
WORKDIR /code
CMD ["/usr/local/bin/pint"]
7 changes: 7 additions & 0 deletions .github/Dockerfile.arm64
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM debian:stable-20231120
RUN apt-get update --yes && \
apt-get install --no-install-recommends --yes git ca-certificates && \
rm -rf /var/lib/apt/lists/*
COPY pint-linux-arm64 /usr/local/bin/pint
WORKDIR /code
CMD ["/usr/local/bin/pint"]
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ updates:
directory: "/"
schedule:
interval: "weekly"
- package-ecosystem: "docker"
directory: "/.github"
schedule:
interval: "weekly"
groups:
debian:
patterns:
- "debian"
- package-ecosystem: "gomod"
directory: "/"
schedule:
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,10 @@ jobs:
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Test releasing binaries
if: github.event_name == 'pull_request'
uses: goreleaser/goreleaser-action@v5
with:
version: v1.21.2
args: release --clean --skip=validate --skip=sign --skip=sbom --skip=publish --snapshot
23 changes: 7 additions & 16 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ builds:
goarch: arm64
no_unique_dist_dir: true
binary: "{{ .ProjectName }}-{{ .Os }}-{{ .Arch }}"

archives:
- name_template: "{{ .ProjectName }}-{{ .Version }}-{{ .Os }}-{{ .Arch }}"
checksum:
Expand All @@ -25,16 +26,18 @@ release:
extra_files:
- glob: ./README.md
- glob: ./docs/changelog.md

changelog:
use: github
sort: asc
filters:
exclude:
- "^Merge pull request "

dockers:
- image_templates:
["ghcr.io/cloudflare/{{ .ProjectName }}:{{ .Version }}-amd64"]
dockerfile: Dockerfile
dockerfile: .github/Dockerfile.amd64
use: buildx
build_flag_templates:
- --platform=linux/amd64
Expand All @@ -46,17 +49,11 @@ dockers:
- --label=org.opencontainers.image.created={{ time "2006-01-02T15:04:05Z07:00" }}
- --label=org.opencontainers.image.revision={{ .FullCommit }}
- --label=org.opencontainers.image.licenses=Apache-2.0
extra_files:
- .git
- cmd
- internal
- go.mod
- go.sum
- Makefile

- image_templates:
["ghcr.io/cloudflare/{{ .ProjectName }}:{{ .Version }}-arm64"]
goarch: arm64
dockerfile: Dockerfile
dockerfile: .github/Dockerfile.arm64
use: buildx
build_flag_templates:
- --platform=linux/arm64
Expand All @@ -68,13 +65,7 @@ dockers:
- --label=org.opencontainers.image.created={{ time "2006-01-02T15:04:05Z07:00" }}
- --label=org.opencontainers.image.revision={{ .FullCommit }}
- --label=org.opencontainers.image.licenses=Apache-2.0
extra_files:
- .git
- cmd
- internal
- go.mod
- go.sum
- Makefile

docker_manifests:
- name_template: ghcr.io/cloudflare/{{ .ProjectName }}:{{ .Version }}
image_templates:
Expand Down

0 comments on commit f910752

Please sign in to comment.