-
Notifications
You must be signed in to change notification settings - Fork 5
245 lines (206 loc) · 8.17 KB
/
build_cloak.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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
name: cloak
on: [push]
jobs:
Build-Cloak:
name: 'Build-Cloak'
runs-on: ubuntu-latest
if: |
contains(github.event.head_commit.message, '[all]') ||
contains(github.event.head_commit.message, '[windows]') ||
contains(github.event.head_commit.message, '[linux]') ||
contains(github.event.head_commit.message, '[macos]') ||
contains(github.event.head_commit.message, '[cloak]')
steps:
- name: 'Install GO'
uses: actions/setup-go@v2
with:
go-version: '^1.22' # The Go version to download (if necessary) and use.
- name: 'Setup ccache'
uses: hendrikmuhs/[email protected]
- name: 'Get sources'
uses: actions/checkout@v3
with:
submodules: 'true'
fetch-depth: 10
- name: 'Get Cloak'
uses: actions/checkout@v3
with:
repository: amnezia-vpn/Cloak
ref: master-amnezia
path: Cloak
- name: 'Build Cloak binary'
working-directory: Cloak
run: |
export PATH=${PATH}:`go env GOPATH`/bin
v=${GITHUB_REF#refs/*/} ./release.sh
- name: 'Build desktop Cloak plugin'
working-directory: Cloak
run: |
sudo apt-get install gcc-mingw-w64
mkdir ./release/plugin
mkdir ./release/plugin/linux
CGO_ENABLED=1 GOOS="linux" GOARCH="amd64" go build -v -o ./release/plugin/linux/ck-ovpn-plugin.a -buildmode=c-archive ./cmd/ck-ovpn-plugin/
mkdir ./release/plugin/windows
CGO_ENABLED=1 CC=x86_64-w64-mingw32-gcc GOOS="windows" GOARCH="amd64" go build -v -o ./release/plugin/windows/ck-ovpn-plugin.dll -buildmode=c-shared ./cmd/ck-ovpn-plugin/
- name: Archive Linux client binary
uses: actions/upload-artifact@v3
with:
retention-days: 1
name: ck-client-linux
path: '~/work/3rd-build-ga/3rd-build-ga/Cloak/release/ck-client-linux*'
- name: Archive Windows client binary
uses: actions/upload-artifact@v3
with:
retention-days: 1
name: ck-client-windows
path: '~/work/3rd-build-ga/3rd-build-ga/Cloak/release/ck-client-windows*'
- name: Archive Darwin client binary
uses: actions/upload-artifact@v3
with:
retention-days: 1
name: ck-client-darwin
path: '~/work/3rd-build-ga/3rd-build-ga/Cloak/release/ck-client-darwin*'
- name: Archive Linux server binary
uses: actions/upload-artifact@v3
with:
retention-days: 1
name: ck-server
path: '~/work/3rd-build-ga/3rd-build-ga/Cloak/release/ck-server-linux*'
- name: Archive Plugin
uses: actions/upload-artifact@v3
with:
retention-days: 1
name: desktop-plugin
path: '~/work/3rd-build-ga/3rd-build-ga/Cloak/release/plugin'
Build-Cloak-MacOS:
runs-on: macos-12
if: |
contains(github.event.head_commit.message, '[all]') ||
contains(github.event.head_commit.message, '[macos]') ||
contains(github.event.head_commit.message, '[cloak]') ||
contains(github.event.head_commit.message, '[cloak-macos]')
name: "Build Cloak MacOS plugin"
steps:
- name: 'Install GO'
uses: actions/setup-go@v2
with:
go-version: '^1.22'
- name: Get Cloak
uses: actions/checkout@v3
with:
repository: amnezia-vpn/Cloak
ref: master-amnezia
path: Cloak
- name: Build for x86_64 MacOS
working-directory: Cloak
run: |
CGO_ENABLED=1 GOOS="darwin" GOARCH="amd64" go build -v -o ./release/plugin/darwin/ck-ovpn-plugin-x86_64.a -buildmode=c-archive ./cmd/ck-ovpn-plugin/
- name: Build for arm64 MacOS
working-directory: Cloak
run: |
CGO_ENABLED=1 GOOS="darwin" GOARCH="arm64" go build -v -o ./release/plugin/darwin/ck-ovpn-plugin-arm64.a -buildmode=c-archive ./cmd/ck-ovpn-plugin/
- name: Create Fat Binary (Universal Binary)
working-directory: Cloak
run: |
lipo -create -output ./release/plugin/darwin/ck-ovpn-plugin.a \
./release/plugin/darwin/ck-ovpn-plugin-x86_64.a \
./release/plugin/darwin/ck-ovpn-plugin-arm64.a
- name: Archive artifacts
uses: actions/upload-artifact@v3
with:
name: darwin-pt
path: Cloak/release/plugin
Build-Cloak-iOS:
runs-on: macos-12
if: |
contains(github.event.head_commit.message, '[all]') ||
contains(github.event.head_commit.message, '[ios]') ||
contains(github.event.head_commit.message, '[cloak]')
name: "Build Cloak iOS Plugin"
steps:
- name: Get Cloak
uses: actions/checkout@v3
with:
repository: amnezia-vpn/Cloak
ref: master-amnezia
path: Cloak
- name: 'Run build script'
working-directory: Cloak
run: |
GOOS=ios GOARCH=arm64 GOFLAGS="-tags=ios" CGO_CFLAGS="-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk -miphoneos-version-min=9.0 -fembed-bitcode -arch arm64" CGO_CXXFLAGS="-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk -miphoneos-version-min=9.0 -fembed-bitcode -arch arm64" CGO_LDFLAGS="-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk -miphoneos-version-min=9.0 -fembed-bitcode -arch arm64" CGO_ENABLED=1 go build -buildmode=c-archive -o ck-ovpn-plugin.a ./cmd/ck-ovpn-plugin
- name: Archive iOS client binary
uses: actions/upload-artifact@v3
with:
retention-days: 1
name: ck-ios-plugin
path: '~/work/3rd-build-ga/3rd-build-ga/Cloak/ck-ovpn-plugin*'
github-release:
name: GitHub Release
needs: Build-Cloak
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Setup | Checkout
uses: actions/checkout@v2
- name: Setup | Artifacts
uses: actions/download-artifact@v2
- name: Setup | Checksums
run: for file in $(find ./ -name '*' ); do openssl dgst -sha256 -r "$file" | awk '{print $1}' > "${file}.sha256"; done
- name: Zip ALL
run: for file in *; do zip -r ${file%.*}.zip $file; done
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ck-client-linux.zip
tag: ${{ github.ref }}
overwrite: true
file_glob: true
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ck-client-windows.zip
tag: ${{ github.ref }}
overwrite: true
file_glob: true
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ck-client-darwin.zip
tag: ${{ github.ref }}
overwrite: true
file_glob: true
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ck-server.zip
tag: ${{ github.ref }}
overwrite: true
file_glob: true
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ck-ios-plugin.zip
tag: ${{ github.ref }}
overwrite: true
file_glob: true
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: darwin-pt.zip
tag: ${{ github.ref }}
overwrite: true
file_glob: true
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: desktop-plugin.zip
tag: ${{ github.ref }}
overwrite: true
file_glob: true