Skip to content

Commit c155f80

Browse files
authored
Add release github action workflow (#91)
Signed-off-by: zhuwenxing <[email protected]>
1 parent 847b356 commit c155f80

File tree

3 files changed

+71
-0
lines changed

3 files changed

+71
-0
lines changed

.github/workflows/release.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: release
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+
- uses: actions/checkout@v3
16+
with:
17+
fetch-depth: 0
18+
- run: git fetch --force --tags
19+
- uses: actions/setup-go@v3
20+
with:
21+
go-version: 1.18
22+
cache: true
23+
24+
- uses: goreleaser/goreleaser-action@v4
25+
with:
26+
# either 'goreleaser' (default) or 'goreleaser-pro':
27+
distribution: goreleaser
28+
version: latest
29+
args: release --clean
30+
env:
31+
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ milvus-backup
44
**/__pycache__/*
55
**/.pytest_cache/*
66
logs/
7+
8+
dist/

.goreleaser.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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+
builds:
8+
- env:
9+
- CGO_ENABLED=0
10+
goos:
11+
- linux
12+
- darwin
13+
14+
archives:
15+
- format: tar.gz
16+
# this name template makes the OS and Arch compatible with the results of uname.
17+
name_template: >-
18+
{{ .ProjectName }}_
19+
{{- title .Os }}_
20+
{{- if eq .Arch "amd64" }}x86_64
21+
{{- else if eq .Arch "386" }}i386
22+
{{- else }}{{ .Arch }}{{ end }}
23+
{{- if .Arm }}v{{ .Arm }}{{ end }}
24+
checksum:
25+
name_template: 'checksums.txt'
26+
snapshot:
27+
name_template: "{{ incpatch .Version }}-next"
28+
changelog:
29+
sort: asc
30+
filters:
31+
exclude:
32+
- '^docs:'
33+
- '^test:'
34+
35+
# The lines beneath this are called `modelines`. See `:help modeline`
36+
# Feel free to remove those if you don't want/use them.
37+
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
38+
# vim: set ts=2 sw=2 tw=0 fo=cnqoj

0 commit comments

Comments
 (0)