-
Notifications
You must be signed in to change notification settings - Fork 2
68 lines (56 loc) · 1.76 KB
/
workflow.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
on:
push:
tags:
- 'v*'
name: Build and Release
jobs:
release:
name: 'Create Release from Tag'
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- name: Checkout
uses: actions/checkout@master
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.get_version.outputs.VERSION }}
release_name: Release ${{ steps.get_version.outputs.VERSION }}
draft: false
prerelease: false
build:
name: 'Build and Upload Release Binary'
runs-on: ubuntu-latest
needs: release
strategy:
matrix:
OSes: ['windows', 'darwin', 'linux']
arch: ['amd64']
steps:
- name: 'Checkout'
uses: actions/checkout@master
- name: 'Setup Golang Environment'
uses: actions/setup-go@v2
with:
go-version: '^1.17'
- name: 'Build ${{ matrix.OSes }}-${{ matrix.arch }}'
run: |
GOOS=${{ matrix.OSes }} \
GOARCH=${{ matrix.arch }} \
go build -o ino_${{ matrix.OSes }}_${{ matrix.arch }}
- name: 'Upload Release Assets'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: ./ino_${{ matrix.OSes }}_${{ matrix.arch }}
asset_name: ino_${{ matrix.OSes }}_${{ matrix.arch }}
asset_content_type: application/octet-stream