Skip to content

Commit 10535d5

Browse files
authored
First working version of the koana workflow
1 parent 51988b7 commit 10535d5

1 file changed

Lines changed: 326 additions & 0 deletions

File tree

.github/workflows/koana.yml

Lines changed: 326 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,326 @@
1+
name: Build koana
2+
on:
3+
workflow_dispatch:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- '.github/workflows/koana.yml'
9+
10+
jobs:
11+
build-windows-x64:
12+
runs-on: windows-latest
13+
steps:
14+
- name: Clone koana repo
15+
uses: actions/checkout@v4
16+
with:
17+
repository: DSharpPlus/libkoana
18+
19+
- name: Setup VS build tools
20+
uses: seanmiddleditch/gha-setup-vsdevenv@v5
21+
with:
22+
host_arch: amd64
23+
arch: amd64
24+
25+
- name: Install nasm
26+
shell: pwsh
27+
run: |
28+
choco install nasm
29+
30+
- name: Build openssl
31+
shell: pwsh
32+
run: |
33+
git clone https://github.com/openssl/openssl
34+
cd openssl
35+
git checkout openssl-3.5.0
36+
$env:PATH += ";C:\Program Files\NASM"
37+
C:\Strawberry\perl\bin\perl.exe Configure VC-WIN64A
38+
C:\Strawberry\perl\bin\perl.exe Configure no-makedepend
39+
nmake
40+
41+
- name: Build koana
42+
shell: pwsh
43+
run: |
44+
cmake -B build -A x64 -DOPENSSL_ROOT_DIR=".\openssl\" -DOPENSSL_CRYPTO_LIBRARY=".\openssl\libcrypto.lib" -DOPENSSL_SSL_LIBRARY=".\openssl\libssl.lib" -DOPENSSL_INCLUDE_DIR=".\openssl\include\"
45+
cmake --build build --config Release --parallel
46+
47+
- name: Publish Artifacts
48+
uses: actions/upload-artifact@v4
49+
with:
50+
name: koana-windows-x64
51+
path: build/Release/koana.dll
52+
53+
build-windows-arm64:
54+
runs-on: windows-latest
55+
steps:
56+
- name: Clone koana repo
57+
uses: actions/checkout@v4
58+
with:
59+
repository: DSharpPlus/libkoana
60+
61+
- name: Setup VS build tools
62+
uses: seanmiddleditch/gha-setup-vsdevenv@v5
63+
with:
64+
host_arch: amd64
65+
arch: arm64
66+
67+
- name: Install nasm
68+
shell: pwsh
69+
run: |
70+
choco install nasm
71+
72+
- name: Build openssl
73+
shell: pwsh
74+
run: |
75+
git clone https://github.com/openssl/openssl
76+
cd openssl
77+
git checkout openssl-3.5.0
78+
$env:PATH += ";C:\Program Files\NASM"
79+
C:\Strawberry\perl\bin\perl.exe Configure VC-WIN64-ARM
80+
C:\Strawberry\perl\bin\perl.exe Configure no-makedepend
81+
nmake
82+
83+
- name: Build koana
84+
shell: pwsh
85+
run: |
86+
cmake -B build -A ARM64 -DOPENSSL_ROOT_DIR=".\openssl\" -DOPENSSL_CRYPTO_LIBRARY=".\openssl\libcrypto.lib" -DOPENSSL_SSL_LIBRARY=".\openssl\libssl.lib" -DOPENSSL_INCLUDE_DIR=".\openssl\include\"
87+
cmake --build build --config Release --parallel
88+
89+
- name: Publish Artifacts
90+
uses: actions/upload-artifact@v4
91+
with:
92+
name: koana-windows-arm64
93+
path: build/Release/koana.dll
94+
95+
build-linux-x64:
96+
runs-on: ubuntu-latest
97+
steps:
98+
- name: Clone koana repo
99+
uses: actions/checkout@v4
100+
with:
101+
repository: DSharpPlus/libkoana
102+
103+
- name: Install build tools
104+
shell: bash
105+
run: |
106+
sudo apt update
107+
sudo apt install cmake
108+
109+
- name: Build openssl
110+
shell: bash
111+
run: |
112+
git clone https://github.com/openssl/openssl
113+
cd openssl
114+
git checkout openssl-3.5.0
115+
./Configure linux-x86_64
116+
make -j4
117+
118+
- name: Build koana
119+
shell: bash
120+
run: |
121+
cmake -B build -DCMAKE_BUILD_TYPE=Release -DOPENSSL_ROOT_DIR="./openssl/" -DOPENSSL_CRYPTO_LIBRARY="./openssl/libcrypto.a" -DOPENSSL_SSL_LIBRARY="./openssl/libssl.a" -DOPENSSL_INCLUDE_DIR="./openssl/include/"
122+
cmake --build build --parallel
123+
124+
- name: Publish Artifacts
125+
uses: actions/upload-artifact@v4
126+
with:
127+
name: koana-linux-x64
128+
path: build/libkoana.so
129+
130+
build-linux-arm64:
131+
runs-on: ubuntu-latest
132+
steps:
133+
- name: Clone koana repo
134+
uses: actions/checkout@v4
135+
with:
136+
repository: DSharpPlus/libkoana
137+
138+
- name: Install build tools
139+
shell: bash
140+
run: |
141+
sudo apt update
142+
sudo apt install cmake gcc-aarch64-linux-gnu g++-aarch64-linux-gnu libssl-dev
143+
144+
- name: Build openssl
145+
shell: bash
146+
run: |
147+
git clone https://github.com/openssl/openssl
148+
cd openssl
149+
git checkout openssl-3.5.0
150+
export CC=aarch64-linux-gnu-gcc
151+
export CXX=aarch64-linux-gnu-g++
152+
export AR=aarch64-linux-gnu-ar
153+
./Configure linux-aarch64
154+
make -j4
155+
156+
- name: Build koana
157+
shell: bash
158+
run: |
159+
cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc -DCMAKE_CXX_COMPILER=aarch64-linux-gnu-g++ -DOPENSSL_ROOT_DIR="./openssl/" -DOPENSSL_CRYPTO_LIBRARY="./openssl/libcrypto.a" -DOPENSSL_SSL_LIBRARY="./openssl/libssl.a" -DOPENSSL_INCLUDE_DIR="./openssl/include/"
160+
cmake --build build --parallel
161+
162+
- name: Publish Artifacts
163+
uses: actions/upload-artifact@v4
164+
with:
165+
name: koana-linux-arm64
166+
path: build/libkoana.so
167+
168+
build-macos-x64:
169+
runs-on: macos-latest
170+
steps:
171+
- name: Clone koana repo
172+
uses: actions/checkout@v4
173+
with:
174+
repository: DSharpPlus/libkoana
175+
176+
- name: Install nasm
177+
shell: bash
178+
run: |
179+
brew install nasm
180+
181+
- name: Build openssl
182+
shell: bash
183+
run: |
184+
git clone https://github.com/openssl/openssl
185+
cd openssl
186+
git checkout openssl-3.5.0
187+
./Configure darwin64-x86_64-cc
188+
make -j4
189+
190+
- name: Build koana
191+
shell: pwsh
192+
run: |
193+
cmake -B build -DOPENSSL_ROOT_DIR=".\openssl\" -DOPENSSL_CRYPTO_LIBRARY=".\openssl\libcrypto.a" -DOPENSSL_SSL_LIBRARY=".\openssl\libssl.a" -DOPENSSL_INCLUDE_DIR=".\openssl\include\" -DCMAKE_OSX_ARCHITECTURES=x86_64
194+
cmake --build build --config Release --parallel
195+
196+
- name: Publish Artifacts
197+
uses: actions/upload-artifact@v4
198+
with:
199+
name: koana-macos-x64
200+
path: build/libkoana.dylib
201+
202+
build-macos-arm64:
203+
runs-on: macos-latest
204+
steps:
205+
- name: Clone koana repo
206+
uses: actions/checkout@v4
207+
with:
208+
repository: DSharpPlus/libkoana
209+
210+
- name: Install nasm
211+
shell: bash
212+
run: |
213+
brew install nasm
214+
215+
- name: Build openssl
216+
shell: bash
217+
run: |
218+
git clone https://github.com/openssl/openssl
219+
cd openssl
220+
git checkout openssl-3.5.0
221+
./Configure darwin64-arm64-cc
222+
make -j4
223+
224+
- name: Build koana
225+
shell: pwsh
226+
run: |
227+
cmake -B build -DOPENSSL_ROOT_DIR=".\openssl\" -DOPENSSL_CRYPTO_LIBRARY=".\openssl\libcrypto.a" -DOPENSSL_SSL_LIBRARY=".\openssl\libssl.a" -DOPENSSL_INCLUDE_DIR=".\openssl\include\" -DCMAKE_OSX_ARCHITECTURES=arm64
228+
cmake --build build --config Release --parallel
229+
230+
- name: Publish Artifacts
231+
uses: actions/upload-artifact@v4
232+
with:
233+
name: koana-macos-arm64
234+
path: build/libkoana.dylib
235+
236+
build-musl-x64:
237+
runs-on: ubuntu-latest
238+
steps:
239+
- name: Clone koana repo
240+
uses: actions/checkout@v4
241+
with:
242+
repository: DSharpPlus/libkoana
243+
244+
- name: Setup Alpine Linux
245+
uses: jirutka/setup-alpine@v1
246+
with:
247+
packages: >
248+
build-base
249+
cmake
250+
git
251+
make
252+
gcc
253+
g++
254+
nasm
255+
perl
256+
linux-headers
257+
258+
- name: Build openssl
259+
shell: alpine.sh {0}
260+
run: |
261+
git clone https://github.com/openssl/openssl
262+
cd openssl
263+
git checkout openssl-3.5.0
264+
./Configure linux-x86_64
265+
make -j4
266+
267+
- name: Build koana
268+
shell: bash
269+
run: |
270+
cmake -B build -DCMAKE_BUILD_TYPE=Release -DOPENSSL_ROOT_DIR="./openssl/" -DOPENSSL_CRYPTO_LIBRARY="./openssl/libcrypto.a" -DOPENSSL_SSL_LIBRARY="./openssl/libssl.a" -DOPENSSL_INCLUDE_DIR="./openssl/include/"
271+
cmake --build build --parallel
272+
273+
- name: Publish Artifacts
274+
uses: actions/upload-artifact@v4
275+
with:
276+
name: koana-musl-x64
277+
path: build/libkoana.so
278+
279+
build-musl-arm64:
280+
runs-on: ubuntu-latest
281+
steps:
282+
- name: Clone koana repo
283+
uses: actions/checkout@v4
284+
with:
285+
repository: DSharpPlus/libkoana
286+
287+
- name: Setup Alpine Linux
288+
uses: jirutka/setup-alpine@v1
289+
with:
290+
arch: aarch64
291+
packages: >
292+
build-base
293+
cmake
294+
git
295+
make
296+
gcc
297+
g++
298+
nasm
299+
perl
300+
linux-headers
301+
302+
- name: Build openssl
303+
shell: alpine.sh {0}
304+
run: |
305+
git clone https://github.com/openssl/openssl
306+
cd openssl
307+
git checkout openssl-3.5.0
308+
./Configure linux-aarch64
309+
make -j4
310+
311+
- name: Build koana
312+
shell: bash
313+
run: |
314+
cmake -B build -DCMAKE_BUILD_TYPE=Release -DOPENSSL_ROOT_DIR="./openssl/" -DOPENSSL_CRYPTO_LIBRARY="./openssl/libcrypto.a" -DOPENSSL_SSL_LIBRARY="./openssl/libssl.a" -DOPENSSL_INCLUDE_DIR="./openssl/include/"
315+
cmake --build build --parallel
316+
317+
- name: Publish Artifacts
318+
uses: actions/upload-artifact@v4
319+
with:
320+
name: koana-musl-arm64
321+
path: build/libkoana.so
322+
323+
# publish-nuget:
324+
# runs-on: ubuntu-latest
325+
# needs: [build-windows-x64, build-windows-arm64, build-linux-x64, build-linux-arm64, build-macos-x64, build-macos-arm64, build-musl-x64, build-musl-arm64]
326+
# steps:

0 commit comments

Comments
 (0)