|
1 | | -name: Build Geode Mod (Codeberg) |
2 | | - |
3 | | -# Thank you very much to https://github.com/altalk23/Allium |
| 1 | +name: Build Geode Mod |
4 | 2 |
|
5 | 3 | on: |
6 | 4 | workflow_dispatch: |
7 | 5 | push: |
8 | 6 | branches: |
9 | 7 | - "**" |
10 | 8 |
|
11 | | -env: |
12 | | - MOD_ID: firee.object-workshop |
13 | | - BUILD_CONFIG: RelWithDebInfo |
14 | | - |
15 | 9 | jobs: |
16 | 10 | build: |
17 | 11 | strategy: |
18 | 12 | fail-fast: false |
19 | 13 | matrix: |
20 | 14 | config: |
21 | 15 | - name: Windows |
22 | | - target: windows |
23 | | - platform: win |
| 16 | + image: windows |
| 17 | + target: Win64 |
24 | 18 |
|
25 | 19 | # - name: macOS |
26 | | - # target: macos |
27 | | - # platform: macos |
| 20 | + # image: macos |
| 21 | + # target: MacOS |
28 | 22 | # |
29 | 23 | # - name: iOS |
30 | | - # target: ios |
31 | | - # platform: ios |
| 24 | + # image: ios |
| 25 | + # target: iOS |
32 | 26 |
|
33 | 27 | - name: Android32 |
34 | | - target: android |
35 | | - platform: android32 |
| 28 | + image: android |
| 29 | + target: Android32 |
36 | 30 |
|
37 | 31 | - name: Android64 |
38 | | - target: android |
39 | | - platform: android64 |
| 32 | + image: android |
| 33 | + target: Android64 |
40 | 34 |
|
41 | 35 | name: ${{ matrix.config.name }} |
42 | 36 | runs-on: codeberg-medium |
43 | 37 | container: |
44 | | - image: prevter/geode-sdk:${{ matrix.config.target }}-latest |
| 38 | + image: prevter/geode-sdk:${{ matrix.config.image }}-latest |
45 | 39 |
|
46 | 40 | steps: |
47 | 41 | - name: Checkout repository |
48 | 42 | uses: actions/checkout@v4 |
49 | 43 |
|
50 | | - # rest is taken from Dockerfile |
51 | | - |
52 | | - - name: Install SDK & Binaries |
53 | | - run: | |
54 | | - geode sdk update 5.4.1 |
55 | | - # geode sdk install-binaries -p ${{ matrix.config.platform }} # commenting this out for now as codeberg is ratelimited by github |
56 | | - curl -L "https://github.com/geode-sdk/geode/releases/download/v5.4.1/geode-v5.4.1-${{ matrix.config.platform }}.zip" -o geode-v5.4.1-${{ matrix.config.platform }}.zip |
57 | | - mkdir -p $GEODE_SDK/bin |
58 | | - mkdir -p $GEODE_SDK/bin/5.4.1 |
59 | | - unzip -o geode-v5.4.1-${{ matrix.config.platform }}.zip -d $GEODE_SDK/bin/5.4.1 |
60 | | - git clone https://github.com/geode-sdk/bindings --depth=1 /workspace/bindings |
61 | | -
|
62 | | - - name: Configure & Build |
63 | | - run: | |
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 -G Ninja $CMAKE_EXTRA_ARGS -DGEODE_DONT_INSTALL_MODS=ON |
77 | | - cmake --build build --config ${{ env.BUILD_CONFIG }} --parallel |
78 | | -
|
79 | | - mkdir /workspace/out |
80 | | -
|
81 | | - for file in $(find ./build -name *.geode); do |
82 | | - cp $file "/workspace/out" |
83 | | - done |
84 | | -
|
85 | | - - name: Upload artifact |
86 | | - uses: https://code.forgejo.org/actions/upload-artifact@v3 |
| 44 | + - name: Build the mod |
| 45 | + uses: https://codeberg.org/geode-sdk/build-geode-mod@main |
87 | 46 | with: |
88 | | - name: "geode-build-${{ matrix.config.platform }}" |
89 | | - path: /workspace/out/ |
| 47 | + combine: true |
| 48 | + target: ${{ matrix.config.target }} |
90 | 49 |
|
91 | 50 | package: |
92 | 51 | name: Package builds |
93 | | - runs-on: codeberg-tiny-lazy # note for me: lazy basically means you dont care if it takes a while for the job to start (ref: https://codeberg.org/actions/meta) |
| 52 | + # '-lazy' means you don't care if it takes a while for the job to start (ref: https://codeberg.org/actions/meta) |
| 53 | + runs-on: codeberg-tiny-lazy |
94 | 54 | needs: ['build'] |
95 | 55 |
|
96 | 56 | steps: |
97 | | - - uses: https://code.forgejo.org/actions/download-artifact@v3 |
98 | | - with: |
99 | | - path: ./artifacts |
100 | | - |
101 | | - # TODO: Fix this so it gets latest via https://api.github.com/repos/geode-sdk/cli/releases/latest |
102 | | - - name: Download CLI |
103 | | - run: | |
104 | | - curl -L "https://github.com/geode-sdk/cli/releases/download/v3.7.4/geode-cli-v3.7.4-linux.zip" -o cli.zip |
105 | | - unzip cli.zip -d . |
106 | | - chmod +x ./geode |
107 | | - |
108 | | - - name: Merge Artifacts |
109 | | - run: | |
110 | | - mkdir -p out |
111 | | - MODS=$(find ./artifacts -name *.geode -type f -printf "%f\n" | sort -u) |
112 | | - for mod in $MODS; do |
113 | | - echo "Merging $mod" |
114 | | - PACKAGE_ARGS="" |
115 | | - if [ -f "./artifacts/geode-build-win/$mod" ]; then |
116 | | - PACKAGE_ARGS="$PACKAGE_ARGS ./artifacts/geode-build-win/$mod" |
117 | | - fi |
118 | | - if [ -f "./artifacts/geode-build-mac/$mod" ]; then |
119 | | - PACKAGE_ARGS="$PACKAGE_ARGS ./artifacts/geode-build-mac/$mod" |
120 | | - fi |
121 | | - if [ -f "./artifacts/geode-build-android32/$mod" ]; then |
122 | | - PACKAGE_ARGS="$PACKAGE_ARGS ./artifacts/geode-build-android32/$mod" |
123 | | - fi |
124 | | - if [ -f "./artifacts/geode-build-android64/$mod" ]; then |
125 | | - PACKAGE_ARGS="$PACKAGE_ARGS ./artifacts/geode-build-android64/$mod" |
126 | | - fi |
127 | | - if [ -f "./artifacts/geode-build-ios/$mod" ]; then |
128 | | - PACKAGE_ARGS="$PACKAGE_ARGS ./artifacts/geode-build-ios/$mod" |
129 | | - fi |
130 | | - ARG_LIST=($PACKAGE_ARGS) |
131 | | - # why does it merge into the first one instead of just an output.. |
132 | | - FIRST="${ARG_LIST[0]}" |
133 | | - if [ ${#ARG_LIST[@]} != 1 ]; then |
134 | | - ./geode package merge $PACKAGE_ARGS |
135 | | - fi |
136 | | - cp $FIRST out |
137 | | - done |
138 | | - # Copy the .pdb file from windows artifact if it exists |
139 | | - cp ./artifacts/geode-build-win/*.pdb out/ || true |
140 | | - # Copy the .sym files from android artifacts if they exist |
141 | | - cp ./artifacts/geode-build-android32/*.sym out/ || true |
142 | | - cp ./artifacts/geode-build-android64/*.sym out/ || true |
143 | | - # Copy the other debug files from android and macos/ios |
144 | | - cp ./artifacts/geode-build-android32/*.dbg out/ || true |
145 | | - cp ./artifacts/geode-build-android64/*.dbg out/ || true |
146 | | - cp -R ./artifacts/geode-build-mac/*.dSYM out/ || true |
147 | | - cp -R ./artifacts/geode-build-ios/*.dSYM out/ || true |
| 57 | + - uses: https://codeberg.org/geode-sdk/build-geode-mod/combine@main |
| 58 | + id: build |
148 | 59 |
|
149 | 60 | - uses: https://code.forgejo.org/forgejo/upload-artifact@v3 |
150 | 61 | with: |
151 | 62 | name: Build Output |
152 | | - path: ./out/ |
| 63 | + path: ${{ steps.build.outputs.build-output }} |
0 commit comments