-
Notifications
You must be signed in to change notification settings - Fork 8
281 lines (276 loc) · 11.8 KB
/
build.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
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
name: build
on: [push, pull_request]
jobs:
linux:
strategy:
fail-fast: false
matrix:
include:
- debian-arch: i386
cflags: -m32
cxxflags: -m32
rust-target: i686-unknown-linux-gnu
cmake-find-root-path: /usr/lib/i386-linux-gnu
teb-target: linux-i686
arch: i386
- debian-arch: amd64
rust-target: x86_64-unknown-linux-gnu
cmake-find-root-path: /usr/lib/x86_64-linux-gnu
teb-target: linux-x86_64
arch: x86_64
runs-on: ubuntu-latest
steps:
- name: Checkout Gosling
uses: actions/checkout@v4
with:
submodules: true
- name: Install Dependencies
run: |
sudo dpkg --add-architecture ${{ matrix.debian-arch }}
sudo apt-get update
sudo apt install -y gcc-multilib g++-multilib
sudo apt-get install -y libc6:${{ matrix.debian-arch }} libstdc++6:${{ matrix.debian-arch }} libboost-all-dev:${{ matrix.debian-arch }} libncurses-dev:${{ matrix.debian-arch }} default-jdk:${{ matrix.debian-arch }} dpkg-dev libssl-dev:${{ matrix.debian-arch }} libsqlite3-dev:${{ matrix.debian-arch }} liblzma-dev:${{ matrix.debian-arch }}
- name: Configure Rust
run: |
rustup target add ${{ matrix.rust-target }}
rustup default stable-${{ matrix.rust-target }}
- name: Build Debug
run: |
cmake -S . -B build -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=dist/debug -DBUILD_PYTHON_BINDINGS=ON -DBUILD_JAVA_BINDINGS=ON -DBUILD_DEBIAN_SOURCE_PACKAGE=ON -DENABLE_TOR_EXPERT_BUNDLE=ON -DTEB_TARGET=${{ matrix.teb-target }} -DCMAKE_C_FLAGS="${{ matrix.cflags }}" -DCMAKE_CXX_FLAGS="${{ matrix.cxxflags }}" -DCMAKE_FIND_ROOT_PATH=${{ matrix.cmake-find-root-path }}
cmake --build build
cmake --install build
- name: Archive Debug
run: |
cd dist
tar -cf gosling-linux-gnu-${{ matrix.arch }}-debug.tar debug
- name: Upload Debug
uses: actions/upload-artifact@v4
with:
name: gosling-linux-gnu-${{ matrix.arch }}-debug.tar
path: dist/gosling-linux-gnu-${{ matrix.arch }}-debug.tar
- name: Build Release
run: |
cmake -S . -B build -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=dist/release -DENABLE_LEGACY_TOR_PROVIDER=ON -DENABLE_ARTI_CLIENT_TOR_PROVIDER=ON -DBUILD_PYTHON_BINDINGS=ON -DBUILD_JAVA_BINDINGS=ON -DBUILD_DEBIAN_SOURCE_PACKAGE=ON -DENABLE_TOR_EXPERT_BUNDLE=ON -DTEB_TARGET=${{ matrix.teb-target }} -DCMAKE_C_FLAGS="${{ matrix.cflags }}" -DCMAKE_CXX_FLAGS="${{ matrix.cxxflags }}" -DCMAKE_FIND_ROOT_PATH=${{ matrix.cmake-find-root-path }}
cmake --build build
cmake --install build
- name: Archive Release
run: |
cd dist
tar -cf gosling-linux-gnu-${{ matrix.arch }}-release.tar release
- name: Upload Release
uses: actions/upload-artifact@v4
with:
name: gosling-linux-gnu-${{ matrix.arch }}-release.tar
path: dist/gosling-linux-gnu-${{ matrix.arch }}-release.tar
windows-msys2:
strategy:
fail-fast: false
matrix:
include:
- msystem: ucrt64
msys-env: ucrt-x86_64
java-arch: x64
teb-target: windows-x86_64
- msystem: clang64
msys-env: clang-x86_64
java-arch: x64
teb-target: windows-x86_64
- msystem: mingw64
msys-env: x86_64
java-arch: x86_64
teb-target: windows-x86_64
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- name: Checkout Gosling
uses: actions/checkout@v4
with:
submodules: true
- name: Install MSYS2 Dependencies
uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.msystem }}
update: true
install: >-
make
mingw-w64-${{ matrix.msys-env }}-cmake
mingw-w64-${{ matrix.msys-env }}-clang
mingw-w64-${{ matrix.msys-env }}-rust
mingw-w64-${{ matrix.msys-env }}-boost
mingw-w64-${{ matrix.msys-env }}-ncurses
mingw-w64-${{ matrix.msys-env }}-openssl
mingw-w64-${{ matrix.msys-env }}-sqlite3
mingw-w64-${{ matrix.msys-env }}-xz
- name: Install Java
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
architecture: ${{ matrix.java-arch }}
- name: Build Debug
env:
CC: clang
run: |
# manually add java bins to PATH >:[
export PATH=$(cygpath -u ${JAVA_HOME})/bin:$PATH
mkdir -p build/debug
cd build/debug
cmake ../.. -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=../../dist/debug -DENABLE_LEGACY_TOR_PROVIDER=ON -DENABLE_ARTI_CLIENT_TOR_PROVIDER=ON -DBUILD_PYTHON_BINDINGS=ON -DBUILD_JAVA_BINDINGS=ON -DBUILD_EXAMPLES=ON -DBUILD_MSYS2_PKGBUILD=ON -DENABLE_TOR_EXPERT_BUNDLE=ON -DTEB_TARGET=${{ matrix.teb-target }}
make
make install
- name: Archive Debug
run: |
cd dist
tar -cf gosling-windows-mingw-w64-${{ matrix.msys-env }}-debug.tar debug
- name: Upload Debug
uses: actions/upload-artifact@v4
with:
name: gosling-windows-mingw-w64-${{ matrix.msys-env }}-debug.tar
path: dist/gosling-windows-mingw-w64-${{ matrix.msys-env }}-debug.tar
- name: Build Release
env:
CC: clang
run: |
# manually add java bins to PATH >:[
export PATH=$(cygpath -u ${JAVA_HOME})/bin:$PATH
mkdir -p build/release
cd build/release
cmake ../.. -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../../dist/release -DENABLE_LEGACY_TOR_PROVIDER=ON -DENABLE_ARTI_CLIENT_TOR_PROVIDER=ON -DBUILD_PYTHON_BINDINGS=ON -DBUILD_JAVA_BINDINGS=ON -DBUILD_EXAMPLES=ON -DBUILD_MSYS2_PKGBUILD=ON -DENABLE_TOR_EXPERT_BUNDLE=ON -DTEB_TARGET=${{ matrix.teb-target }}
make
make install
- name: Archive Release
run: |
cd dist
tar -cf gosling-windows-mingw-w64-${{ matrix.msys-env }}-release.tar release
- name: Upload Release
uses: actions/upload-artifact@v4
with:
name: gosling-windows-mingw-w64-${{ matrix.msys-env }}-release.tar
path: dist/gosling-windows-mingw-w64-${{ matrix.msys-env }}-release.tar
windows-msvc:
strategy:
fail-fast: false
matrix:
include:
- java-arch: x64
platform: x64
rust-target: x86_64-pc-windows-msvc
teb-target: windows-x86_64
vcpkg-triplet: x64-windows
- java-arch: x86
platform: Win32
rust-target: i686-pc-windows-msvc
teb-target: windows-x86_64
vcpkg-triplet: x86-windows
runs-on: windows-latest
steps:
- name: Checkout Gosling
uses: actions/checkout@v4
with:
submodules: true
- name: Install Java
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
architecture: ${{ matrix.java-arch }}
- name: Install boost
uses: MarkusJx/[email protected]
id: install-boost
with:
boost_version: 1.78.0
platform_version: 2022
toolset: msvc
- name: Install Dependencies
env:
VCPKG_DEFAULT_TRIPLET: ${{ matrix.vcpkg-triplet }}
run: |
vcpkg install openssl sqlite3 liblzma
- name: Configure Rust
run: |
rustup target add ${{ matrix.rust-target }}
rustup default stable-${{ matrix.rust-target }}
- name: Build Debug
env:
BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }}
run: |
cmake -S . -B build/debug -DCMAKE_BUILD_TYPE=Debug -A ${{ matrix.platform }} -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_INSTALL_PREFIX=dist/debug -DENABLE_LEGACY_TOR_PROVIDER=ON -DENABLE_ARTI_CLIENT_TOR_PROVIDER=ON -DBUILD_PYTHON_BINDINGS=ON -DBUILD_JAVA_BINDINGS=ON -DENABLE_TOR_EXPERT_BUNDLE=ON -DTEB_TARGET=${{ matrix.teb-target }}
cmake --build build/debug --config Debug
cmake --install build/debug --config Debug
- name: Upload Debug
uses: actions/upload-artifact@v4
with:
name: gosling-windows-msvc-${{ matrix.java-arch}}-debug
path: dist/debug
- name: Build Release
env:
BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }}
run: |
cmake -S . -B build/release -DCMAKE_BUILD_TYPE=Release -A ${{ matrix.platform }} -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_INSTALL_PREFIX=dist/release -DENABLE_LEGACY_TOR_PROVIDER=ON -DENABLE_ARTI_CLIENT_TOR_PROVIDER=ON -DBUILD_PYTHON_BINDINGS=ON -DBUILD_JAVA_BINDINGS=ON -DENABLE_TOR_EXPERT_BUNDLE=ON -DTEB_TARGET=${{ matrix.teb-target }}
cmake --build build/release --config Release
cmake --install build/release --config Release
- name: Upload Release
uses: actions/upload-artifact@v4
with:
name: gosling-windows-msvc-${{ matrix.java-arch}}-release
path: dist/release
macos:
strategy:
fail-fast: false
matrix:
include:
- runs-on: macos-12
arch: x86_64
teb-target: macos-x86_64
macosx-deployment-target: 12.7
- runs-on: macos-14
arch: aarch64
teb-target: macos-aarch64
macosx-deployment-target: 14.0
runs-on: ${{ matrix.runs-on }}
steps:
- name: Checkout Gosling
uses: actions/checkout@v4
with:
submodules: true
- name: Install Dependencies
run: |
brew install boost openssl sqlite xz
- name: Build Debug
env:
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.macosx-deployment-target }}
run: |
mkdir -p build/debug
cd build/debug
cmake ../.. -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug -DCMAKE_PREFIX_PATH="$(brew --prefix)" -DCMAKE_INSTALL_PREFIX=../../dist/debug -DENABLE_LEGACY_TOR_PROVIDER=ON -DENABLE_ARTI_CLIENT_TOR_PROVIDER=ON -DBUILD_PYTHON_BINDINGS=ON -DBUILD_JAVA_BINDINGS=ON -DBUILD_EXAMPLES=ON -DBUILD_HOMEBREW_FORMULA=ON -DENABLE_TOR_EXPERT_BUNDLE=ON -DTEB_TARGET=${{ matrix.teb-target }}
make
make install
- name: Archive Debug
run: |
cd dist
tar -cf gosling-macos-${{ matrix.arch }}-debug.tar debug
- name: Upload Debug
uses: actions/upload-artifact@v4
with:
name: gosling-macos-${{ matrix.arch }}-debug.tar
path: dist/gosling-macos-${{ matrix.arch }}-debug.tar
- name: Build Release
env:
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.macosx-deployment-target }}
run: |
mkdir -p build/release
cd build/release
cmake ../.. -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$(brew --prefix)" -DCMAKE_INSTALL_PREFIX=../../dist/release -DENABLE_LEGACY_TOR_PROVIDER=ON -DENABLE_ARTI_CLIENT_TOR_PROVIDER=ON -DBUILD_PYTHON_BINDINGS=ON -DBUILD_JAVA_BINDINGS=ON -DBUILD_EXAMPLES=ON -DBUILD_HOMEBREW_FORMULA=ON -DENABLE_TOR_EXPERT_BUNDLE=ON -DTEB_TARGET=${{ matrix.teb-target }}
make
make install
- name: Archive Release
run: |
cd dist
tar -cf gosling-macos-${{ matrix.arch }}-release.tar release
- name: Upload Release
uses: actions/upload-artifact@v4
with:
name: gosling-macos-${{ matrix.arch }}-release.tar
path: dist/gosling-macos-${{ matrix.arch }}-release.tar