Skip to content

Commit acd0360

Browse files
committed
setup goreleaser
1 parent 2708cdc commit acd0360

File tree

2 files changed

+73
-0
lines changed

2 files changed

+73
-0
lines changed

.github/workflows/release.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: release
2+
on:
3+
push:
4+
tags:
5+
- "v[0-9]+.[0-9]+.[0-9]+"
6+
jobs:
7+
goreleaser:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v2
12+
with:
13+
fetch-depth: 1
14+
- name: Setup Go
15+
uses: actions/setup-go@v2
16+
with:
17+
go-version: 1.17
18+
- name: Run GoReleaser
19+
uses: goreleaser/goreleaser-action@v2
20+
with:
21+
distribution: goreleaser
22+
version: latest
23+
args: release --rm-dist
24+
env:
25+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.goreleaser.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
project_name: accessory
2+
env:
3+
- GO111MODULE=on
4+
5+
before:
6+
hooks:
7+
- go mod tidy
8+
9+
builds:
10+
- main: .
11+
binary: accessory
12+
ldflags:
13+
- -s -w
14+
- -X github.com/masaushi/accessory/cmd.Version={{.Version}}
15+
env:
16+
- CGO_ENABLED=0
17+
goos:
18+
- darwin
19+
- linux
20+
- windows
21+
goarch:
22+
- amd64
23+
- arm64
24+
25+
archives:
26+
- name_template: '{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
27+
replacements:
28+
darwin: darwin
29+
linux: linux
30+
windows: windows
31+
386: i386
32+
amd64: x86_64
33+
files:
34+
- README.md
35+
- LICENSE
36+
format_overrides:
37+
- goos: windows
38+
format: zip
39+
40+
checksum:
41+
name_template: "checksum.txt"
42+
43+
changelog:
44+
use: github
45+
sort: asc
46+
47+
release:
48+
prerelease: auto

0 commit comments

Comments
 (0)