1
0
mirror of https://github.com/taigrr/pastebin synced 2026-04-10 09:41:38 -07:00

build: add GoReleaser Pro config with multi-arch Docker support

This commit is contained in:
2026-03-09 05:50:31 +00:00
parent ffa8738946
commit 7dbe823524
2 changed files with 122 additions and 0 deletions

115
.goreleaser.yml Normal file
View File

@@ -0,0 +1,115 @@
version: 2
builds:
- id: pastebin
main: .
binary: pastebin
ldflags:
- -s -w -X main.version={{.Version}}
goos:
- linux
- darwin
- windows
- freebsd
goarch:
- amd64
- arm64
ignore:
- goos: windows
goarch: arm64
- goos: freebsd
goarch: arm64
- id: pb
main: ./cmd/pb
binary: pb
ldflags:
- -s -w -X main.version={{.Version}}
goos:
- linux
- darwin
- windows
- freebsd
goarch:
- amd64
- arm64
ignore:
- goos: windows
goarch: arm64
- goos: freebsd
goarch: arm64
archives:
- id: pastebin
builds:
- pastebin
- pb
format: tar.gz
format_overrides:
- goos: windows
format: zip
files:
- README.md
- LICENSE
name_template: >-
{{ .ProjectName }}_
{{- .Version }}_
{{- .Os }}_
{{- .Arch }}
dockers:
- image_templates:
- "ghcr.io/taigrr/pastebin:{{ .Version }}-amd64"
- "ghcr.io/taigrr/pastebin:latest-amd64"
use: buildx
build_flag_templates:
- "--platform=linux/amd64"
ids:
- pastebin
- pb
dockerfile: Dockerfile.goreleaser
- image_templates:
- "ghcr.io/taigrr/pastebin:{{ .Version }}-arm64"
- "ghcr.io/taigrr/pastebin:latest-arm64"
use: buildx
build_flag_templates:
- "--platform=linux/arm64"
ids:
- pastebin
- pb
goarch: arm64
dockerfile: Dockerfile.goreleaser
docker_manifests:
- name_template: "ghcr.io/taigrr/pastebin:{{ .Version }}"
image_templates:
- "ghcr.io/taigrr/pastebin:{{ .Version }}-amd64"
- "ghcr.io/taigrr/pastebin:{{ .Version }}-arm64"
- name_template: "ghcr.io/taigrr/pastebin:latest"
image_templates:
- "ghcr.io/taigrr/pastebin:latest-amd64"
- "ghcr.io/taigrr/pastebin:latest-arm64"
checksum:
name_template: "checksums.txt"
algorithm: sha256
changelog:
use: github
sort: asc
groups:
- title: Features
regexp: '^feat(\(.+\))?!?:'
- title: Bug Fixes
regexp: '^fix(\(.+\))?!?:'
- title: Documentation
regexp: '^docs(\(.+\))?!?:'
- title: Others
order: 999
release:
github:
owner: taigrr
name: pastebin

7
Dockerfile.goreleaser Normal file
View File

@@ -0,0 +1,7 @@
FROM alpine
EXPOSE 8000/tcp
ENTRYPOINT ["pastebin"]
COPY pastebin /bin/pastebin
COPY pb /bin/pb