Skip to content

Commit 860bfe3

Browse files
authored
Add goreleaser (#14)
Add auto-release on tag push
1 parent 482e760 commit 860bfe3

File tree

3 files changed

+76
-0
lines changed

3 files changed

+76
-0
lines changed

.github/workflows/release.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- v[0-9].[0-9]+.[0-9]+
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
goreleaser:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
- name: Set up Go
20+
uses: actions/setup-go@v5
21+
- name: Run GoReleaser
22+
uses: goreleaser/goreleaser-action@v6
23+
with:
24+
distribution: goreleaser
25+
version: '~> v2'
26+
args: release --clean
27+
env:
28+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,5 @@ go.work.sum
2525
build/*
2626

2727
*.log
28+
# Added by goreleaser init:
29+
dist/

.goreleaser.yaml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# This is an example .goreleaser.yml file with some sensible defaults.
2+
# Make sure to check the documentation at https://goreleaser.com
3+
4+
# The lines below are called `modelines`. See `:help modeline`
5+
# Feel free to remove those if you don't want/need to use them.
6+
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
7+
# vim: set ts=2 sw=2 tw=0 fo=cnqoj
8+
9+
version: 2
10+
11+
before:
12+
hooks:
13+
- go mod tidy
14+
- go generate ./...
15+
16+
builds:
17+
- env:
18+
- CGO_ENABLED=0
19+
goos:
20+
- linux
21+
goarch:
22+
- amd64
23+
dir: ./cmd
24+
25+
archives:
26+
- format: binary
27+
name_template: "{{ .ProjectName }}"
28+
checksum:
29+
name_template: "{{ .ProjectName }}_{{ .Version }}_SHA256SUMS"
30+
algorithm: sha256
31+
changelog:
32+
sort: asc
33+
filters:
34+
exclude:
35+
- "^docs:"
36+
- "^test:"
37+
release:
38+
github:
39+
owner: outcatcher
40+
name: hipapu
41+
footer: >-
42+
43+
---
44+
45+
Released by [GoReleaser](https://github.com/goreleaser/goreleaser).
46+
prerelease: auto

0 commit comments

Comments
 (0)