-
Notifications
You must be signed in to change notification settings - Fork 8
51 lines (42 loc) · 1.19 KB
/
go.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
name: Go
on:
push:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.21.0
- name: Test
run: go test -v ./...
- name: Lint source code
run: |
make tools lint
rm -rf .bin/
rm -rf dist/
- name: Set up Git actions user
uses: fregante/setup-git-user@v1
- name: Collect and save licenses
run: |
go install github.com/google/go-licenses@latest
rm -rf licenses
go-licenses save . --save_path="licenses" --ignore "github.com/bastiandoetsch/mullvad-best-server"
git add licenses
git commit -m "Updated licenses" && git push || echo "No changes to commit"
git clean -f && git reset --hard
- name: Create release tag
run: |
git tag "v$(git show -s --format=%cd --date=format:%Y%m%d.%H%M%S)"
git push --tags
- name: Release binaries with GoReleaser
uses: goreleaser/goreleaser-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
args: release --rm-dist