Skip to content

Commit 8494e1d

Browse files
committed
Add goreleaser
1 parent 2cfc3bf commit 8494e1d

File tree

3 files changed

+89
-0
lines changed

3 files changed

+89
-0
lines changed

.github/workflows/goreleaser.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: goreleaser
2+
3+
on:
4+
push:
5+
# run only against version tags
6+
tags:
7+
- "v*"
8+
9+
permissions:
10+
contents: write
11+
# packages: write
12+
# issues: write
13+
14+
jobs:
15+
goreleaser:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v3
19+
with:
20+
fetch-depth: 0
21+
- run: git fetch --force --tags
22+
- uses: actions/setup-go@v4
23+
with:
24+
go-version: stable
25+
# More assembly might be required: Docker logins, GPG, etc. It all depends
26+
# on your needs.
27+
- uses: goreleaser/goreleaser-action@v4
28+
with:
29+
# either 'goreleaser' (default) or 'goreleaser-pro':
30+
distribution: goreleaser
31+
version: latest
32+
args: release --clean
33+
env:
34+
GITHUB_TOKEN: ${{ secrets.PUBLISHER_TOKEN }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@
2424
go.work
2525

2626

27+
dist

.goreleaser.yaml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# This is an example .goreleaser.yml file with some sensible defaults.
2+
# Make sure to check the documentation at https://goreleaser.com
3+
before:
4+
hooks:
5+
# You may remove this if you don't use go modules.
6+
- go mod tidy
7+
# you may remove this if you don't need go generate
8+
# - go generate ./...
9+
builds:
10+
- env:
11+
- CGO_ENABLED=0
12+
goos:
13+
- linux
14+
- windows
15+
- darwin
16+
17+
archives:
18+
- format: tar.gz
19+
# this name template makes the OS and Arch compatible with the results of uname.
20+
name_template: >-
21+
{{ .ProjectName }}_
22+
{{- title .Os }}_
23+
{{- if eq .Arch "amd64" }}x86_64
24+
{{- else if eq .Arch "386" }}i386
25+
{{- else }}{{ .Arch }}{{ end }}
26+
{{- if .Arm }}v{{ .Arm }}{{ end }}
27+
# use zip for windows archives
28+
format_overrides:
29+
- goos: windows
30+
format: zip
31+
brews:
32+
- name: shellsnake
33+
homepage: https://github.com/simonwhitaker/shellsnake
34+
tap:
35+
owner: simonwhitaker
36+
name: homebrew-tap
37+
commit_author:
38+
name: Simon Whitaker
39+
email: sw@netcetera.org
40+
41+
checksum:
42+
name_template: "checksums.txt"
43+
snapshot:
44+
name_template: "{{ incpatch .Version }}-next"
45+
changelog:
46+
sort: asc
47+
filters:
48+
exclude:
49+
- "^docs:"
50+
- "^test:"
51+
# The lines beneath this are called `modelines`. See `:help modeline`
52+
# Feel free to remove those if you don't want/use them.
53+
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
54+
# vim: set ts=2 sw=2 tw=0 fo=cnqoj

0 commit comments

Comments
 (0)