2022-07-30 19:24:03 +03:00
name : Build Binaries
on :
workflow_dispatch :
2023-11-21 20:25:47 +03:00
pull_request :
2022-07-30 19:24:03 +03:00
push :
2022-10-23 14:56:16 +03:00
branches :
2022-07-30 19:24:03 +03:00
- '**' # every branch
- '!no-build-**' # unless marked as no-build
2023-08-01 22:19:23 +03:00
env :
2023-08-02 02:06:20 +03:00
GEODE_CI : ''
2023-08-02 00:11:04 +03:00
CCACHE_ACTION_CI : true
2023-08-01 22:19:23 +03:00
2022-07-30 19:24:03 +03:00
jobs :
build :
strategy :
fail-fast : false
matrix :
config :
2023-08-02 00:11:04 +03:00
- name : Windows
2023-08-01 21:57:01 +03:00
os : windows-latest
2023-08-02 13:55:26 +03:00
id : win
2023-10-15 13:37:34 -03:00
cli_id : win
2023-08-03 00:56:07 +03:00
extra_flags : -T host=x64 -A win32 -DCMAKE_BUILD_TYPE=RelWithDebInfo -DGEODE_DEBUG=On
# uncomment to use vs clang-cl and ninja
#extra_flags: >
# --no-warn-unused-cli
# "-DCMAKE_C_COMPILER:FILEPATH=$env:VCINSTALLDIR\Tools\Llvm\bin\clang-cl.exe"
# "-DCMAKE_CXX_COMPILER:FILEPATH=$env:VCINSTALLDIR\Tools\Llvm\bin\clang-cl.exe"
# -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DGEODE_DEBUG=On
2022-10-14 21:22:51 +03:00
cli_cmd : ''
2023-08-01 21:57:01 +03:00
package_cmd : 'makensis -WX -V3 ./installer/windows/installer.nsi'
2023-08-01 19:04:38 +03:00
installer_path : './installer/windows/geode-installer-win.exe'
2022-10-14 21:22:51 +03:00
2023-12-23 09:00:07 -03:00
# - name: macOS
# os: macos-latest
# id: mac
# cli_id: mac
# extra_flags: >
# -DCMAKE_C_COMPILER=clang
# -DCMAKE_CXX_COMPILER=clang++
# -DCMAKE_C_COMPILER_LAUNCHER=ccache
# -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
# -DCMAKE_BUILD_TYPE=RelWithDebInfo -DGEODE_DEBUG=On -DCMAKE_OSX_DEPLOYMENT_TARGET=10.13
# cli_cmd: 'chmod +x $GITHUB_WORKSPACE/cli/geode'
# package_cmd: './installer/mac/package.sh ./bin/nightly ./installer/mac/geode-installer-mac.pkg'
# installer_path: './installer/mac/geode-installer-mac.pkg'
2023-10-15 13:37:34 -03:00
- name : Android
os : ubuntu-latest
id : android
cli_id : linux
extra_flags : >
-DCMAKE_TOOLCHAIN_FILE=$NDK_HOME/build/cmake/android.toolchain.cmake
2023-10-15 14:08:20 -03:00
-DANDROID_ABI=armeabi-v7a
-DANDROID_PLATFORM=android-23
2023-10-15 13:37:34 -03:00
-DGEODE_DONT_BUILD_TEST_MODS=1
-G Ninja
cli_cmd : 'chmod +x $GITHUB_WORKSPACE/cli/geode'
package_cmd : ''
installer_path : ''
2023-07-31 17:49:54 +03:00
2023-08-27 19:17:02 +03:00
name : Build ${{ matrix.config.name }}
2022-07-30 19:24:03 +03:00
runs-on : ${{ matrix.config.os }}
steps :
2023-08-03 00:56:07 +03:00
- name : Checkout
uses : actions/checkout@v3
2022-08-02 13:04:11 +03:00
with :
submodules : recursive
2022-07-30 19:24:03 +03:00
2023-08-03 00:56:07 +03:00
- name : Setup ccache
uses : hendrikmuhs/ccache-action@v1
2023-08-01 23:48:51 +03:00
with :
key : ${{ matrix.config.os }}
2023-10-15 13:37:34 -03:00
if : matrix.config.id != 'win'
2023-08-01 22:19:23 +03:00
2023-08-03 00:56:07 +03:00
- name : Setup MSVC
uses : ilammy/msvc-dev-cmd@v1.12.1
2022-07-30 19:24:03 +03:00
with :
2023-08-02 02:14:34 +03:00
arch : amd64_x86
2023-08-02 13:55:26 +03:00
if : matrix.config.id == 'win'
2022-07-30 19:24:03 +03:00
2023-10-15 13:37:34 -03:00
- name : Setup NDK
uses : nttld/setup-ndk@v1
id : setup-ndk
with :
ndk-version : r26b
add-to-path : false
if : matrix.config.id == 'android'
2022-10-14 21:22:51 +03:00
- name : Download CLI
2023-08-01 22:44:47 +03:00
uses : robinraju/release-downloader@v1.8
2022-10-14 21:22:51 +03:00
with :
repository : geode-sdk/cli
latest : true
2023-10-15 13:37:34 -03:00
fileName : '*-${{ matrix.config.cli_id }}.zip'
2022-10-14 21:22:51 +03:00
tarBall : false
zipBall : false
2023-08-01 21:57:01 +03:00
out-file-path : "cli"
2023-07-31 17:49:54 +03:00
2023-08-01 21:57:01 +03:00
- name : Setup CLI
2022-10-14 21:22:51 +03:00
run : |
2023-10-15 13:37:34 -03:00
7z x "${{ github.workspace }}/cli/*-${{ matrix.config.cli_id }}.zip" -o"${{ github.workspace }}/cli"
2022-10-14 21:22:51 +03:00
${{ matrix.config.cli_cmd }}
echo "${{ github.workspace }}/cli" >> $GITHUB_PATH
2022-10-23 15:23:55 +03:00
2023-10-15 13:37:34 -03:00
- name : Setup Android Env
run : |
echo "NDK_HOME=${{ steps.setup-ndk.outputs.ndk-path }}" >> "$GITHUB_ENV"
sudo apt install ninja-build
if : matrix.config.id == 'android'
2023-08-03 00:56:07 +03:00
- name : Configure
2022-11-28 20:17:58 +02:00
run : >
2023-08-02 02:06:20 +03:00
cmake -B ${{ github.workspace }}/build
2023-08-01 21:57:01 +03:00
-DCLI_PATH="${{ github.workspace }}/cli"
2023-08-02 14:01:42 +03:00
${{ matrix.config.extra_flags }}
2022-10-23 15:23:55 +03:00
2022-07-30 19:24:03 +03:00
- name : Build
run : |
2023-08-02 00:11:04 +03:00
cd ${{ github.workspace }}/build
2022-11-28 20:24:30 +02:00
cmake --build . --config RelWithDebInfo --parallel
2023-08-03 01:04:49 +03:00
rm ${{ github.workspace }}/bin/nightly/resources/.geode_cache
2022-07-30 19:24:03 +03:00
- name : Upload Artifacts
2023-08-01 22:35:18 +03:00
uses : actions/upload-artifact@v3
2022-07-30 19:24:03 +03:00
with :
2023-08-02 13:55:26 +03:00
name : geode-${{ matrix.config.id }}
2023-08-01 21:57:01 +03:00
path : ./bin/nightly
2023-07-31 17:49:54 +03:00
2023-08-02 13:53:50 +03:00
- name : Package Installer
2023-08-01 21:57:01 +03:00
run : ${{ matrix.config.package_cmd }}
2023-10-15 13:37:34 -03:00
if : matrix.config.id != 'android'
2023-07-31 17:49:54 +03:00
2023-08-02 13:53:50 +03:00
- name : Upload Installer
2023-08-01 22:35:18 +03:00
uses : actions/upload-artifact@v3
2023-07-31 17:49:54 +03:00
with :
2023-08-02 13:55:26 +03:00
name : geode-installer-${{ matrix.config.id }}
2023-08-01 18:51:41 +03:00
path : ${{ matrix.config.installer_path }}
2023-10-15 13:37:34 -03:00
if : matrix.config.id != 'android'
2023-07-31 17:49:54 +03:00
2022-07-30 19:24:03 +03:00
publish :
2023-08-04 03:29:17 +03:00
name : Publish
2022-07-30 19:24:03 +03:00
runs-on : ubuntu-latest
needs : build
2022-10-23 14:56:16 +03:00
if : github.ref == 'refs/heads/main'
2022-07-30 19:24:03 +03:00
steps :
2023-08-03 00:56:07 +03:00
- name : Checkout
uses : actions/checkout@v3
2023-08-01 21:57:01 +03:00
2023-08-02 13:53:50 +03:00
- name : Declare Version Variables
2023-08-01 21:57:01 +03:00
id : ref
2023-06-10 16:06:29 +03:00
shell : bash
2023-08-01 18:51:41 +03:00
run : |
2023-08-01 21:57:01 +03:00
echo "version=$(cat ${{ github.workspace }}/VERSION | xargs)" >> $GITHUB_OUTPUT
echo "hash=$(git rev-parse --short "$GITHUB_SHA")" >> $GITHUB_OUTPUT
2022-07-30 19:24:03 +03:00
2023-08-02 13:53:50 +03:00
- name : Download Artifacts
2023-08-01 18:10:22 +03:00
uses : actions/download-artifact@v3
2022-07-30 19:24:03 +03:00
with :
path : ${{ github.workspace }}
2023-08-01 21:57:01 +03:00
2023-08-04 03:21:28 +03:00
- name : Move Installers
2023-08-01 18:08:17 +03:00
run : |
2023-12-23 11:52:43 -03:00
# mv geode-installer-mac/geode-installer-mac.pkg geode-installer-${{ steps.ref.outputs.hash }}-mac.pkg
2023-08-01 21:57:01 +03:00
mv geode-installer-win/geode-installer-win.exe geode-installer-${{ steps.ref.outputs.hash }}-win.exe
2022-07-30 19:24:03 +03:00
2023-12-23 11:52:43 -03:00
#- name: Zip MacOS Artifacts
# uses: vimtor/action-zip@v1.1
# with:
# files: geode-mac/Geode.dylib geode-mac/GeodeBootstrapper.dylib
# dest: geode-${{ steps.ref.outputs.hash }}-mac.zip
2022-07-30 19:24:03 +03:00
2023-08-02 13:53:50 +03:00
- name : Zip Windows Artifacts
2023-08-04 02:09:19 +03:00
uses : vimtor/action-zip@v1.1
2022-07-30 19:24:03 +03:00
with :
2023-08-21 19:31:06 -03:00
files : geode-win/XInput9_1_0.dll geode-win/Geode.dll geode-win/GeodeUpdater.exe geode-win/Geode.lib geode-win/Geode.pdb
2023-08-01 21:57:01 +03:00
dest : geode-${{ steps.ref.outputs.hash }}-win.zip
2023-10-15 13:37:34 -03:00
- name : Zip Android Artifacts
uses : vimtor/action-zip@v1.1
with :
2023-12-24 18:40:56 -03:00
files : geode-android/*.so
2023-10-15 13:37:34 -03:00
dest : geode-${{ steps.ref.outputs.hash }}-android.zip
2023-09-16 14:19:31 +03:00
- name : Zip Resources
2023-08-05 22:16:35 +03:00
uses : vimtor/action-zip@v1.1
with :
files : geode-mac/resources
2023-09-16 14:09:05 +03:00
dest : resources.zip
2023-08-04 03:21:28 +03:00
2023-09-16 14:19:31 +03:00
- name : Update Development Release
2023-08-01 18:08:17 +03:00
uses : andelf/nightly-release@main
env :
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
2022-07-30 19:24:03 +03:00
with :
2023-08-01 18:08:17 +03:00
tag_name : nightly
2023-08-04 03:34:27 +03:00
name : 'Development Release'
2023-08-01 18:08:17 +03:00
body : |
2023-08-04 03:34:27 +03:00
Geode development release for commit ${{ github.sha }}. Since this is not a regular release, Geode will not install the resources automatically, so you should use the installer if you want them.
2023-08-01 18:08:17 +03:00
files : |
2023-08-01 21:57:01 +03:00
./geode-installer-${{ steps.ref.outputs.hash }}-win.exe
2023-08-04 03:21:28 +03:00
./geode-${{ steps.ref.outputs.hash }}-win.zip
2023-10-15 13:37:34 -03:00
./geode-${{ steps.ref.outputs.hash }}-android.zip
2023-09-16 14:09:05 +03:00
./resources.zip
2023-12-23 11:52:43 -03:00
# TODO: add these back:
# ./geode-installer-${{ steps.ref.outputs.hash }}-mac.pkg
# ./geode-${{ steps.ref.outputs.hash }}-mac.zip
# or maybe just glob them in the future