2022-07-30 12:24:03 -04:00
name : Build Binaries
on :
workflow_dispatch :
2024-02-11 13:58:46 -05:00
inputs :
build-debug-info :
description : 'Profile and debug the build process'
required : false
default : false
type : boolean
use-ccache :
description : 'Enable ccache/sccache'
required : false
default : true
type : boolean
2023-11-21 12:25:47 -05:00
pull_request :
2022-07-30 12:24:03 -04:00
push :
2022-10-23 07:56:16 -04:00
branches :
2022-07-30 12:24:03 -04:00
- '**' # every branch
- '!no-build-**' # unless marked as no-build
2024-06-24 15:14:26 -04:00
env :
CPM_SOURCE_CACHE : ${{ github.workspace }}/cpm-cache
base-configure-command : >-
cmake -B build
-DCMAKE_BUILD_TYPE=RelWithDebInfo
-DGEODE_CODEGEN_CMAKE_ARGS="-DCMAKE_C_COMPILER=clang;-DCMAKE_CXX_COMPILER=clang++;-G Ninja"
-G Ninja
base-build-command : |
cmake --build build --config RelWithDebInfo --parallel
rm bin/nightly/resources/.geode_cache
2022-07-30 12:24:03 -04:00
2024-06-24 15:14:26 -04:00
jobs :
build-windows :
name : Build Windows
runs-on : ubuntu-24.04
2024-02-11 13:58:46 -05:00
2022-07-30 12:24:03 -04:00
steps :
2023-08-02 17:56:07 -04:00
- name : Checkout
2024-02-11 13:58:46 -05:00
uses : actions/checkout@v4
2022-08-02 06:04:11 -04:00
with :
submodules : recursive
2022-07-30 12:24:03 -04:00
2024-02-11 13:58:46 -05:00
- name : Prepare for Build Debug Info
2024-06-24 15:14:26 -04:00
id : build-debug-info
uses : ./.github/actions/build-debug-info
with :
has-sccache : ${{ inputs.use-ccache }}
2024-02-11 13:58:46 -05:00
if : inputs.build-debug-info
2024-06-24 15:14:26 -04:00
- name : Setup caches
uses : ./.github/actions/setup-cache
2024-02-13 14:59:32 -05:00
with :
2024-06-24 15:14:26 -04:00
host : linux
target : win
use-ccache : ${{ github.event_name != 'workflow_dispatch' || inputs.use-ccache }}
2024-02-13 14:59:32 -05:00
2024-06-24 15:14:26 -04:00
- name : Setup Ninja
uses : ./.github/actions/setup-ninja
2023-08-01 16:48:51 -04:00
with :
2024-06-24 15:14:26 -04:00
host : linux
2023-08-01 15:19:23 -04:00
2024-06-24 15:14:26 -04:00
- name : Setup CLI
uses : ./.github/actions/setup-cli
2023-10-15 12:37:34 -04:00
with :
2024-06-24 15:14:26 -04:00
host : linux
2024-06-24 11:09:47 -04:00
- name : Download xwin
uses : robinraju/release-downloader@v1.10
with :
repository : Jake-Shadle/xwin
latest : true
fileName : 'xwin-*-x86_64-unknown-linux-musl.tar.gz'
tarBall : false
zipBall : false
out-file-path : "epic-xwin"
2023-10-15 12:37:34 -04:00
2024-06-24 11:09:47 -04:00
- name : Prepare xwin
2024-06-07 06:22:12 -04:00
run : |
2024-06-24 11:09:47 -04:00
tar -xzf epic-xwin/xwin-*-x86_64-unknown-linux-musl.tar.gz -C epic-xwin
mv epic-xwin/xwin-*-x86_64-unknown-linux-musl/xwin ./xwin
./xwin --arch x86_64 --sdk-version 10.0.22621 --accept-license list
# this caches '.xwin-cache/**/*' but that's actually only gonna
# contain the manifest cuz we only ran `xwin list` so far
- name : Setup xwin Cache
id : xwin-cache
uses : actions/cache@v4
with :
path : .xwin-cache
2024-06-24 15:14:26 -04:00
key : xwin-win-v1-${{ hashFiles('.xwin-cache/**/*') }}
2024-06-24 11:09:47 -04:00
- name : Download Windows headers
run : ./xwin --arch x86_64 --sdk-version 10.0.22621 --accept-license splat --include-debug-libs
2024-06-24 15:14:26 -04:00
if : steps.xwin-cache.outputs.cache-hit != 'true'
2024-06-24 11:09:47 -04:00
- name : Download clang-msvc-sdk toolchain
uses : actions/checkout@v4
with :
repository : 'geode-sdk/clang-msvc-sdk'
path : toolchain
submodules : recursive
2024-06-07 05:09:35 -04:00
2024-06-24 15:14:26 -04:00
- name : Configure
run : ${{ env.base-configure-command }} -DCMAKE_TOOLCHAIN_FILE=$TOOLCHAIN ${{ steps.build-debug-info.outputs.extra-configure }}
env :
SPLAT_DIR : ${{ github.workspace }}/.xwin-cache/splat
TOOLCHAIN : ${{ github.workspace }}/toolchain/clang-cl-msvc.cmake
HOST_ARCH : x86_64
2023-07-31 10:49:54 -04:00
2024-06-24 15:14:26 -04:00
- name : Build
2022-10-14 14:22:51 -04:00
run : |
2024-06-24 15:14:26 -04:00
${{ env.base-build-command }}
${{ steps.build-debug-info.outputs.extra-build }}
2023-10-15 12:37:34 -04:00
2024-06-24 15:14:26 -04:00
- name : Upload Artifacts
uses : actions/upload-artifact@v4
with :
name : geode-win
path : ./bin/nightly
2024-06-24 11:09:47 -04:00
2024-06-24 15:14:26 -04:00
- name : Package Installer
2024-05-16 07:22:41 -04:00
run : |
2024-06-24 15:14:26 -04:00
sudo apt install nsis
makensis -WX -V3 ./installer/windows/installer.nsi
- name : Upload Installer
uses : actions/upload-artifact@v4
with :
name : geode-installer-win
2024-06-25 08:00:16 -04:00
path : './installer/windows/geode-installer-win.exe'
2024-06-24 15:14:26 -04:00
- name : Complete Build Debug Info
uses : ./.github/actions/build-debug-info-post
with :
target : win
if : inputs.build-debug-info && (success() || failure())
2024-02-02 18:29:22 -05:00
2024-06-24 15:14:26 -04:00
build-mac :
name : Build macOS
runs-on : macos-latest
steps :
- name : Checkout
2024-02-11 13:58:46 -05:00
uses : actions/checkout@v4
with :
submodules : recursive
2024-06-24 15:14:26 -04:00
- name : Prepare for Build Debug Info
id : build-debug-info
uses : ./.github/actions/build-debug-info
with :
has-sccache : ${{ inputs.use-ccache }}
2024-02-11 13:58:46 -05:00
if : inputs.build-debug-info
2024-06-24 15:14:26 -04:00
- name : Setup caches
uses : ./.github/actions/setup-cache
with :
host : mac
target : mac
use-ccache : ${{ github.event_name != 'workflow_dispatch' || inputs.use-ccache }}
2024-06-24 11:09:47 -04:00
2024-06-24 15:14:26 -04:00
- name : Setup Ninja
uses : ./.github/actions/setup-ninja
with :
host : mac
2024-06-24 11:09:47 -04:00
2024-06-24 15:14:26 -04:00
- name : Install LLVM
run : |
brew install llvm
echo "/opt/homebrew/opt/llvm/bin" >> $GITHUB_PATH
2024-06-24 11:09:47 -04:00
2024-06-24 15:14:26 -04:00
- name : Setup CLI
uses : ./.github/actions/setup-cli
with :
host : mac
2024-02-13 14:59:32 -05:00
2024-06-24 15:14:26 -04:00
- name : Configure
run : >
${{ env.base-configure-command }}
-DCMAKE_C_COMPILER=clang
-DCMAKE_CXX_COMPILER=clang++
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.15
-DCMAKE_AR='/usr/bin/ar'
-DCMAKE_RANLIB='/usr/bin/ranlib'
-DGEODE_DISABLE_PRECOMPILED_HEADERS=Off
${{ steps.build-debug-info.outputs.extra-configure }}
2022-10-23 08:23:55 -04:00
2022-07-30 12:24:03 -04:00
- name : Build
run : |
2024-06-24 15:14:26 -04:00
${{ env.base-build-command }}
${{ steps.build-debug-info.outputs.extra-build }}
2024-02-02 18:53:12 -05:00
2022-07-30 12:24:03 -04:00
- name : Upload Artifacts
2024-02-11 13:58:46 -05:00
uses : actions/upload-artifact@v4
2022-07-30 12:24:03 -04:00
with :
2024-06-24 15:14:26 -04:00
name : geode-mac
2023-08-01 14:57:01 -04:00
path : ./bin/nightly
2023-07-31 10:49:54 -04:00
2023-08-02 06:53:50 -04:00
- name : Package Installer
2024-06-24 15:14:26 -04:00
run : ./installer/mac/package.sh ./bin/nightly ./installer/mac/geode-installer-mac.pkg
2023-07-31 10:49:54 -04:00
2023-08-02 06:53:50 -04:00
- name : Upload Installer
2024-02-11 13:58:46 -05:00
uses : actions/upload-artifact@v4
2023-07-31 10:49:54 -04:00
with :
2024-06-24 15:14:26 -04:00
name : geode-installer-mac
path : './installer/mac/geode-installer-mac.pkg'
2023-07-31 10:49:54 -04:00
2024-06-24 15:14:26 -04:00
- name : Complete Build Debug Info
uses : ./.github/actions/build-debug-info-post
with :
target : mac
if : inputs.build-debug-info && (success() || failure())
build-android :
strategy :
fail-fast : false
matrix :
config :
- name : Android (32-bit)
id : android32
extra-configure : -DANDROID_ABI=armeabi-v7a
- name : Android (64-bit)
id : android64
extra-configure : -DANDROID_ABI=arm64-v8a
name : Build ${{ matrix.config.name }}
runs-on : ubuntu-latest
steps :
- name : Checkout
uses : actions/checkout@v4
with :
submodules : recursive
- name : Prepare for Build Debug Info
id : build-debug-info
uses : ./.github/actions/build-debug-info
with :
has-sccache : ${{ inputs.use-ccache }}
2024-02-11 13:58:46 -05:00
if : inputs.build-debug-info
2024-06-24 15:14:26 -04:00
- name : Setup caches
uses : ./.github/actions/setup-cache
2024-02-11 13:58:46 -05:00
with :
2024-06-24 15:14:26 -04:00
host : linux
target : ${{ matrix.config.id }}
use-ccache : ${{ github.event_name != 'workflow_dispatch' || inputs.use-ccache }}
- name : Setup Ninja
uses : ./.github/actions/setup-ninja
with :
host : linux
- name : Setup CLI
uses : ./.github/actions/setup-cli
with :
host : linux
- name : Setup Breakpad Tools
uses : ./.github/actions/setup-dump-sym
id : breakpad-tools
- name : Fix Ubuntu libcstd++
run : |
sudo apt install ninja-build &&
sudo add-apt-repository ppa:ubuntu-toolchain-r/test &&
sudo apt-get update &&
sudo apt-get install --only-upgrade libstdc++6
2024-02-11 13:58:46 -05:00
2024-06-24 15:14:26 -04:00
- name : Configure
run : >
${{ env.base-configure-command }}
-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_LATEST_HOME/build/cmake/android.toolchain.cmake
-DCMAKE_C_COMPILER=clang
-DCMAKE_CXX_COMPILER=clang++
-DANDROID_PLATFORM=android-23
-DANDROID_STL=c++_shared
${{ matrix.config.extra-configure }}
${{ steps.build-debug-info.outputs.extra-configure }}
- name : Build
run : |
${{ env.base-build-command }}
${{ steps.build-debug-info.outputs.extra-build }}
# hardcoding toolchain path :(
- name : Dump Symbols
run : |
${{ steps.breakpad-tools.outputs.binary-path }} ./bin/nightly/Geode.${{ matrix.config.id }}.so -o ./bin/nightly/Geode.${{ matrix.config.id }}.so.sym
$ANDROID_NDK_LATEST_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip ./bin/nightly/Geode.${{ matrix.config.id }}.so
- name : Upload Artifacts
2024-02-11 13:58:46 -05:00
uses : actions/upload-artifact@v4
with :
2024-06-24 15:14:26 -04:00
name : geode-${{ matrix.config.id }}
path : ./bin/nightly
- name : Complete Build Debug Info
uses : ./.github/actions/build-debug-info-post
with :
target : ${{ matrix.config.id }}
2024-02-13 14:59:32 -05:00
if : inputs.build-debug-info && (success() || failure())
2024-02-11 13:58:46 -05:00
2022-07-30 12:24:03 -04:00
publish :
2023-08-03 20:29:17 -04:00
name : Publish
2022-07-30 12:24:03 -04:00
runs-on : ubuntu-latest
2024-06-24 15:14:26 -04:00
needs : [ build-windows, build-mac, build-android ]
2022-10-23 07:56:16 -04:00
if : github.ref == 'refs/heads/main'
2022-07-30 12:24:03 -04:00
steps :
2023-08-02 17:56:07 -04:00
- name : Checkout
2024-02-11 13:58:46 -05:00
uses : actions/checkout@v4
2023-08-01 14:57:01 -04:00
2023-08-02 06:53:50 -04:00
- name : Declare Version Variables
2023-08-01 14:57:01 -04:00
id : ref
2023-08-01 11:51:41 -04:00
run : |
2024-02-11 13:58:46 -05:00
echo "version=$(cat VERSION | xargs)" >> $GITHUB_OUTPUT
2023-08-01 14:57:01 -04:00
echo "hash=$(git rev-parse --short "$GITHUB_SHA")" >> $GITHUB_OUTPUT
2022-07-30 12:24:03 -04:00
2023-08-02 06:53:50 -04:00
- name : Download Artifacts
2024-02-11 13:58:46 -05:00
uses : actions/download-artifact@v4
2023-08-01 14:57:01 -04:00
2023-08-03 20:21:28 -04:00
- name : Move Installers
2023-08-01 11:08:17 -04:00
run : |
2024-01-21 12:48:57 -05:00
mv geode-installer-mac/geode-installer-mac.pkg geode-installer-${{ steps.ref.outputs.hash }}-mac.pkg
2023-08-01 14:57:01 -04:00
mv geode-installer-win/geode-installer-win.exe geode-installer-${{ steps.ref.outputs.hash }}-win.exe
2022-07-30 12:24:03 -04:00
2024-01-21 12:21:23 -05:00
- name : Zip MacOS Artifacts
2024-06-24 11:09:47 -04:00
uses : vimtor/action-zip@v1.2
2024-01-21 12:21:23 -05:00
with :
files : geode-mac/Geode.dylib geode-mac/GeodeBootstrapper.dylib
dest : geode-${{ steps.ref.outputs.hash }}-mac.zip
2022-07-30 12:24:03 -04:00
2023-08-02 06:53:50 -04:00
- name : Zip Windows Artifacts
2024-06-24 11:09:47 -04:00
uses : vimtor/action-zip@v1.2
2022-07-30 12:24:03 -04:00
with :
2024-06-25 08:00:16 -04:00
files : geode-win/XInput1_4.dll geode-win/Geode.dll geode-win/GeodeUpdater.exe geode-win/Geode.lib geode-win/Geode.pdb
2023-08-01 14:57:01 -04:00
dest : geode-${{ steps.ref.outputs.hash }}-win.zip
2024-01-01 16:58:25 -05:00
- name : Zip Android32 Artifacts
2024-06-24 11:09:47 -04:00
uses : vimtor/action-zip@v1.2
2023-10-15 12:37:34 -04:00
with :
2024-02-02 18:38:16 -05:00
files : geode-android32/Geode.android32.so geode-android32/Geode.android32.so.sym
2024-01-01 07:24:51 -05:00
dest : geode-${{ steps.ref.outputs.hash }}-android32.zip
2023-10-15 12:37:34 -04:00
2024-01-01 16:58:25 -05:00
- name : Zip Android64 Artifacts
2024-06-24 11:09:47 -04:00
uses : vimtor/action-zip@v1.2
2024-01-01 16:58:25 -05:00
with :
2024-02-02 18:38:16 -05:00
files : geode-android64/Geode.android64.so geode-android64/Geode.android64.so.sym
2024-01-01 16:58:25 -05:00
dest : geode-${{ steps.ref.outputs.hash }}-android64.zip
2023-09-16 07:19:31 -04:00
- name : Zip Resources
2024-06-24 11:09:47 -04:00
uses : vimtor/action-zip@v1.2
2023-08-05 15:16:35 -04:00
with :
2024-01-19 11:46:33 -05:00
files : geode-android64/resources
2023-09-16 07:09:05 -04:00
dest : resources.zip
2023-08-03 20:21:28 -04:00
2023-09-16 07:19:31 -04:00
- name : Update Development Release
2023-08-01 11:08:17 -04:00
uses : andelf/nightly-release@main
env :
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
2022-07-30 12:24:03 -04:00
with :
2023-08-01 11:08:17 -04:00
tag_name : nightly
2023-08-03 20:34:27 -04:00
name : 'Development Release'
2023-08-01 11:08:17 -04:00
body : |
2023-08-03 20:34:27 -04: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 11:08:17 -04:00
files : |
2023-08-01 14:57:01 -04:00
./geode-installer-${{ steps.ref.outputs.hash }}-win.exe
2024-01-21 12:21:23 -05:00
./geode-installer-${{ steps.ref.outputs.hash }}-mac.pkg
2023-08-03 20:21:28 -04:00
./geode-${{ steps.ref.outputs.hash }}-win.zip
2024-01-21 12:21:23 -05:00
./geode-${{ steps.ref.outputs.hash }}-mac.zip
2024-01-01 07:24:51 -05:00
./geode-${{ steps.ref.outputs.hash }}-android32.zip
2024-01-01 16:58:25 -05:00
./geode-${{ steps.ref.outputs.hash }}-android64.zip
2023-09-16 07:09:05 -04:00
./resources.zip