-
Notifications
You must be signed in to change notification settings - Fork 1
85 lines (73 loc) · 2.1 KB
/
release.yml
File metadata and controls
85 lines (73 loc) · 2.1 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
name: Release
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+-*'
jobs:
create_release:
name: Create a release
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- name: Create a release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
prerelease: true
draft: true
build:
needs: create_release
name: Build artifacts
strategy:
matrix:
go-version: [ 1.16.x ]
os: [ linux, darwin, windows ]
arch: [ amd64, arm64 ]
exclude:
- os: windows
arch: arm64
- os: darwin
arch: arm64
runs-on: ubuntu-latest
steps:
- name: Setup Go
uses: actions/setup-go@v1
with:
go-version: ${{ matrix.go-version }}
- name: Checkout
uses: actions/checkout@v2
- name: Fetch dependencies
working-directory: ./launcher
run: go mod vendor
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/}
- name: Build
working-directory: ./launcher
env:
GOOS: ${{ matrix.os }}
GOARCH: ${{ matrix.arch }}
run: |
make VERSION=${{ steps.get_version.outputs.VERSION }} build
make zip
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.os }}-${{ matrix.arch }}
path: |
launcher/launcher
launcher/launcher.exe
- name: Upload release assets
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: launcher/launcher.zip
asset_name: launcher-${{ matrix.os }}-${{ matrix.arch }}.zip
asset_content_type: application/zip