-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (53 loc) · 1.63 KB
/
build.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
59
60
61
62
63
64
name: build
on:
push:
branches: [ main ]
tags: [ v* ]
pull_request: {}
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Snapcraft
# FIXME: the mkdirs are a hack for https://github.com/goreleaser/goreleaser/issues/1715
run: |
sudo apt-get update
sudo apt-get -yq --no-install-suggests --no-install-recommends install snapcraft
mkdir -p $HOME/.cache/snapcraft/download
mkdir -p $HOME/.cache/snapcraft/stage-packages
- name: Set up Go ${{ matrix.node-version }}
uses: actions/setup-go@v2
with:
go-version: 1.17.x
- name: Cache Go modules
uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Run Setup
run: make setup
- name: Run Tests
run: make test
- name: Run Linter
uses: golangci/golangci-lint-action@v2
with:
skip-go-installation: true
- name: Snapcraft Login
if: startsWith(github.ref, 'refs/tags/')
run: echo "$SNAP_TOKEN" | snapcraft login --with -
env:
SNAP_TOKEN: ${{secrets.SNAP_TOKEN}}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
if: startsWith(github.ref, 'refs/tags/')
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}