Skip to content

Commit e8cb86c

Browse files
committed
added github action
1 parent 26fc0b9 commit e8cb86c

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed

.github/workflows/build.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Build/release
2+
3+
on:
4+
workflow_dispatch:
5+
6+
push:
7+
tags:
8+
- "*"
9+
10+
jobs:
11+
release:
12+
runs-on: macos-latest
13+
14+
steps:
15+
- name: Check out Git repository
16+
uses: actions/checkout@v2
17+
18+
- name: Install Node.js, NPM and Yarn
19+
uses: actions/setup-node@v1
20+
with:
21+
node-version: "16.x"
22+
23+
- name: Get yarn cache
24+
id: yarn-cache
25+
run: echo "::set-output name=dir::$(yarn cache dir)"
26+
27+
- name: Cache dependencies
28+
uses: actions/cache@v1
29+
with:
30+
path: ${{ steps.yarn-cache.outputs.dir }}
31+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
32+
restore-keys: |
33+
${{ runner.os }}-yarn-
34+
35+
- name: Install dependencies
36+
run: yarn install --frozen-lockfile
37+
38+
- name: Install golang
39+
uses: actions/setup-go@v2
40+
with:
41+
go-version: "^1.17.6"
42+
43+
- name: Build
44+
run: |
45+
go get
46+
yarn build
47+
48+
- name: Create archives
49+
working-directory: ./dist
50+
run: |
51+
for i in *; do zip -r "${i%/}.zip" "$i"; done
52+
53+
- name: Upload binaries to release
54+
uses: svenstaro/upload-release-action@v2
55+
with:
56+
repo_token: ${{ secrets.GITHUB_TOKEN }}
57+
file: dist/*.zip
58+
file_glob: true
59+
tag: ${{ github.ref }}
60+
overwrite: true

0 commit comments

Comments
 (0)