Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 6 additions & 14 deletions .github/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
# build stage
FROM golang:alpine AS build
RUN apk update && apk add git
ADD . /src
WORKDIR /src
ENV CGO_ENABLED=0
RUN go build \
-ldflags "-X github.com/jpillora/chisel/share.BuildVersion=$(git describe --abbrev=0 --tags)" \
-o /tmp/bin
# run stage
FROM alpine:3 AS certs
RUN apk add --no-cache ca-certificates

FROM scratch
LABEL maintainer="dev@jpillora.com"
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
WORKDIR /app
COPY --from=build /tmp/bin /app/bin
ENTRYPOINT ["/app/bin"]
COPY --from=certs /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY chisel /app/bin
ENTRYPOINT ["/app/bin"]
94 changes: 94 additions & 0 deletions .github/goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,97 @@ changelog:
exclude:
- "^docs:"
- "^test:"

dockers:
- image_templates:
- "ghcr.io/jpillora/chisel:{{ .Tag }}-amd64"
- "docker.io/jpillora/chisel:{{ .Tag }}-amd64"
use: buildx
dockerfile: .github/Dockerfile
Comment on lines +64 to +68

Copilot AI Apr 4, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docker image tags/manifests are templated with {{ .Tag }}, which will include the leading v from git tags (e.g., v1.2.3). This differs from the prior workflow’s semver tags (e.g., 1.2.3) and from the binary BuildVersion which uses {{ .Version }}. If you want to preserve existing Docker tag semantics, switch these templates to use {{ .Version }} (and update all related templates consistently).

Copilot uses AI. Check for mistakes.
build_flag_templates:
- "--platform=linux/amd64"
goarch: amd64

- image_templates:
- "ghcr.io/jpillora/chisel:{{ .Tag }}-arm64"
- "docker.io/jpillora/chisel:{{ .Tag }}-arm64"
use: buildx
dockerfile: .github/Dockerfile
build_flag_templates:
- "--platform=linux/arm64"
goarch: arm64

- image_templates:
- "ghcr.io/jpillora/chisel:{{ .Tag }}-armv7"
- "docker.io/jpillora/chisel:{{ .Tag }}-armv7"
use: buildx
dockerfile: .github/Dockerfile
build_flag_templates:
- "--platform=linux/arm/v7"
goarch: arm
goarm: "7"

- image_templates:
- "ghcr.io/jpillora/chisel:{{ .Tag }}-armv6"
- "docker.io/jpillora/chisel:{{ .Tag }}-armv6"
use: buildx
dockerfile: .github/Dockerfile
build_flag_templates:
- "--platform=linux/arm/v6"
goarch: arm
goarm: "6"

- image_templates:
- "ghcr.io/jpillora/chisel:{{ .Tag }}-386"
- "docker.io/jpillora/chisel:{{ .Tag }}-386"
use: buildx
dockerfile: .github/Dockerfile
build_flag_templates:
- "--platform=linux/386"
goarch: "386"

- image_templates:
- "ghcr.io/jpillora/chisel:{{ .Tag }}-ppc64le"
- "docker.io/jpillora/chisel:{{ .Tag }}-ppc64le"
use: buildx
dockerfile: .github/Dockerfile
build_flag_templates:
- "--platform=linux/ppc64le"
goarch: ppc64le

docker_manifests:
- name_template: "ghcr.io/jpillora/chisel:{{ .Tag }}"
image_templates:
- "ghcr.io/jpillora/chisel:{{ .Tag }}-amd64"
- "ghcr.io/jpillora/chisel:{{ .Tag }}-arm64"

Copilot AI Apr 4, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The previous Docker publishing step generated additional semver tags (major/minor/major.minor) via docker/metadata-action. With the current docker_manifests config, only the full tag (and latest) are published. If downstream users rely on :1, :1.2, etc., consider adding corresponding manifest name_template entries for those aliases.

Copilot uses AI. Check for mistakes.
- "ghcr.io/jpillora/chisel:{{ .Tag }}-armv7"
- "ghcr.io/jpillora/chisel:{{ .Tag }}-armv6"
- "ghcr.io/jpillora/chisel:{{ .Tag }}-386"
- "ghcr.io/jpillora/chisel:{{ .Tag }}-ppc64le"

- name_template: "ghcr.io/jpillora/chisel:latest"
image_templates:
- "ghcr.io/jpillora/chisel:{{ .Tag }}-amd64"
- "ghcr.io/jpillora/chisel:{{ .Tag }}-arm64"
- "ghcr.io/jpillora/chisel:{{ .Tag }}-armv7"
- "ghcr.io/jpillora/chisel:{{ .Tag }}-armv6"
- "ghcr.io/jpillora/chisel:{{ .Tag }}-386"
- "ghcr.io/jpillora/chisel:{{ .Tag }}-ppc64le"

Copilot AI Apr 4, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This config will push/update the :latest multi-arch manifests on every version tag, including prereleases (since release.prerelease is auto). If you don’t want prereleases to move latest, consider removing these latest manifest entries or gating them so only stable tags publish latest.

Copilot uses AI. Check for mistakes.

- name_template: "docker.io/jpillora/chisel:{{ .Tag }}"
image_templates:
- "docker.io/jpillora/chisel:{{ .Tag }}-amd64"
- "docker.io/jpillora/chisel:{{ .Tag }}-arm64"
- "docker.io/jpillora/chisel:{{ .Tag }}-armv7"
- "docker.io/jpillora/chisel:{{ .Tag }}-armv6"
- "docker.io/jpillora/chisel:{{ .Tag }}-386"
- "docker.io/jpillora/chisel:{{ .Tag }}-ppc64le"

- name_template: "docker.io/jpillora/chisel:latest"
image_templates:
- "docker.io/jpillora/chisel:{{ .Tag }}-amd64"
- "docker.io/jpillora/chisel:{{ .Tag }}-arm64"
- "docker.io/jpillora/chisel:{{ .Tag }}-armv7"
- "docker.io/jpillora/chisel:{{ .Tag }}-armv6"
- "docker.io/jpillora/chisel:{{ .Tag }}-386"
- "docker.io/jpillora/chisel:{{ .Tag }}-ppc64le"
70 changes: 26 additions & 44 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ name: CI
on:
pull_request: {}
push: {}
permissions: write-all
jobs:
# ================
# BUILD AND TEST JOB
Expand All @@ -29,64 +28,47 @@ jobs:
- name: Test
run: go test -v ./...
# ================
# RELEASE BINARIES (on push "v*" tag)
# RELEASE (on push "v*" tag)
# Builds binaries, packages, and multi-arch Docker images via GoReleaser
# ================
release_binaries:
name: Release Binaries
release:
name: Release
needs: test
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- name: Check out code
- name: Checkout
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: goreleaser
if: success()
uses: docker://goreleaser/goreleaser:latest
env:
GITHUB_USER: ${{ github.repository_owner }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GOTOOLCHAIN: auto
- name: Set up Go
uses: actions/setup-go@v6
with:
args: release --config .github/goreleaser.yml
# ================
# RELEASE DOCKER IMAGES (on push "v*" tag)
# ================
release_docker:
name: Release Docker Images
needs: test
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v5
go-version: stable
cache: true
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: jpillora
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: jpillora/chisel
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
- name: Build and push
uses: docker/build-push-action@v6
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
context: .
file: .github/Dockerfile
platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/386,linux/arm/v7,linux/arm/v6
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
distribution: goreleaser
version: latest

Copilot AI Apr 4, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using version: latest for GoReleaser makes releases non-reproducible and can break unexpectedly when a new GoReleaser is published. Prefer pinning to a specific major/minor (or exact) GoReleaser version so tag builds remain stable over time.

Suggested change
version: latest
version: v2.12.7

Copilot uses AI. Check for mistakes.
args: release --clean --config .github/goreleaser.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}