-
Notifications
You must be signed in to change notification settings - Fork 235
41 lines (39 loc) · 1.09 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: GoRelease
on:
push:
tags:
- 'v*.*.*'
env:
# Common versions
GO_VERSION: '1.17'
GO_REQUIRED_MIN_VERSION: ''
GITHUB_REF: ${{ github.ref }}
jobs:
release:
name: release
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v2
- name: get release version
run: |
echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- name: get major release version
run: |
echo "MAJOR_RELEASE_VERSION=${RELEASE_VERSION%.*}" >> $GITHUB_ENV
echo "TRIMED_RELEASE_VERSION=${RELEASE_VERSION#v}" >> $GITHUB_ENV
- name: install Go
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
- name: binary
run: |
GOOS=linux make release-binary
GOOS=darwin make release-binary
GOOS=windows make release-binary
- name: publish release
uses: ncipollo/release-action@v1
with:
tag: ${{ env.RELEASE_VERSION }}
artifacts: "*.tar.gz"
token: ${{ secrets.GITHUB_TOKEN }}