-
Notifications
You must be signed in to change notification settings - Fork 4
58 lines (50 loc) · 1.41 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
50
51
52
53
54
55
56
57
58
name: CI Build
on:
push:
branches:
- "master"
paths:
- "**.go"
- "go.mod"
- "go.sum"
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
go: [ '1.17' ]
steps:
- name: Set up Go v${{ matrix.go }}
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go }}
- name: Checkout code
uses: actions/checkout@v2
- name: Install deps
run: |
go version
go get -v -d ./...
- name: Cache modules
uses: actions/cache@v2
with:
path: $GOPATH/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-go
- name: Vet code
run: go vet
- name: Build binaries
run: |
GOOS=linux GOARCH=amd64 go build -o apnscmd_linux_amd64
GOOS=linux GOARCH=386 go build -o apnscmd_linux_386
GOOS=linux GOARCH=arm64 go build -o apnscmd_linux_arm64
GOOS=darwin GOARCH=amd64 go build -o apnscmd_darwin_amd64
GOOS=windows GOARCH=386 go build -o apnscmd_windows_386.exe
- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
prerelease: false
title: "Latest Build"
files: |
LICENSE
apnscmd_*