chore: place the comment in a better place #107
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Geode Mod | |
on: | |
workflow_dispatch: | |
pull_request: | |
push: | |
env: | |
GEODE_SDK: ${{ github.workspace }}/sdk | |
CLI_VERSION: v2.4.0 | |
GEODE_VERSION: nightly | |
PREBUILT_PROTOBUF_VERSION: v21.12 | |
SDK_VERSION: v1.0.0-beta.18 | |
MOD_NAME: GDMP | |
MOD_ID: gay.rooot.gdmp | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
config: | |
- name: "Windows" | |
bin_folder: "windows" | |
os: windows-latest | |
extra_flags: '-T host=x64 -A win32 -DUSE_PREBUILT_PROTOBUF=1' | |
out_paths: './build/Release/*.dll' | |
platform_suffix: 'win' | |
- name: "macOS" | |
bin_folder: "macos" | |
os: macos-latest | |
extra_flags: "-DUSE_PREBUILT_PROTOBUF=1" | |
out_paths: './build/*.dylib' | |
platform_suffix: 'mac' | |
name: ${{ matrix.config.name }} | |
runs-on: ${{ matrix.config.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
repository: geode-sdk/geode | |
ref: ${{ env.SDK_VERSION }} | |
path: ${{ env.GEODE_SDK }} | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
ref: 'prebuilt-protobuf' | |
path: "prebuilt_protobuf" | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
repository: 'protocolbuffers/protobuf' | |
ref: ${{ env.PREBUILT_PROTOBUF_VERSION }} | |
path: "prebuilt_protobuf/src" | |
- uses: ilammy/msvc-dev-cmd@v1 | |
with: | |
arch: x86 | |
- name: Download Geode SDK binaries | |
run: | | |
cd ${{ github.workspace }}/sdk | |
mkdir bin | |
mkdir bin/nightly | |
cd bin/nightly | |
curl -L https://github.com/geode-sdk/geode/releases/download/${{ env.GEODE_VERSION }}/geode-${{ env.GEODE_VERSION }}-${{ matrix.config.platform_suffix }}.zip -o geode-sdk.zip | |
tar -xf geode-sdk.zip | |
- name: Configure CMake | |
run: | | |
cd ${{ github.workspace }} | |
cmake -B build ${{ matrix.config.extra_flags }} -DGEODE_DISABLE_CLI_CALLS=1 | |
- name: Build | |
run: | | |
cd ${{ github.workspace }}/build | |
cmake --build . --config Release -j 16 | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: "build-${{ matrix.config.bin_folder }}" | |
path: "${{ matrix.config.out_paths }}" | |
package: | |
name: "Package both builds" | |
runs-on: macos-latest | |
needs: [ 'build' ] | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Download and Unzip CLI | |
run: | | |
curl -L https://github.com/geode-sdk/cli/releases/download/${{ env.CLI_VERSION }}/geode-cli-${{ env.CLI_VERSION }}-mac.zip -o geode-cli.zip | |
unzip geode-cli.zip | |
chmod +x geode | |
- uses: actions/download-artifact@v3 | |
with: | |
name: build-windows | |
- uses: actions/download-artifact@v3 | |
with: | |
name: build-macos | |
- name: Merge | |
run: | | |
mv $MOD_NAME.dll $MOD_ID.dll | |
mv lib$MOD_NAME.dylib $MOD_ID.dylib | |
./geode package new . --binary $MOD_ID.dll --binary $MOD_ID.dylib --output $MOD_ID.geode | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: Build Output | |
path: "${{ env.MOD_ID }}.geode" | |
- uses: geekyeggo/delete-artifact@v2 | |
with: | |
name: build-windows | |
failOnError: false | |
- uses: geekyeggo/delete-artifact@v2 | |
with: | |
name: build-macos | |
failOnError: false |