-
Notifications
You must be signed in to change notification settings - Fork 13
68 lines (62 loc) · 1.81 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
65
66
67
name: Linting, build, test and release
# Runs on each PR to lint and test
# Runs on each release (via github UI) to lint and test, then upload binary to the release
on:
pull_request:
push:
branches: [master]
release:
types: [published]
permissions:
contents: write
jobs:
changelog:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
# do a full clone; we need to also get the branch master, required to allow towncrier to diff properly.
- uses: actions/setup-python@v3
- name: Install towncrier
run: pip install 'towncrier>19.2'
- name: Run towncrier
run: python -m towncrier.check
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.16
- name: Install lint deps
run: |
go get golang.org/x/lint/golint
go install golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow
go get github.com/fzipp/gocyclo/cmd/gocyclo
- name: lint
run: ./scripts/lint.sh
test:
runs-on: ubuntu-latest
strategy:
matrix:
golang: ["1.17", "1.16"]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: "${{ matrix.golang }}"
- name: Build
run: go build
- name: Test
run: go test
- name: Create tarball for release
if: github.event.release
run: tar -czf rageshake.tar.gz rageshake
- name: Upload tarball to matching release
if: github.event.release
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844
with:
files: rageshake.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}