-
Notifications
You must be signed in to change notification settings - Fork 0
98 lines (81 loc) · 2.29 KB
/
example_build.yaml
File metadata and controls
98 lines (81 loc) · 2.29 KB
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: build
on:
push:
branches:
- master
paths-ignore:
- '**.md'
pull_request:
branches:
- master
env:
GOVER: 1.13.7
jobs:
lint:
name: 'lint example'
runs-on: ubuntu-latest
steps:
- name: 'install go ${{ env.GOVER }}'
uses: actions/setup-go@v1.1.2
with:
go-version: ${{ env.GOVER }}
- name: 'checkout'
uses: actions/checkout@v1
- name: 'set GOPATH'
# temporary fix
# see https://github.com/actions/setup-go/issues/14
run: |
echo "##[set-env name=GOPATH;]$(dirname $GITHUB_WORKSPACE)"
echo "##[add-path]$(dirname $GITHUB_WORKSPACE)/bin"
shell: bash
- name: 'install dependencies'
run: make lint-prepare
- name: 'lint example'
run: make lint vet
test:
name: 'test - ${{ matrix.platform }} w/ go ${{ matrix.go-version }}'
runs-on: ${{ matrix.platform }}
strategy:
matrix:
go-version: [1.12.x, 1.13.x]
platform: [ubuntu-latest, macos-latest, windows-latest]
target_arch: [arm64]
steps:
- name: 'install go ${{ matrix.go-version }}'
if: success()
uses: actions/setup-go@v1.1.2
with:
go-version: ${{ matrix.go-version }}
- name: 'checkout'
uses: actions/checkout@v1
- name: 'set GOPATH'
run: |
echo "##[set-env name=GOPATH;]$(dirname $GITHUB_WORKSPACE)"
echo "##[add-path]$(dirname $GITHUB_WORKSPACE)/bin"
shell: bash
- name: 'build example'
run: make build
- name: 'test example'
run: make test
release:
name: 'release example'
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
needs: [lint, test]
steps:
- name: 'setup node.js'
uses: actions/setup-node@v1.4.0
with:
node-version: 12
- name: 'install go ${{ env.GOVER }}'
uses: actions/setup-go@v1.1.2
with:
go-version: ${{ env.GOVER }}
- name: 'checkout'
uses: actions/checkout@master
- name: 'install dependencies'
run: npm ci
- name: 'generate semantic version'
run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}