Skip to content

Commit 268cd1d

Browse files
authored
chore: release by gorelease by add tags (#16)
Signed-off-by: shilinlee <836160610@qq.com>
1 parent 4bc0d1f commit 268cd1d

File tree

2 files changed

+101
-0
lines changed

2 files changed

+101
-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+
tags:
6+
- 'v*'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
goreleaser:
13+
runs-on: ubuntu-latest
14+
steps:
15+
-
16+
name: Checkout
17+
uses: actions/checkout@v3
18+
with:
19+
fetch-depth: 0
20+
-
21+
name: Set up Go
22+
uses: actions/setup-go@v4
23+
-
24+
name: Run GoReleaser
25+
uses: goreleaser/goreleaser-action@v4
26+
with:
27+
# either 'goreleaser' (default) or 'goreleaser-pro'
28+
distribution: goreleaser
29+
version: latest
30+
args: release --clean
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
# Your GoReleaser Pro key, if you are using the 'goreleaser-pro' distribution
34+
# GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}

.goreleaser.yaml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Make sure to check the documentation at https://goreleaser.com
2+
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
3+
4+
before:
5+
hooks:
6+
# You may remove this if you don't use go modules.
7+
- go mod tidy
8+
9+
builds:
10+
- id: "dataMigrate"
11+
binary: dataMigrate
12+
main: .
13+
goos:
14+
- linux
15+
- darwin
16+
goarch:
17+
- amd64
18+
- arm64
19+
ldflags:
20+
- -s -w
21+
env:
22+
- CGO_ENABLED=0
23+
archives:
24+
- format: tar.gz
25+
# this name template makes the OS and Arch compatible with the results of uname.
26+
name_template: >-
27+
{{ .ProjectName }}-
28+
{{- .Version }}-
29+
{{- .Os }}-
30+
{{- if eq .Arch "amd64" }}amd64
31+
{{- else if eq .Arch "386" }}i386
32+
{{- else }}{{ .Arch }}{{ end }}
33+
{{- if .Arm }}v{{ .Arm }}{{ end }}
34+
# use zip for windows archives
35+
format_overrides:
36+
- goos: windows
37+
format: zip
38+
checksum:
39+
name_template: "checksums.txt"
40+
changelog:
41+
use: github
42+
sort: asc
43+
groups:
44+
- title: Features
45+
regexp: '^.*?feat(\([[:word:]]+\))??!?:.+$'
46+
order: 0
47+
- title: "Bug fixes"
48+
regexp: '^.*?fix(\([[:word:]]+\))??!?:.+$'
49+
order: 1
50+
- title: Others
51+
order: 999
52+
filters:
53+
exclude:
54+
- "^docs:"
55+
- "^test:"
56+
- "^revert:"
57+
- "^chore:"
58+
- "^ci:"
59+
60+
release:
61+
github:
62+
prerelease: auto
63+
64+
# The lines beneath this are called `modelines`. See `:help modeline`
65+
# Feel free to remove those if you don't want/use them.
66+
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
67+
# vim: set ts=2 sw=2 tw=0 fo=cnqoj

0 commit comments

Comments
 (0)