-
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: goreleaser setup Signed-off-by: Carlos A Becker <[email protected]> * fix: token * Change brew github token secret name Co-authored-by: Yury Fedorov <[email protected]>
- Loading branch information
Showing
3 changed files
with
91 additions
and
0 deletions.
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,41 @@ | ||
# | ||
# Releaser workflow setup | ||
# https://goreleaser.com/ci/actions/ | ||
# | ||
name: release | ||
|
||
# run only on tags | ||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
|
||
permissions: | ||
contents: write # needed to write releases | ||
id-token: write # needed for keyless signing | ||
packages: write # needed for ghcr access | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 # this is important, otherwise it won't checkout the full tree (i.e. no previous tags) | ||
- uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.17 | ||
- uses: actions/cache@v2 | ||
with: | ||
path: ~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- uses: sigstore/[email protected] # installs cosign | ||
- uses: goreleaser/goreleaser-action@v2 # run goreleaser | ||
with: | ||
version: latest | ||
args: release --rm-dist | ||
env: | ||
BREW_GITHUB_TOKEN: ${{ secrets.BREW_GITHUB_TOKEN }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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 |
---|---|---|
|
@@ -13,3 +13,5 @@ | |
|
||
# Dependency directories (remove the comment below to include it) | ||
# vendor/ | ||
|
||
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,48 @@ | ||
before: | ||
hooks: | ||
- go mod tidy | ||
builds: | ||
- env: | ||
- CGO_ENABLED=0 | ||
goos: | ||
- linux | ||
- windows | ||
- darwin | ||
mod_timestamp: '{{ .CommitTimestamp }}' | ||
flags: | ||
- -trimpath | ||
checksum: | ||
name_template: 'checksums.txt' | ||
changelog: | ||
sort: asc | ||
use: github | ||
brews: | ||
- tap: | ||
owner: orlangure | ||
name: homebrew-tap | ||
token: "{{ .Env.BREW_GITHUB_TOKEN }}" | ||
folder: Formula | ||
homepage: https://github.com/orlangure/gocovsh | ||
description: 'Go Coverage in your terminal: a tool for exploring Go Coverage reports from the command line' | ||
nfpms: | ||
- homepage: https://github.com/orlangure/gocovsh | ||
description: 'Go Coverage in your terminal: a tool for exploring Go Coverage reports from the command line' | ||
maintainer: Yury Fedorov | ||
license: GPL-3.0-only | ||
vendor: Yury Fedorov | ||
formats: | ||
- apk | ||
- deb | ||
- rpm | ||
signs: | ||
- cmd: cosign | ||
env: | ||
- COSIGN_EXPERIMENTAL=1 | ||
certificate: '${artifact}.pem' | ||
output: true | ||
artifacts: checksum | ||
args: | ||
- sign-blob | ||
- '--output-certificate=${certificate}' | ||
- '--output-signature=${signature}' | ||
- '${artifact}' |