Skip to content

Commit edb7b9e

Browse files
committed
ci(release): add release action
1 parent 5990b2e commit edb7b9e

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

.github/workflows/release.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: goreleaser
2+
3+
on:
4+
pull_request:
5+
push:
6+
7+
jobs:
8+
goreleaser:
9+
runs-on: ubuntu-latest
10+
if: startsWith(github.ref, 'refs/tags/')
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@master
14+
with:
15+
fetch-depth: 0
16+
- name: Set up Go
17+
uses: actions/setup-go@master
18+
with:
19+
go-version: 1.15
20+
- name: Run GoReleaser
21+
uses: goreleaser/goreleaser-action@v2
22+
with:
23+
version: latest
24+
args: release --rm-dist
25+
env:
26+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.goreleaser.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
builds:
2+
- main: cmd/main.go
3+
binary: download-release
4+
ldflags: -s -w -X main.GitCommit={{.Commit}} -X main.Date={{.Date}}
5+
goos:
6+
- windows
7+
- darwin
8+
- linux
9+
goarch:
10+
- amd64
11+
changelog:
12+
sort: asc
13+
filters:
14+
exclude:
15+
- '^docs:'
16+
- '^refactor'
17+
- '^tweak'
18+
- '^test'

0 commit comments

Comments
 (0)