forked from kumina/openvpn_exporter
-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (36 loc) · 1.17 KB
/
release.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
name: Build release
on:
release:
types: [ published ]
jobs:
build:
name: Build
runs-on: ubuntu-latest
strategy:
matrix:
include:
- os: darwin
arch: amd64
- os: linux
arch: amd64
- os: windows
arch: amd64
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.16
- name: Check out code into the Go module directory
uses: actions/checkout@master
- name: Build
run: GOOS=${{ matrix.os }} GOARCH=${{ matrix.arch }} go build -o ./bin/${{ github.event.release.tag_name }}_${{ matrix.os }}_${{ matrix.arch }}
- name: Upload release asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./bin/${{ github.event.release.tag_name }}_${{ matrix.os }}_${{ matrix.arch }}
asset_name: ${{ github.event.repository.name }}-${{ github.event.release.tag_name }}.${{ matrix.os }}-${{ matrix.arch }}
asset_content_type: application/octet-stream