Skip to content

Commit db75a12

Browse files
committed
change to cmake build and try using forgejo
1 parent e7eefc9 commit db75a12

1 file changed

Lines changed: 28 additions & 17 deletions

File tree

.forgejo/workflows/build.yaml

Lines changed: 28 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ on:
1010

1111
env:
1212
MOD_ID: firee.object-workshop
13+
BUILD_CONFIG: RelWithDebInfo
1314

1415
jobs:
1516
build:
@@ -19,27 +20,22 @@ jobs:
1920
config:
2021
# - name: Windows
2122
# target: windows
22-
# artifact-name: geode-build-win
23-
# platform: windows
23+
# platform: win
2424
#
2525
# - name: macOS
2626
# target: macos
27-
# artifact-name: geode-build-mac
2827
# platform: macos
2928
#
3029
# - name: iOS
3130
# target: ios
32-
# artifact-name: geode-build-ios
3331
# platform: ios
3432
#
3533
# - name: Android32
3634
# target: android
37-
# artifact-name: geode-build-android32
3835
# platform: android32
3936

4037
- name: Android64
4138
target: android
42-
artifact-name: geode-build-android64
4339
platform: android64
4440

4541
name: ${{ matrix.config.name }}
@@ -65,27 +61,42 @@ jobs:
6561
6662
- name: Configure & Build
6763
run: |
68-
# TODO: change this to use cmake instead
69-
GEODE_BINDINGS_REPO_PATH=/workspace/bindings geode build -p ${{ matrix.config.platform }} --config RelWithDebInfo
70-
mkdir -p /workspace/out
71-
# windows is win
72-
cp build-android64/${{ env.MOD_ID }}.geode /workspace/out/
64+
CMAKE_EXTRA_ARGS=""
65+
if [ ${{ matrix.config.platform }} = "mac" ]; then
66+
CMAKE_EXTRA_ARGS="-DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 -DGEODE_DISABLE_PRECOMPILED_HEADERS=OFF"
67+
elif [ ${{ matrix.config.platform }} = "android32" ]; then
68+
CMAKE_EXTRA_ARGS="-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_ROOT/build/cmake/android.toolchain.cmake -DANDROID_STL=c++_shared -DANDROID_ABI=armeabi-v7a -DANDROID_PLATFORM=android-23"
69+
elif [ ${{ matrix.config.platform }} = "android64" ]; then
70+
CMAKE_EXTRA_ARGS="-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_ROOT/build/cmake/android.toolchain.cmake -DANDROID_STL=c++_shared -DANDROID_ABI=arm64-v8a -DANDROID_PLATFORM=android-23"
71+
elif [ ${{ matrix.config.platform }} = "ios" ]; then
72+
CMAKE_EXTRA_ARGS="-DCMAKE_SYSTEM_NAME=iOS -DGEODE_TARGET_PLATFORM=iOS -DGEODE_DISABLE_PRECOMPILED_HEADERS=OFF"
73+
elif [ ${{ matrix.config.platform }} = "win" ]; then
74+
CMAKE_EXTRA_ARGS="-DHOST_ARCH=x64 -DCMAKE_TOOLCHAIN_FILE=/root/.local/share/Geode/cross-tools/clang-msvc-sdk/clang-msvc.cmake -DSPLAT_DIR=/root/.local/share/Geode/cross-tools/splat"
75+
fi
76+
cmake -B build -DCMAKE_BUILD_TYPE=${{ env.BUILD_CONFIG }} -DGEODE_BINDINGS_REPO_PATH=/workspace/bindings -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DGEODE_CODEGEN_CMAKE_ARGS="-DCMAKE_C_COMPILER=clang;-DCMAKE_CXX_COMPILER=clang++;-G Ninja" -G Ninja $CMAKE_EXTRA_ARGS -DGEODE_DONT_INSTALL_MODS=ON
77+
cmake --build build --config ${{ env.BUILD_CONFIG }} --parallel
78+
79+
mkdir /workspace/out
7380
7481
- name: Upload artifact
75-
uses: actions/upload-artifact@v4
82+
uses: https://data.forgejo.org/forgejo/upload-artifact@v4
7683
with:
77-
name: ${{ matrix.config.artifact-name }}
78-
path: /workspace/out/
84+
name: "geode-build-${{ matrix.config.platform }}"
85+
path: |
86+
/workspace/out/*.geode
87+
/workspace/out/*.pdb
88+
/workspace/out/*.sym
89+
/workspace/out/*.dbg
90+
/workspace/out/*.dSYM
7991
8092
package:
8193
name: Package builds
8294
runs-on: codeberg-tiny-lazy
8395
needs: ['build']
8496

8597
steps:
86-
- uses: actions/download-artifact@v4
98+
- uses: https://data.forgejo.org/forgejo/download-artifact@v4
8799
with:
88-
merge-multiple: false
89100
path: ./artifacts
90101

91102
# TODO: Fix this so it gets latest via https://api.github.com/repos/geode-sdk/cli/releases/latest
@@ -136,7 +147,7 @@ jobs:
136147
cp -R ./artifacts/geode-build-mac/*.dSYM out/ || true
137148
cp -R ./artifacts/geode-build-ios/*.dSYM out/ || true
138149
139-
- uses: actions/upload-artifact@v4
150+
- uses: https://data.forgejo.org/forgejo/upload-artifact@v4
140151
with:
141152
name: Build Output
142153
path: ./out/

0 commit comments

Comments
 (0)