-
Notifications
You must be signed in to change notification settings - Fork 2
59 lines (54 loc) · 1.38 KB
/
go.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
name: Go
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
goos: [linux]
goarch: [amd64]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install Pcap
run: sudo apt-get install libpcap-dev
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17
- name: Install node
uses: actions/setup-node@master
with:
node-version: '14'
- name: Install ui dependencies
run: |
cd ./ui
npm install
- name: Build ui
run: |
cd ./ui
npm run build
mv dist static
- name: Build Binary
run: |
p_name=wg-webpanel
release_name="$p_name-${GITHUB_REF#refs/tags/*}-${{ matrix.goos }}-${{ matrix.goarch }}"
echo $release_name
tar_name="$release_name.tar.gz"
echo $tar_name
env GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -o "$release_name" -v
tar czvf "$tar_name" "$release_name" config.json -C ui/ static
rm "$release_name"
rm -r ui/static
- name: List content
run: |
ls -lah wg-webpanel-*
- name: Github Release
uses: softprops/action-gh-release@v0.1.14
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
draft: true
files: "wg-webpanel-*"