Repository navigation
131 lines (112 loc) · 3.58 KB
/
Copy pathbuild.yml
File metadata and controls
131 lines (112 loc) · 3.58 KB
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
name: Build
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
workflow_dispatch:
jobs:
# ──── Android AAR ────
android:
name: Android AAR
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
- name: Set up Android SDK
uses: android-actions/setup-android@v3
with:
packages: 'platforms;android-35 ndk;27.2.12479018 build-tools;35.0.0'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Build AAR
working-directory: Android
run: |
chmod +x gradlew
./gradlew :library:assembleRelease
- name: Upload AAR
uses: actions/upload-artifact@v4
with:
name: library-release.aar
path: Android/library/build/outputs/aar/library-release.aar
# ──── Windows Native + .NET DLL ────
windows:
name: Windows
runs-on: windows-latest
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up MSYS2 (MinGW)
uses: msys2/setup-msys2@v2
with:
msystem: mingw64
update: true
install: >-
mingw-w64-x86_64-gcc
mingw-w64-x86_64-cmake
mingw-w64-x86_64-toolchain
- name: Set up .NET 10
uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'
- name: Build Native (CMake + MinGW)
shell: msys2 {0}
run: |
cd StArray.ModManager.Windows/Native
# Generate cimgui import lib from DLL
gendef - ../dlls/cimgui.dll > cimgui.def
dlltool -d cimgui.def -l libcimgui.a -D ../dlls/cimgui.dll
cmake -B build -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release
cmake --build build
- name: Build C#
run: dotnet build StArray.ModManager.Windows/StArray.ModManager.Windows.csproj -c Release -p:BuildNativeDll=false
- name: Package
run: |
src="StArray.ModManager.Windows/bin/Release/net10.0"
dst="artifacts"
mkdir -p "$dst"
cp -r "$src"/* "$dst/"
rm -rf "$dst/runtimes"
tar -czf windows-dll.tar.gz -C "$dst" .
- name: Upload
uses: actions/upload-artifact@v4
with:
name: windows-dll
path: windows-dll.tar.gz
# ──── Android .NET DLL ────
android-dll:
name: Android DLL
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up .NET 10
uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'
- name: Build Android
run: dotnet build StArray.ModManager.Android/StArray.ModManager.Android.csproj -c Release
- name: Package output (exclude runtimes)
run: |
src="StArray.ModManager.Android/bin/Release/net10.0"
dst="artifacts"
mkdir -p "$dst"
cp -r "$src"/* "$dst/"
rm -rf "$dst/runtimes"
cd "$dst" && zip -r ../android-dll.zip . && cd ..
- name: Upload Android DLL
uses: actions/upload-artifact@v4
with:
name: android-dll.zip
path: android-dll.zip