Skip to content

Commit 8a29dda

Browse files
committed
add goreleaser github action
1 parent 729d0e7 commit 8a29dda

File tree

3 files changed

+97
-0
lines changed

3 files changed

+97
-0
lines changed

.github/workflows/release.yml

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: goreleaser
2+
3+
on:
4+
push:
5+
# run only against 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@v3
23+
with:
24+
go-version: '1.19'
25+
cache: true
26+
# More assembly might be required: Docker logins, GPG, etc. It all depends
27+
# on your needs.
28+
- uses: goreleaser/goreleaser-action@v4
29+
with:
30+
# either 'goreleaser' (default) or 'goreleaser-pro':
31+
distribution: goreleaser
32+
version: latest
33+
args: release --clean
34+
env:
35+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36+
# Your GoReleaser Pro key, if you are using the 'goreleaser-pro'
37+
# distribution:
38+
# GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ _test
99
release
1010
debian
1111
bin
12+
dist/
1213

1314
# Architecture specific extensions/prefixes
1415
*.[568vq]

.goreleaser.yaml

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
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+
main: ./cmd/gost
13+
targets:
14+
- darwin_amd64
15+
- darwin_arm64
16+
- linux_386
17+
- linux_amd64
18+
- linux_amd64_v3
19+
- linux_arm_5
20+
- linux_arm_6
21+
- linux_arm_7
22+
- linux_arm64
23+
- linux_mips_softfloat
24+
- linux_mips_hardfloat
25+
- linux_mipsle_softfloat
26+
- linux_mipsle_hardfloat
27+
- linux_mips64
28+
- linux_mips64le
29+
- linux_s390x
30+
- linux_riscv64
31+
- freebsd_386
32+
- freebsd_amd64
33+
- windows_386
34+
- windows_amd64
35+
- windows_amd64_v3
36+
- windows_arm64
37+
38+
archives:
39+
- format: tar.gz
40+
# use zip for windows archives
41+
format_overrides:
42+
- goos: windows
43+
format: zip
44+
checksum:
45+
name_template: 'checksums.txt'
46+
snapshot:
47+
name_template: "{{ incpatch .Version }}-next"
48+
changelog:
49+
sort: asc
50+
filters:
51+
exclude:
52+
- '^docs:'
53+
- '^test:'
54+
55+
# The lines beneath this are called `modelines`. See `:help modeline`
56+
# Feel free to remove those if you don't want/use them.
57+
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
58+
# vim: set ts=2 sw=2 tw=0 fo=cnqoj

0 commit comments

Comments
 (0)