Repository navigation
82 lines (68 loc) · 1.9 KB
/
Copy pathrelease.yml
File metadata and controls
82 lines (68 loc) · 1.9 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
name: Release
on:
push:
branches: [ main ]
tags:
- 'v*'
pull_request:
branches: [ main ]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.17
id: go
- name: Set up node 14.x
uses: actions/setup-node@v2
with:
node-version: 14.x
id: node
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get git tag
uses: olegtarasov/get-tag@v2.1
id: tagName
- name: Build project
run: |
chmod +x build.sh
./build.sh ${{ steps.tagName.outputs.tag }}
- name: Upload
uses: actions/upload-artifact@v2
with:
name: my-artifact
path: |
./build/*.zip
release:
name: Release
needs: build
runs-on: ubuntu-latest
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/v')
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set output
id: vars
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}
- name: Download
uses: actions/download-artifact@v2
with:
name: my-artifact
path: ./build/
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
./build/asuwave_${{ steps.vars.outputs.tag }}_darwin_amd64.zip
./build/asuwave_${{ steps.vars.outputs.tag }}_darwin_arm64.zip
./build/asuwave_${{ steps.vars.outputs.tag }}_linux_amd64.zip
./build/asuwave_${{ steps.vars.outputs.tag }}_linux_arm64.zip
./build/asuwave_${{ steps.vars.outputs.tag }}_windows_amd64.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}