release on ghcr

This commit is contained in:
2026-04-21 06:23:08 +02:00
parent f16ce23ff5
commit 4f297f4f6c
3 changed files with 61 additions and 4 deletions
+17 -3
View File
@@ -3,14 +3,15 @@ on:
release: release:
types: [created] types: [created]
permissions: read-all permissions:
contents: write
packages: write
id-token: write
jobs: jobs:
build: build:
outputs: outputs:
hashes: ${{ steps.hash.outputs.hashes }} hashes: ${{ steps.hash.outputs.hashes }}
permissions:
contents: write
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
@@ -22,6 +23,19 @@ jobs:
with: with:
go-version: '1.26.2' 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 - name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6 uses: goreleaser/goreleaser-action@v6
id: run-goreleaser id: run-goreleaser
+43
View File
@@ -31,6 +31,49 @@ checksum:
name_template: 'checksums.txt' name_template: 'checksums.txt'
algorithm: sha256 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: changelog:
sort: asc sort: asc
filters: filters:
+1 -1
View File
@@ -1,4 +1,4 @@
FROM golang:1.25.1-alpine AS builder FROM golang:1.26.2-alpine AS builder
WORKDIR /app WORKDIR /app
COPY go.mod go.sum ./ COPY go.mod go.sum ./
RUN go mod download RUN go mod download