-
Notifications
You must be signed in to change notification settings - Fork 4
91 lines (77 loc) · 2.48 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
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
name: build
on: [push]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
with:
ref: ${{ github.ref }}
- name: Prepare repository
run: git checkout "${GITHUB_REF:11}"
- name: Install Go
uses: actions/setup-go@v1
with:
go-version: 1.13.1
- name: test
run: make test
release:
runs-on: ubuntu-latest
needs: test
if: github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v1
with:
ref: ${{ github.ref }}
- name: Prepare repository
run: git checkout "${GITHUB_REF:11}"
- uses: syncromatics/[email protected]
id: gogitver
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.gogitver.outputs.version }}
release_name: Release ${{ steps.gogitver.outputs.version }}
draft: false
prerelease: false
- name: Install Go
uses: actions/setup-go@v1
with:
go-version: 1.13.1
- name: build
run: make package
- uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./artifacts/linux.tar.gz
asset_name: linux.tar.gz
asset_content_type: application/gzip
- uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./artifacts/windows.zip
asset_name: windows.zip
asset_content_type: application/zip
- uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./artifacts/arm.tar.gz
asset_name: arm.tar.gz
asset_content_type: application/gzip
- uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./artifacts/darwin.tar.gz
asset_name: darwin.tar.gz
asset_content_type: application/gzip