Skip to content

Commit 29ba065

Browse files
committed
ci(github-action): add github action config to build project and perform release
1 parent eee406d commit 29ba065

File tree

1 file changed

+65
-0
lines changed

1 file changed

+65
-0
lines changed
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# on:
2+
# push:
3+
# tags:
4+
# - 'v*'
5+
on: [push]
6+
7+
name: Build&Release
8+
9+
jobs:
10+
build:
11+
name: Build release
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v2
16+
with:
17+
submodules: recursive
18+
19+
- name: Setup Go
20+
uses: actions/setup-go@v2
21+
with:
22+
go-version: ^1.16
23+
24+
- name: Setup Node.js
25+
uses: actions/setup-node@v1
26+
with:
27+
node-version: '14.x'
28+
29+
- name: Build static
30+
run: cd web && yarn && yarn build && cd ../
31+
32+
- name: Get Go dependencies
33+
run: go mod download && go get -u github.com/rakyll/statik
34+
35+
- name: Static->GO generation
36+
run: statik --src=web/build
37+
38+
- name: Build
39+
run: make
40+
- uses: actions/upload-artifact@v2
41+
with:
42+
name: build-artifact
43+
path: ssh-web-console-*
44+
45+
release:
46+
name: On Release
47+
needs: build
48+
runs-on: ubuntu-latest
49+
steps:
50+
- uses: actions/download-artifact@v2
51+
with:
52+
name: build-artifact
53+
- run: ls -R
54+
55+
- name: Release
56+
uses: softprops/action-gh-release@v1
57+
if: startsWith(github.ref, 'refs/tags/')
58+
with:
59+
files: |
60+
ssh-web-console-linux-amd64
61+
ssh-web-console-linux-arm64
62+
ssh-web-console-darwin-amd64
63+
ssh-web-console-windows-amd64.exe
64+
env:
65+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)