mirror of
https://github.com/Belphemur/CBZOptimizer.git
synced 2025-10-14 04:28:51 +02:00
feat: add release workflow
This commit is contained in:
98
.goreleaser.yml
Normal file
98
.goreleaser.yml
Normal file
@@ -0,0 +1,98 @@
|
||||
# .goreleaser.yml
|
||||
project_name: CBZOptimizer
|
||||
release:
|
||||
github:
|
||||
owner: belphemur
|
||||
name: CBZOptimizer
|
||||
changelog:
|
||||
sort: asc
|
||||
filters:
|
||||
exclude:
|
||||
- '^docs:'
|
||||
- '^test:'
|
||||
- '^chore:'
|
||||
builds:
|
||||
- id: cbzoptimizer
|
||||
main: main.go
|
||||
goos:
|
||||
- linux
|
||||
goarch:
|
||||
- amd64
|
||||
- arm64
|
||||
# ensures mod timestamp to be the commit timestamp
|
||||
mod_timestamp: "{{ .CommitTimestamp }}"
|
||||
flags:
|
||||
# trims path
|
||||
- -trimpath
|
||||
ldflags:
|
||||
- -s -w -X meta.Version={{.Version}} -X meta.Commit={{.Commit}} -X meta.Date={{ .CommitDate }}
|
||||
env:
|
||||
- CGO_ENABLED=0
|
||||
# config the checksum filename
|
||||
# https://goreleaser.com/customization/checksum
|
||||
checksum:
|
||||
name_template: "checksums.txt"
|
||||
# create a source tarball
|
||||
# https://goreleaser.com/customization/source/
|
||||
source:
|
||||
enabled: true
|
||||
# proxies from the go mod proxy before building
|
||||
# https://goreleaser.com/customization/gomod
|
||||
gomod:
|
||||
proxy: true
|
||||
# creates SBOMs of all archives and the source tarball using syft
|
||||
# https://goreleaser.com/customization/sbom
|
||||
sboms:
|
||||
- artifacts: archive
|
||||
- id: source # Two different sbom configurations need two different IDs
|
||||
artifacts: source
|
||||
# create a docker image
|
||||
# https://goreleaser.com/customization/docker
|
||||
dockers:
|
||||
- image_templates:
|
||||
- "ghcr.io/belphemur/cbzoptimizer:latest"
|
||||
- "ghcr.io/belphemur/cbzoptimizer:{{ .Version }}"
|
||||
dockerfile: Dockerfile
|
||||
build_flag_templates:
|
||||
- "--pull"
|
||||
- "--label=org.opencontainers.image.created={{.Date}}"
|
||||
- "--label=org.opencontainers.image.name={{.ProjectName}}"
|
||||
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
|
||||
- "--label=org.opencontainers.image.version={{.Version}}"
|
||||
- "--label=org.opencontainers.image.source={{.GitURL}}"
|
||||
# signs the checksum file
|
||||
# all files (including the sboms) are included in the checksum, so we don't need to sign each one if we don't want to
|
||||
# https://goreleaser.com/customization/sign
|
||||
signs:
|
||||
- cmd: cosign
|
||||
env:
|
||||
- COSIGN_EXPERIMENTAL=1
|
||||
certificate: "${artifact}.pem"
|
||||
args:
|
||||
- sign-blob
|
||||
- "--output-certificate=${certificate}"
|
||||
- "--output-signature=${signature}"
|
||||
- "${artifact}"
|
||||
- "--yes" # needed on cosign 2.0.0+
|
||||
artifacts: checksum
|
||||
output: true
|
||||
# signs our docker image
|
||||
# https://goreleaser.com/customization/docker_sign
|
||||
docker_signs:
|
||||
- cmd: cosign
|
||||
env:
|
||||
- COSIGN_EXPERIMENTAL=1
|
||||
artifacts: images
|
||||
output: true
|
||||
args:
|
||||
- "sign"
|
||||
- "${artifact}"
|
||||
- "--yes" # needed on cosign 2.0.0+
|
||||
archives:
|
||||
- format: tar.gz
|
||||
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
|
||||
files:
|
||||
- LICENSE
|
||||
- README.md
|
||||
- CHANGELOG.md
|
||||
- "CBZOptimizer"
|
Reference in New Issue
Block a user