From 4f297f4f6c86f636b25973c66a989426ebfc877f Mon Sep 17 00:00:00 2001 From: skidoodle Date: Tue, 21 Apr 2026 06:23:08 +0200 Subject: [PATCH] release on ghcr --- .github/workflows/go-ossf-slsa3-publish.yml | 20 ++++++++-- .slsa-goreleaser.yaml | 43 +++++++++++++++++++++ Dockerfile | 2 +- 3 files changed, 61 insertions(+), 4 deletions(-) diff --git a/.github/workflows/go-ossf-slsa3-publish.yml b/.github/workflows/go-ossf-slsa3-publish.yml index b183fc5..af77547 100644 --- a/.github/workflows/go-ossf-slsa3-publish.yml +++ b/.github/workflows/go-ossf-slsa3-publish.yml @@ -3,14 +3,15 @@ on: release: types: [created] -permissions: read-all +permissions: + contents: write + packages: write + id-token: write jobs: build: outputs: hashes: ${{ steps.hash.outputs.hashes }} - permissions: - contents: write runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -22,6 +23,19 @@ jobs: with: go-version: '1.26.2' + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Run GoReleaser uses: goreleaser/goreleaser-action@v6 id: run-goreleaser diff --git a/.slsa-goreleaser.yaml b/.slsa-goreleaser.yaml index 3bdb6c6..12eb3ab 100644 --- a/.slsa-goreleaser.yaml +++ b/.slsa-goreleaser.yaml @@ -31,6 +31,49 @@ checksum: name_template: 'checksums.txt' algorithm: sha256 +dockers: + - id: pastebin-amd64 + image_templates: + - "ghcr.io/skidoodle/pastebin:{{ .Version }}-amd64" + dockerfile: Dockerfile.release + goos: linux + goarch: amd64 + use: buildx + build_flag_templates: + - "--platform=linux/amd64" + - "--label=org.opencontainers.image.title={{.ProjectName}}" + - "--label=org.opencontainers.image.revision={{.FullCommit}}" + - "--label=org.opencontainers.image.version={{.Version}}" + - "--label=org.opencontainers.image.source={{.GitURL}}" + extra_files: + - view + + - id: pastebin-arm64 + image_templates: + - "ghcr.io/skidoodle/pastebin:{{ .Version }}-arm64" + dockerfile: Dockerfile.release + goos: linux + goarch: arm64 + use: buildx + build_flag_templates: + - "--platform=linux/arm64/v8" + - "--label=org.opencontainers.image.title={{.ProjectName}}" + - "--label=org.opencontainers.image.revision={{.FullCommit}}" + - "--label=org.opencontainers.image.version={{.Version}}" + - "--label=org.opencontainers.image.source={{.GitURL}}" + extra_files: + - view + +docker_manifests: + - name_template: "ghcr.io/skidoodle/pastebin:latest" + image_templates: + - "ghcr.io/skidoodle/pastebin:{{ .Version }}-amd64" + - "ghcr.io/skidoodle/pastebin:{{ .Version }}-arm64" + - name_template: "ghcr.io/skidoodle/pastebin:{{ .Version }}" + image_templates: + - "ghcr.io/skidoodle/pastebin:{{ .Version }}-amd64" + - "ghcr.io/skidoodle/pastebin:{{ .Version }}-arm64" + changelog: sort: asc filters: diff --git a/Dockerfile b/Dockerfile index b078d42..862faf9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.25.1-alpine AS builder +FROM golang:1.26.2-alpine AS builder WORKDIR /app COPY go.mod go.sum ./ RUN go mod download