-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (55 loc) · 1.31 KB
/
build-test-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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: Build, Test and Release
on:
pull_request:
types:
- closed
branches:
- main
permissions:
contents: write
packages: write
id-token: write
jobs:
code-check:
runs-on: ubuntu-latest
env:
CGO_ENABLED: 1
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '>=1.20.1'
cache: true
- name: Build
run: go build -v ./...
- name: Test (Unit Only)
run: go test -v ./... -short
- name: Bump version and push tag
uses: anothrNick/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WITH_V: true
DEFAULT_BUMP: patch
goreleaser:
needs: code-check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- run: git fetch --force --tags
- uses: actions/setup-go@v3
with:
go-version: '>=1.20.1'
cache: true
- uses: goreleaser/goreleaser-action@v4
with:
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
FURY_TOKEN: ${{ secrets.FURY_TOKEN }}