-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (67 loc) · 1.57 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: Go
on:
push:
tags: [ v* ]
branches: [ master ]
pull_request:
release:
types: [ published ]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19.5
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v3.3.1
with:
version: v1.50.1
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
outfile: tanya_linux
- os: windows-latest
outfile: tanya.exe
- os: macos-latest
outfile: tanya_macOS
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19.5
- name: Build
run: go build -v -o ${{ matrix.outfile }}
- name: Test
run: go test -v -race ./...
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: tanya-binaries
path: ${{ matrix.outfile }}
release:
runs-on: ubuntu-latest
needs: build
if: github.event.release
steps:
- name: Download binary artifacts
id: download
uses: actions/download-artifact@v4.1.7
with:
name: tanya-binaries
- name: Upload release assets
uses: alexellis/upload-assets@0.2.3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
asset_paths: '["${{ steps.download.outputs.download-path }}/*"]'