-
Notifications
You must be signed in to change notification settings - Fork 2
49 lines (47 loc) · 1.19 KB
/
build.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
name: build
on:
push:
branches:
- main
pull_request:
branches:
- main
release:
types:
- published
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Install go
uses: actions/setup-go@v3
with:
go-version: 1.19.x
- name: Check out source code
uses: actions/checkout@v3
- name: Cache go dependencies
id: cache-go-dependencies
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Install go dependencies
if: steps.cache-go-dependencies.outputs.cache-hit != 'true'
run: go mod download
- name: Build
run:
make
- if: github.event_name == 'release' && github.event.action == 'published'
name: Publish artifacts on releases
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: bin/osv
tag: ${{ github.ref }}
overwrite: true
file_glob: true