-
Notifications
You must be signed in to change notification settings - Fork 6
97 lines (89 loc) · 2.85 KB
/
release.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# on:
# push:
# tags:
# - 'v*'
on: [push]
name: Release
jobs:
build:
name: Build release
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04, macos-12, windows-2022]
include:
- os: ubuntu-22.04
artifact_files: wssocks-ustb-*
- os: macos-12
artifact_files: |
wssocks-ustb-client-macOS-universal.app.zip
client-ui-macOS-universal.app.zip
- os: windows-2022
artifact_files: client-ui-windows-amd64.exe
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: 1.17.13
- run: |
go get fyne.io/fyne/v2/cmd/fyne@v2.4.3
go mod download
- name: Build Cli
if: matrix.os == 'ubuntu-22.04'
run: |
make
- name: Build macOS
if: matrix.os == 'macos-12'
run: |
cd client-ui
make client-ui-macOS-universal.app -f Makefile-ci
zip -r client-ui-macOS-universal.app.zip client-ui-macOS-universal.app
mv client-ui-macOS-universal.app.zip ../
cd ../
echo "building swiftui-client"
cd extra/go-api && make && cd ../../
cd swiftui-client && xcodebuild -arch x86_64 -arch arm64
cd build/Release/ && zip -r wssocks-ustb-client-macOS-universal.app.zip wssocks-ustb-client.app && cd ../../../
mv swiftui-client/build/Release/wssocks-ustb-client-macOS-universal.app.zip ./
- name: Build Windows
if: matrix.os == 'windows-2022'
run: |
cd client-ui
make client-ui-windows-amd64.exe -f Makefile-ci
cd ../
mv client-ui/client-ui-windows-amd64.exe client-ui-windows-amd64.exe
- uses: actions/upload-artifact@v4
with:
name: build-artifact-${{ matrix.os }}
path: ${{ matrix.artifact_files }}
release:
name: On Release
needs: build
runs-on: ubuntu-22.04
steps:
- uses: actions/download-artifact@v4
with:
name: build-artifact-ubuntu-22.04
- uses: actions/download-artifact@v4
with:
name: build-artifact-windows-2022
- uses: actions/download-artifact@v4
with:
name: build-artifact-macos-12
- run: ls -R
- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
client-ui-windows-amd64.exe
client-ui-macOS-universal.app.zip
wssocks-ustb-client-macOS-universal.app.zip
wssocks-ustb-darwin-amd64
wssocks-ustb-linux-arm64
wssocks-ustb-linux-amd64
wssocks-ustb-windows-amd64.exe
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}