-
-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (49 loc) · 1.38 KB
/
main.yaml
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
name: Release
on:
- push
jobs:
sanitycheck:
name: Sanity check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '1.21'
- name: Run vet
run: |
go vet .
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: latest
- name: Run tests
run: go test -race -covermode=atomic -coverprofile=coverage.out -v .
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
release:
needs: sanitycheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.merge_commit_sha }}
fetch-depth: '0'
- name: Bump version and push tag
id: version
uses: anothrNick/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
MAJOR_STRING_TOKEN: "major:"
MINOR_STRING_TOKEN: "minor:"
PATCH_STRING_TOKEN: "patch:"
WITH_V: true
- name: Create Release
id: release
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.version.outputs.new_tag }}
token: ${{ secrets.RELEASE_TOKEN }}