-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🚀 feat: add GoReleaser configuration and GitHub Actions release workflow
- Loading branch information
Showing
3 changed files
with
122 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
|
||
permissions: | ||
contents: write | ||
packages: write | ||
id-token: write # needed for signing | ||
|
||
jobs: | ||
goreleaser: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: '>=1.20.0' | ||
cache: true | ||
|
||
- name: Install cosign | ||
uses: sigstore/cosign-installer@v3.1.1 | ||
|
||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v4 | ||
with: | ||
distribution: goreleaser | ||
version: latest | ||
args: release --clean | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
COSIGN_EXPERIMENTAL: 1 # enable keyless signing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,5 @@ | |
!cmd/examples/**/*.jpg | ||
|
||
*.out | ||
*.log | ||
*.log | ||
/dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
version: 2 | ||
|
||
before: | ||
hooks: | ||
- go mod tidy | ||
|
||
builds: | ||
- env: | ||
- CGO_ENABLED=0 | ||
goos: | ||
- linux | ||
- windows | ||
goarch: | ||
- amd64 | ||
- arm64 | ||
- arm | ||
goarm: | ||
- "7" | ||
main: ./cmd/goshot | ||
ldflags: | ||
- -s -w | ||
- -X github.com/watzon/goshot/pkg/version.Version={{.Version}} | ||
- -X github.com/watzon/goshot/pkg/version.Commit={{.Commit}} | ||
- -X github.com/watzon/goshot/pkg/version.Date={{.Date}} | ||
|
||
nfpms: | ||
- vendor: Chris Watson | ||
homepage: https://github.com/watzon/goshot | ||
maintainer: Chris Watson <cawatson1993@gmail.com> | ||
description: A screenshot and screen recording tool for Linux | ||
license: MIT | ||
formats: | ||
- deb | ||
- rpm | ||
dependencies: | ||
- libx11-dev | ||
- libxrandr-dev | ||
- libxinerama-dev | ||
- libxcursor-dev | ||
- libxfixes-dev | ||
|
||
archives: | ||
- format: tar.gz | ||
name_template: >- | ||
{{ .ProjectName }}_ | ||
{{- title .Os }}_ | ||
{{- if eq .Arch "amd64" }}x86_64 | ||
{{- else if eq .Arch "386" }}i386 | ||
{{- else }}{{ .Arch }}{{ end }} | ||
format_overrides: | ||
- goos: windows | ||
format: zip | ||
|
||
source: | ||
enabled: true | ||
name_template: '{{ .ProjectName }}-{{ .Version }}-source' | ||
|
||
checksum: | ||
name_template: 'checksums.txt' | ||
|
||
signs: | ||
- cmd: cosign | ||
certificate: '${artifact}.pem' | ||
args: | ||
- sign-blob | ||
- --output-certificate=${certificate} | ||
- --output-signature=${signature} | ||
- ${artifact} | ||
- --yes # needed on cosign 2.0.0+ | ||
artifacts: checksum | ||
output: true | ||
|
||
changelog: | ||
sort: asc | ||
filters: | ||
exclude: | ||
- '^docs:' | ||
- '^test:' | ||
- '^ci:' | ||
- Merge pull request | ||
- Merge branch |