Skip to content

Commit

Permalink
Setup goreleaser
Browse files Browse the repository at this point in the history
* 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
caarlos0 and orlangure authored Feb 1, 2022
1 parent 9f396c2 commit cf8f48b
Show file tree
Hide file tree
Showing 3 changed files with 91 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/release.yml
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 }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@

# Dependency directories (remove the comment below to include it)
# vendor/

dist/
48 changes: 48 additions & 0 deletions .goreleaser.yaml
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}'

0 comments on commit cf8f48b

Please sign in to comment.