├── .github └── workflows │ └── test.yml ├── README.md ├── action.yml ├── combine └── action.yml └── examples └── multi-platform.yml /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | name: Test the action 2 | 3 | on: 4 | workflow_dispatch: 5 | push: 6 | branches: 7 | - '**' 8 | 9 | jobs: 10 | build: 11 | strategy: 12 | fail-fast: false 13 | matrix: 14 | config: 15 | - name: Windows 16 | os: windows-latest 17 | - name: macOS 18 | os: macos-latest 19 | - name: iOS 20 | os: macos-latest 21 | target: iOS 22 | - name: Android32 23 | os: ubuntu-latest 24 | target: Android32 25 | - name: Android64 26 | os: ubuntu-latest 27 | target: Android64 28 | 29 | name: ${{ matrix.config.name }} 30 | runs-on: ${{ matrix.config.os }} 31 | 32 | steps: 33 | - uses: actions/checkout@v4 34 | 35 | - uses: actions/checkout@v4 36 | with: 37 | repository: geode-sdk/textureldr 38 | path: textureldr 39 | 40 | - name: Build the mod 41 | uses: ./ 42 | with: 43 | build-config: RelWithDebInfo 44 | export-pdb: true 45 | bundle-pdb: true 46 | export-symbols: true 47 | path: textureldr 48 | combine: true 49 | target: ${{ matrix.config.target }} 50 | 51 | package: 52 | name: Package both builds 53 | runs-on: ubuntu-latest 54 | needs: ['build'] 55 | 56 | steps: 57 | - uses: actions/checkout@v4 58 | 59 | - uses: ./combine 60 | id: build 61 | 62 | - uses: actions/upload-artifact@v4 63 | with: 64 | name: Build Output 65 | path: ${{ steps.build.outputs.build-output }} 66 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # build-geode-mod 2 | An easy to use action to build a geode mod within github actions. 3 | 4 | This repository contains two actions, one for just building the mods, and another for combining builds for multiple platforms into a single .geode file. 5 | 6 | If you're just here to copy paste the action, look at the examples folder: \ 7 | https://github.com/geode-sdk/build-geode-mod/tree/main/examples 8 | 9 | # Usage 10 | ```yml 11 | - uses: geode-sdk/build-geode-mod@main 12 | with: 13 | # Which version of the SDK to use. 14 | # Set to 'nightly' for latest commit, 'latest' for latest release 15 | # Default: latest 16 | sdk: '' 17 | 18 | # Which CLI version to use. 19 | # Default: latest 20 | cli: '' 21 | 22 | # Extra arguments passed to CMake when configuring. Not required. 23 | configure-args: '' 24 | 25 | # Extra arguments passed to CMake when building. Not required. 26 | build-args: '' 27 | 28 | # Which build configuration to use. 29 | # Default: Release 30 | build-config: '' 31 | 32 | # Whether to export PDB files for Windows builds. Not required. 33 | # Default: false 34 | export-pdb: '' 35 | 36 | # Whether to bundle PDB files into the .geode package. Not required. 37 | # Requires SDK v4.2.0 and CLI v3.3.0 at minimum. 38 | # Default: false 39 | bundle-pdb: '' 40 | 41 | # Whether to export Breakpad symbols for Android builds. Not required. 42 | # Default: false 43 | export-symbols: '' 44 | 45 | # Path to the project which to build. Defaults to current directory. 46 | path: '' 47 | 48 | # Set this to true if you plan on merging .geode files later. See the README for more info. 49 | # Default: false 50 | combine: '' 51 | 52 | # Geode target to build for. Can be either "Win64", "MacOS", "Android32" or "Android64". 53 | # Defaults to what is appropriate for the current platform, so: 54 | # Defaults to Win64 on windows runners 55 | # Defaults to MacOS on macOS runners 56 | # Defaults to Android64 on linux runners 57 | target: '' 58 | 59 | # What repository to use for bindings. Must be in the format "user/repo". Not required. 60 | bindings: '' 61 | 62 | # Which commit/branch to use for bindings. Defaults to latest commit in main branch. Not required. 63 | bindings-ref: '' 64 | 65 | # The android min SDK version to target. Defaults to 23. Not required. 66 | android-min-sdk: '' 67 | 68 | # Whether to use Link Time Optimization, improving build size at the cost of build time. 69 | # Default: true 70 | use-lto: '' 71 | ``` 72 | 73 | # Examples 74 | 75 | ## Building and uploading a mod on latest sdk 76 | ```yml 77 | - uses: geode-sdk/build-geode-mod@main 78 | id: build 79 | 80 | - uses: actions/upload-artifact@v3 81 | with: 82 | name: My mod 83 | path: ${{ steps.build.outputs.build-output }} 84 | ``` 85 | 86 | ## Building with RelWithDebInfo 87 | ```yml 88 | - uses: geode-sdk/build-geode-mod@main 89 | id: build 90 | with: 91 | build-config: RelWithDebInfo 92 | # Export the pdb alongside the .geode file 93 | export-pdb: true 94 | # Bundle the pdb inside the .geode file 95 | # Be warned, they can be quite big 96 | bundle-pdb: true 97 | ``` 98 | 99 | # Combine 100 | It is also possible to build mods for different platforms, and then afterwards combine them into a single .geode file. 101 | 102 | Usually this is done using a matrix, and due to limitations on how much actions can do, you will have to add another job for the combining. 103 | 104 | To do this, make sure to set `combine: true` on the build action! 105 | 106 | ## Building a mod on mac, ios, android armv7 and armv8, windows, and then combining it 107 | Full workflow: \ 108 | https://github.com/geode-sdk/build-geode-mod/blob/main/examples/multi-platform.yml 109 | -------------------------------------------------------------------------------- /action.yml: -------------------------------------------------------------------------------- 1 | name: Build Geode mod 2 | description: Builds a Geode mod 3 | 4 | inputs: 5 | sdk: 6 | description: Which version of the SDK to use, defaults to latest release. Set to 'given' to use the version specified in mod.json, 'nightly' for latest commit, 'latest' for latest release 7 | required: false 8 | default: given 9 | cli: 10 | description: Which CLI version to use, defaults to latest release. 11 | required: false 12 | default: latest 13 | configure-args: 14 | description: Extra arguments passed to CMake when configuring. 15 | required: false 16 | default: "" 17 | build-args: 18 | description: Extra arguments passed to CMake when building. 19 | required: false 20 | default: "" 21 | build-config: 22 | description: Which build configuration to use. Defaults to Release 23 | required: false 24 | default: Release 25 | path: 26 | description: Path to the project which to build. Defaults to current directory. 27 | required: false 28 | default: ./ 29 | combine: 30 | description: Set this to true if you plan on merging .geode files later. See the README for more info. 31 | required: false 32 | default: false 33 | target: 34 | description: Geode target to build for. Can be either "Win64", "MacOS", "iOS", "Android32" or "Android64". 35 | required: false 36 | default: "" 37 | bindings: 38 | description: What repository to use for bindings. Must be in the format "user/repo" 39 | required: false 40 | default: "geode-sdk/bindings" 41 | bindings-ref: 42 | description: Which commit/branch to use for bindings. Defaults to latest commit in main branch 43 | required: false 44 | default: "" 45 | android-min-sdk: 46 | description: The android min SDK version to target. Defaults to 23 47 | required: false 48 | default: 23 49 | ccache-variant: 50 | description: The ccache variant to use (empty, ccache or sccache). Defaults to sccache 51 | required: false 52 | default: sccache 53 | use-cpm-cache: 54 | description: Whether to cache CPM sources. Defaults to true 55 | required: false 56 | default: true 57 | export-pdb: 58 | description: Whether to export PDB files for Windows builds. Defaults to false 59 | required: false 60 | default: false 61 | use-lto: 62 | description: Whether to use LTO (Link Time Optimization) via the CMAKE_INTERPROCEDURAL_OPTIMIZATION flag, improving build size. Defaults to true 63 | required: false 64 | default: true 65 | bundle-pdb: 66 | description: Whether to bundle PDB files into the .geode package. Requires SDK v4.2.0 and CLI v3.3.0 at minimum. Defaults to false 67 | required: false 68 | default: false 69 | export-symbols: 70 | description: Whether to export Breakpad symbols for Android builds. Defaults to false 71 | required: false 72 | default: false 73 | 74 | outputs: 75 | build-output: 76 | description: A folder containing the built .geode file(s) 77 | value: ${{ steps.build.outputs.output }} 78 | 79 | runs: 80 | using: composite 81 | steps: 82 | - name: Detect platform 83 | id: platform 84 | shell: bash 85 | run: | 86 | DEFAULT_TARGET=Win64 87 | if [ "$RUNNER_OS" = "Linux" ]; then 88 | ID=linux 89 | DEFAULT_TARGET=Android64 90 | elif [ "$RUNNER_OS" = "Windows" ]; then 91 | ID=win 92 | DEFAULT_TARGET=Win64 93 | elif [ "$RUNNER_OS" = "macOS" ]; then 94 | ID=mac 95 | DEFAULT_TARGET=MacOS 96 | fi 97 | 98 | TARGET=${{ inputs.target }} 99 | if [ "$TARGET" = "" ]; then 100 | TARGET=$DEFAULT_TARGET 101 | fi 102 | 103 | if [ "$TARGET" = "Android32" ]; then 104 | OUTPUT_ID=android32 105 | elif [ "$TARGET" = "Android64" ]; then 106 | OUTPUT_ID=android64 107 | elif [ "$TARGET" = "Win64" ]; then 108 | OUTPUT_ID=win 109 | elif [ "$TARGET" = "MacOS" ]; then 110 | OUTPUT_ID=mac 111 | elif [ "$TARGET" = "iOS" ]; then 112 | OUTPUT_ID=ios 113 | fi 114 | 115 | echo "id=$ID" >> $GITHUB_OUTPUT 116 | echo "target=$TARGET" >> $GITHUB_OUTPUT 117 | echo "target_id=$OUTPUT_ID" >> $GITHUB_OUTPUT 118 | 119 | # https://github.com/mozilla/sccache/issues/2090 120 | - name: Download custom sccache 121 | uses: robinraju/release-downloader@v1.9 122 | with: 123 | repository: cgytrus/sccache 124 | latest: true 125 | fileName: 'sccache-*-x86_64-apple-darwin.zip' 126 | tarBall: false 127 | zipBall: false 128 | out-file-path: "epic-sccache" 129 | if: steps.platform.outputs.id == 'mac' && inputs.ccache-variant != '' 130 | 131 | - name: Setup custom sccache 132 | if: steps.platform.outputs.id == 'mac' && inputs.ccache-variant != '' 133 | shell: bash 134 | run: | 135 | 7z x "epic-sccache/sccache-*-x86_64-apple-darwin.zip" -o"epic-sccache" 136 | echo "$GITHUB_WORKSPACE/epic-sccache" >> $GITHUB_PATH 137 | chmod +x "epic-sccache/sccache" 138 | echo "SCCACHE_CACHE_MULTIARCH=1" >> $GITHUB_ENV 139 | 140 | - name: Setup sccache 141 | uses: hendrikmuhs/ccache-action@v1 142 | with: 143 | variant: ${{ inputs.ccache-variant }} 144 | key: ${{ steps.platform.outputs.target_id }}-v1 145 | if: inputs.ccache-variant != '' 146 | 147 | - name: Setup CPM Cache 148 | uses: actions/cache@v4 149 | with: 150 | path: ${{ github.workspace }}/cpm-cache 151 | key: cpm-${{ steps.platform.outputs.target_id }}-v1-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }} 152 | restore-keys: | 153 | cpm-${{ steps.platform.outputs.target_id }}-v1- 154 | if: ${{ inputs.use-cpm-cache == 'true' }} 155 | 156 | - name: Install Ninja 157 | shell: bash 158 | run: | 159 | curl -L https://github.com/ninja-build/ninja/releases/latest/download/ninja-${{ steps.platform.outputs.id }}.zip -o ninja.zip 160 | 7z x ninja.zip -o"$GITHUB_WORKSPACE/ninja" 161 | echo "$GITHUB_WORKSPACE/ninja" >> $GITHUB_PATH 162 | 163 | - name: Install dump_syms 164 | if: inputs.export-symbols == 'true' && steps.platform.outputs.id == 'linux' && (steps.platform.outputs.target_id == 'android32' || steps.platform.outputs.target_id == 'android64') 165 | shell: bash 166 | run: | 167 | curl -L https://github.com/mozilla/dump_syms/releases/latest/download/dump_syms-x86_64-unknown-linux-gnu.tar.xz -o dump_syms.tar.xz 168 | xz -d dump_syms.tar.xz 169 | tar -xf dump_syms.tar 170 | echo "$GITHUB_WORKSPACE/dump_syms-x86_64-unknown-linux-gnu" >> $GITHUB_PATH 171 | 172 | # - name: Fix Ubuntu weirdness 173 | # shell: bash 174 | # run: | 175 | # sudo apt install ninja-build && 176 | # sudo add-apt-repository ppa:ubuntu-toolchain-r/test && 177 | # sudo apt-get update && 178 | # sudo apt-get install --only-upgrade libstdc++6 179 | # if: steps.platform.outputs.id == 'linux' && (steps.platform.outputs.target_id == 'android32' || steps.platform.outputs.target_id == 'android64') 180 | 181 | # - name: Update LLVM (Windows) 182 | # if: steps.platform.outputs.id == 'win' 183 | # shell: bash 184 | # run: | 185 | # curl -L https://github.com/llvm/llvm-project/releases/download/llvmorg-17.0.6/LLVM-17.0.6-win64.exe -o llvm-inst.exe 186 | # 7z x llvm-inst.exe -ollvm bin/clang.exe bin/clang++.exe bin/lld-link.exe bin/llvm-rc.exe bin/*.dll lib/clang/*/include/* 187 | # echo "$GITHUB_WORKSPACE/llvm/bin" >> $GITHUB_PATH 188 | 189 | # - name: Install LLVM (MacOS) 190 | # shell: bash 191 | # run: | 192 | # brew install llvm 193 | # echo "/opt/homebrew/opt/llvm/bin" >> $GITHUB_PATH 194 | # if: steps.platform.outputs.id == 'mac' 195 | 196 | - name: Download bindings repo 197 | if: inputs.bindings != 'geode-sdk/bindings' || inputs.bindings-ref != '' 198 | uses: actions/checkout@v4 199 | with: 200 | repository: ${{ inputs.bindings }} 201 | ref: ${{ inputs.bindings-ref }} 202 | path: bindings-repo 203 | 204 | - name: Setup bindings enviroment 205 | if: inputs.bindings != 'geode-sdk/bindings' || inputs.bindings-ref != '' 206 | shell: bash 207 | run: echo "GEODE_BINDINGS_REPO_PATH=$GITHUB_WORKSPACE/bindings-repo" >> $GITHUB_ENV 208 | 209 | - name: Setup CLI 210 | uses: geode-sdk/cli/.github/actions/setup@main 211 | with: 212 | version: ${{ inputs.cli }} 213 | 214 | - name: Setup Geode SDK 215 | shell: bash 216 | run: | 217 | export CLI_PROFILE="${{ github.workspace }}/cli-profile" 218 | # for windows 219 | mkdir -p "$CLI_PROFILE/geode/mods" 220 | # for mac 221 | mkdir -p "$CLI_PROFILE/Contents/geode/mods" 222 | geode profile add --name GithubActions "$CLI_PROFILE/GeometryDash.exe" win 223 | 224 | geode sdk install "${{ github.workspace }}/geode-sdk-clone" 225 | 226 | # silly github actions wont refresh the env 227 | export GEODE_SDK="${{ github.workspace }}/geode-sdk-clone" 228 | echo "GEODE_SDK=$GEODE_SDK" >> $GITHUB_ENV 229 | 230 | if [ "${{ inputs.sdk }}" == "nightly" ]; then 231 | geode sdk update nightly 232 | geode sdk install-binaries --platform ${{ steps.platform.outputs.target_id }} 233 | elif [ "${{ inputs.sdk }}" == "latest" ]; then 234 | geode sdk update stable 235 | geode sdk install-binaries --platform ${{ steps.platform.outputs.target_id }} 236 | elif [ "${{ inputs.sdk }}" == "given" ]; then 237 | export MOD_JSON_PATH=$(find . -name "mod.json" -not -path "./geode-sdk-clone/*" -print | sort -r | head -n 1) 238 | export TARGET_GEODE_VERSION=$(jq -r '.geode' $MOD_JSON_PATH) 239 | echo "Updating to version $TARGET_GEODE_VERSION from $MOD_JSON_PATH" 240 | geode sdk update "$TARGET_GEODE_VERSION" 241 | geode sdk install-binaries --platform ${{ steps.platform.outputs.target_id }} --version "$TARGET_GEODE_VERSION" 242 | else 243 | geode sdk update ${{ inputs.sdk }} 244 | geode sdk install-binaries --platform ${{ steps.platform.outputs.target_id }} 245 | fi 246 | 247 | export CPM_CACHE="${{ github.workspace }}/cpm-cache" 248 | echo "CPM_SOURCE_CACHE=$CPM_CACHE" >> $GITHUB_ENV 249 | 250 | - name: Run CMake and build 251 | id: build 252 | shell: bash 253 | run: | 254 | mkdir -p $HOME/.cache 255 | 256 | cd "${{ inputs.path }}" 257 | CMAKE_EXTRA_ARGS="" 258 | if [ ${{ steps.platform.outputs.target_id }} = "mac" ]; then 259 | CMAKE_EXTRA_ARGS="-DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 -DGEODE_DISABLE_PRECOMPILED_HEADERS=OFF -DCMAKE_AR='/usr/bin/ar' -DCMAKE_RANLIB='/usr/bin/ranlib'" 260 | elif [ ${{ steps.platform.outputs.target_id }} = "android32" ]; then 261 | CMAKE_EXTRA_ARGS="-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_LATEST_HOME/build/cmake/android.toolchain.cmake -DANDROID_STL=c++_shared -DANDROID_ABI=armeabi-v7a -DANDROID_PLATFORM=android-${{ inputs.android-min-sdk }}" 262 | elif [ ${{ steps.platform.outputs.target_id }} = "android64" ]; then 263 | CMAKE_EXTRA_ARGS="-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_LATEST_HOME/build/cmake/android.toolchain.cmake -DANDROID_STL=c++_shared -DANDROID_ABI=arm64-v8a -DANDROID_PLATFORM=android-${{ inputs.android-min-sdk }}" 264 | elif [ ${{ steps.platform.outputs.target_id }} = "ios" ]; then 265 | CMAKE_EXTRA_ARGS="-DCMAKE_SYSTEM_NAME=iOS -DGEODE_TARGET_PLATFORM=iOS -DGEODE_DISABLE_PRECOMPILED_HEADERS=OFF" 266 | fi 267 | if [ "${{ inputs.use-lto }}" = "true" ]; then 268 | CMAKE_EXTRA_ARGS="$CMAKE_EXTRA_ARGS -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON" 269 | fi 270 | if [ "${{ inputs.bundle-pdb }}" = "true" ] && [ ${{ steps.platform.outputs.id }} = "win" ]; then 271 | CMAKE_EXTRA_ARGS="$CMAKE_EXTRA_ARGS -DGEODE_BUNDLE_PDB=ON" 272 | fi 273 | cmake -B build -DCMAKE_BUILD_TYPE=${{ inputs.build-config }} -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 -DGEODE_TARGET_PLATFORM=${{ steps.platform.outputs.target }} ${{ inputs.configure-args }} 274 | cmake --build build --config ${{ inputs.build-config }} ${{ inputs.build-args }} 275 | 276 | mkdir "${{ github.workspace }}/output" 277 | 278 | for file in $(find ./build -name *.geode); do 279 | cp $file "${{ github.workspace }}/output" 280 | if [ ${{ steps.platform.outputs.id }} = "linux" ] && [ "${{ inputs.export-symbols }}" = "true" ]; then 281 | if [ ${{ steps.platform.outputs.target_id }} = "android32" ] || [ ${{ steps.platform.outputs.target_id }} = "android64" ]; then 282 | SO_FILE_NAME="$(basename $file .geode).${{ steps.platform.outputs.target_id }}.so" 283 | if [ -f "./build/$SO_FILE_NAME" ]; then 284 | dump_syms ./build/$SO_FILE_NAME -o "${{ github.workspace }}/output/$SO_FILE_NAME.sym" 285 | fi 286 | fi 287 | fi 288 | done 289 | 290 | if [ ${{ steps.platform.outputs.id }} = "win" ]; then 291 | if [ "${{ inputs.export-pdb }}" = "true" ]; then 292 | for file in $(find ./build -name *.pdb); do 293 | cp $file "${{ github.workspace }}/output" 294 | done 295 | fi 296 | fi 297 | 298 | OUTPUT_DIR="${{ github.workspace }}/output" 299 | if [ ${{ steps.platform.outputs.id }} = "mac" ]; then 300 | OUTPUT_DIR=$(python3 -c 'import os, sys; print(os.path.realpath(sys.argv[1]))' "$OUTPUT_DIR") 301 | elif [ ${{ steps.platform.outputs.id }} = "win" ]; then 302 | OUTPUT_DIR=$(cygpath -wa "$OUTPUT_DIR") 303 | else 304 | OUTPUT_DIR=$(realpath "$OUTPUT_DIR") 305 | fi 306 | echo "output=$OUTPUT_DIR" >> $GITHUB_OUTPUT 307 | 308 | - name: Upload artifacts 309 | if: ${{ inputs.combine == 'true' }} 310 | uses: actions/upload-artifact@v4 311 | with: 312 | name: "geode-build-${{ steps.platform.outputs.target_id }}" 313 | path: | 314 | ${{ steps.build.outputs.output }}/*.geode 315 | ${{ steps.build.outputs.output }}/*.pdb 316 | ${{ steps.build.outputs.output }}/*.sym 317 | -------------------------------------------------------------------------------- /combine/action.yml: -------------------------------------------------------------------------------- 1 | name: Combine Geode mods 2 | description: Combines the same Geode mod built for different platforms into a single file 3 | 4 | inputs: 5 | cli: 6 | description: Which CLI version to use, defaults to latest release. 7 | required: false 8 | default: latest 9 | delete-artifacts: 10 | description: Whether to delete temporary artifacts left by the build action. 11 | required: false 12 | default: true 13 | 14 | outputs: 15 | build-output: 16 | description: A folder containing the built .geode file(s) 17 | value: ${{ steps.merge.outputs.output }} 18 | 19 | runs: 20 | using: composite 21 | steps: 22 | - name: Download CLI 23 | uses: robinraju/release-downloader@v1.10 24 | with: 25 | repository: geode-sdk/cli 26 | latest: ${{ inputs.cli == 'latest' }} 27 | tag: ${{ inputs.cli != 'latest' && inputs.cli || '' }} 28 | tarBall: false 29 | zipBall: false 30 | fileName: "*-linux.zip" 31 | extract: true 32 | out-file-path: ${{ github.action_path }} 33 | 34 | - run: echo "${{ github.action_path }}" >> $GITHUB_PATH 35 | shell: bash 36 | 37 | - uses: actions/download-artifact@v4 38 | with: 39 | path: "${{ github.action_path }}/artifacts" 40 | 41 | - name: Combine them 42 | shell: bash 43 | id: merge 44 | run: | 45 | cd "${{ github.action_path }}" 46 | chmod +x ./geode 47 | mkdir out 48 | MODS=$(find . -name *.geode -type f -printf "%f\n" | sort -u) 49 | for mod in $MODS; do 50 | echo "Merging $mod" 51 | PACKAGE_ARGS="" 52 | if [ -f "./artifacts/geode-build-win/$mod" ]; then 53 | PACKAGE_ARGS="$PACKAGE_ARGS ./artifacts/geode-build-win/$mod" 54 | fi 55 | if [ -f "./artifacts/geode-build-mac/$mod" ]; then 56 | PACKAGE_ARGS="$PACKAGE_ARGS ./artifacts/geode-build-mac/$mod" 57 | fi 58 | if [ -f "./artifacts/geode-build-android32/$mod" ]; then 59 | PACKAGE_ARGS="$PACKAGE_ARGS ./artifacts/geode-build-android32/$mod" 60 | fi 61 | if [ -f "./artifacts/geode-build-android64/$mod" ]; then 62 | PACKAGE_ARGS="$PACKAGE_ARGS ./artifacts/geode-build-android64/$mod" 63 | fi 64 | if [ -f "./artifacts/geode-build-ios/$mod" ]; then 65 | PACKAGE_ARGS="$PACKAGE_ARGS ./artifacts/geode-build-ios/$mod" 66 | fi 67 | ARG_LIST=($PACKAGE_ARGS) 68 | # why does it merge into the first one instead of just an output.. 69 | FIRST="${ARG_LIST[0]}" 70 | if [ ${#ARG_LIST[@]} != 1 ]; then 71 | geode package merge $PACKAGE_ARGS 72 | fi 73 | cp $FIRST out 74 | done 75 | # Copy the .pdb file from windows artifact if it exists 76 | cp ./artifacts/geode-build-win/*.pdb out/ || true 77 | # Copy the .sym files from android artifacts if they exist 78 | cp ./artifacts/geode-build-android32/*.sym out/ || true 79 | cp ./artifacts/geode-build-android64/*.sym out/ || true 80 | echo "output=$(realpath out)" >> $GITHUB_OUTPUT 81 | 82 | - uses: geekyeggo/delete-artifact@v5 83 | if: ${{ inputs.delete-artifacts }} 84 | with: 85 | name: geode-build-win 86 | failOnError: false 87 | 88 | - uses: geekyeggo/delete-artifact@v5 89 | if: ${{ inputs.delete-artifacts }} 90 | with: 91 | name: geode-build-mac 92 | failOnError: false 93 | 94 | - uses: geekyeggo/delete-artifact@v5 95 | if: ${{ inputs.delete-artifacts }} 96 | with: 97 | name: geode-build-ios 98 | failOnError: false 99 | 100 | - uses: geekyeggo/delete-artifact@v5 101 | if: ${{ inputs.delete-artifacts }} 102 | with: 103 | name: geode-build-android32 104 | failOnError: false 105 | 106 | - uses: geekyeggo/delete-artifact@v5 107 | if: ${{ inputs.delete-artifacts }} 108 | with: 109 | name: geode-build-android64 110 | failOnError: false 111 | -------------------------------------------------------------------------------- /examples/multi-platform.yml: -------------------------------------------------------------------------------- 1 | name: Build Geode Mod 2 | 3 | on: 4 | workflow_dispatch: 5 | push: 6 | branches: 7 | - "**" 8 | 9 | jobs: 10 | build: 11 | strategy: 12 | fail-fast: false 13 | matrix: 14 | config: 15 | - name: Windows 16 | os: windows-latest 17 | 18 | - name: macOS 19 | os: macos-latest 20 | 21 | - name: iOS 22 | os: macos-latest 23 | target: iOS 24 | 25 | - name: Android32 26 | os: ubuntu-latest 27 | target: Android32 28 | 29 | - name: Android64 30 | os: ubuntu-latest 31 | target: Android64 32 | 33 | name: ${{ matrix.config.name }} 34 | runs-on: ${{ matrix.config.os }} 35 | 36 | steps: 37 | - uses: actions/checkout@v4 38 | 39 | - name: Build the mod 40 | uses: geode-sdk/build-geode-mod@main 41 | with: 42 | combine: true 43 | target: ${{ matrix.config.target }} 44 | 45 | package: 46 | name: Package builds 47 | runs-on: ubuntu-latest 48 | needs: ['build'] 49 | 50 | steps: 51 | - uses: geode-sdk/build-geode-mod/combine@main 52 | id: build 53 | 54 | - uses: actions/upload-artifact@v4 55 | with: 56 | name: Build Output 57 | path: ${{ steps.build.outputs.build-output }} 58 | --------------------------------------------------------------------------------