2022-07-30 12:24:03 -04:00
|
|
|
name: Build Binaries
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
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
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
config:
|
|
|
|
- name: "Windows"
|
2022-10-23 07:56:16 -04:00
|
|
|
os_identifier: "win"
|
2022-07-30 12:24:03 -04:00
|
|
|
os: windows-2019
|
|
|
|
prefixes: ''
|
2023-03-06 12:34:47 -05:00
|
|
|
extra_flags: '-T host=x86 -A win32 -DGEODE_DEBUG=On'
|
2023-06-09 20:34:15 -04:00
|
|
|
out_paths: './bin/nightly/Geode.pdb ./bin/nightly/Geode.dll ./bin/nightly/GeodeUpdater.exe ./bin/nightly/Geode.lib ./bin/nightly/XInput9_1_0.dll'
|
2022-10-14 14:22:51 -04:00
|
|
|
cli_cmd: ''
|
2023-08-01 12:04:38 -04:00
|
|
|
installer_path: './installer/windows/geode-installer-win.exe'
|
2022-10-14 14:22:51 -04:00
|
|
|
|
2022-07-30 12:24:03 -04:00
|
|
|
- name: "macOS"
|
2022-10-23 07:56:16 -04:00
|
|
|
os_identifier: "mac"
|
2022-07-30 12:24:03 -04:00
|
|
|
os: macos-latest
|
|
|
|
prefixes: 'PATH="/usr/local/opt/ccache/libexec:$PATH"'
|
2023-01-28 04:19:16 -05:00
|
|
|
extra_flags: "-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Debug -DGEODE_DEBUG=On -DCMAKE_OSX_DEPLOYMENT_TARGET=10.13"
|
2022-10-23 08:23:55 -04:00
|
|
|
out_paths: './bin/nightly/Geode.dylib ./bin/nightly/GeodeBootstrapper.dylib ./loader/include/link/libfmod.dylib'
|
2022-10-14 14:22:51 -04:00
|
|
|
cli_cmd: 'chmod +x $GITHUB_WORKSPACE/cli/geode'
|
2023-08-01 12:04:38 -04:00
|
|
|
installer_path: './out/geode-installer-mac.pkg'
|
2023-07-31 10:49:54 -04:00
|
|
|
|
2022-07-30 12:24:03 -04:00
|
|
|
name: ${{ matrix.config.name }}
|
|
|
|
runs-on: ${{ matrix.config.os }}
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2022-08-02 06:04:11 -04:00
|
|
|
with:
|
|
|
|
submodules: recursive
|
2022-07-30 12:24:03 -04:00
|
|
|
|
|
|
|
- uses: ilammy/msvc-dev-cmd@v1
|
|
|
|
with:
|
|
|
|
arch: x86
|
2022-10-23 07:56:16 -04:00
|
|
|
if: matrix.config.os_identifier == 'win'
|
2022-07-30 12:24:03 -04:00
|
|
|
|
|
|
|
- name: Configure ccache
|
|
|
|
uses: hendrikmuhs/ccache-action@v1.2
|
|
|
|
with:
|
|
|
|
key: ${{ matrix.config.os }}
|
|
|
|
|
2022-10-14 14:22:51 -04:00
|
|
|
- name: Download CLI
|
|
|
|
uses: robinraju/release-downloader@v1.5
|
|
|
|
with:
|
|
|
|
repository: geode-sdk/cli
|
|
|
|
latest: true
|
2022-10-23 07:56:16 -04:00
|
|
|
fileName: "*-${{ matrix.config.os_identifier }}.zip"
|
2022-10-14 14:22:51 -04:00
|
|
|
tarBall: false
|
|
|
|
zipBall: false
|
2022-10-16 13:12:05 -04:00
|
|
|
out-file-path: "cli"
|
2023-07-31 10:49:54 -04:00
|
|
|
|
2022-10-14 14:22:51 -04:00
|
|
|
- name: Unzip CLI
|
|
|
|
run: |
|
2022-10-23 07:56:16 -04:00
|
|
|
7z x "${{ github.workspace }}/cli/*-${{ matrix.config.os_identifier }}.zip" -o"${{ github.workspace }}/cli"
|
2023-07-31 10:49:54 -04:00
|
|
|
|
2022-10-14 14:22:51 -04:00
|
|
|
- name: Add CLI to Path
|
|
|
|
run: |
|
|
|
|
${{ matrix.config.cli_cmd }}
|
|
|
|
echo "${{ github.workspace }}/cli" >> $GITHUB_PATH
|
2022-10-23 08:23:55 -04:00
|
|
|
|
2022-07-30 12:24:03 -04:00
|
|
|
- name: Configure CMake
|
2022-11-28 13:17:58 -05:00
|
|
|
run: >
|
|
|
|
${{ matrix.config.prefixes }} cmake -B
|
|
|
|
${{ github.workspace }}/build
|
|
|
|
${{ matrix.config.extra_flags }}
|
|
|
|
-DCLI_PATH="${{ github.workspace }}/cli"
|
2022-11-28 14:08:21 -05:00
|
|
|
-D CMAKE_C_COMPILER_LAUNCHER=ccache
|
|
|
|
-D CMAKE_CXX_COMPILER_LAUNCHER=ccache
|
2022-10-23 08:23:55 -04:00
|
|
|
|
2022-07-30 12:24:03 -04:00
|
|
|
- name: Build
|
|
|
|
run: |
|
|
|
|
cd build
|
2022-11-28 13:24:30 -05:00
|
|
|
cmake --build . --config RelWithDebInfo --parallel
|
2022-10-23 08:23:55 -04:00
|
|
|
|
2022-07-30 12:24:03 -04:00
|
|
|
- name: Move to output folder
|
|
|
|
shell: bash
|
|
|
|
working-directory: ${{ github.workspace }}
|
|
|
|
run: |
|
|
|
|
mkdir ./out
|
|
|
|
mv ${{ matrix.config.out_paths }} ./out
|
2023-07-31 10:49:54 -04:00
|
|
|
|
2022-10-23 07:56:16 -04:00
|
|
|
- name: Delete resource cache file
|
|
|
|
run: |
|
|
|
|
rm ./bin/nightly/resources/.geode_cache
|
2023-08-01 11:51:41 -04:00
|
|
|
|
2022-10-23 07:56:16 -04:00
|
|
|
- name: Upload resources
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: resources
|
|
|
|
path: ./bin/nightly/resources
|
|
|
|
if: matrix.config.os_identifier == 'win'
|
2022-07-30 12:24:03 -04:00
|
|
|
|
|
|
|
- name: Upload Artifacts
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
2023-08-01 11:51:41 -04:00
|
|
|
name: geode-${{ matrix.config.os_identifier }}
|
2022-07-30 12:24:03 -04:00
|
|
|
path: ./out
|
2023-07-31 10:49:54 -04:00
|
|
|
|
2023-08-01 11:51:41 -04:00
|
|
|
# Make these a script
|
2023-06-28 08:31:22 -04:00
|
|
|
- name: Package MacOS
|
|
|
|
run: |
|
2023-06-28 08:56:25 -04:00
|
|
|
cp -R ./bin/nightly/resources ./out/resources
|
2023-08-01 11:51:41 -04:00
|
|
|
./installer/mac/package.sh ./out ./out/geode-installer-mac.pkg
|
2023-06-28 08:31:22 -04:00
|
|
|
if: matrix.config.os_identifier == 'mac'
|
2022-07-30 12:24:03 -04:00
|
|
|
|
2023-07-31 10:49:54 -04:00
|
|
|
- name: Package Windows
|
2023-07-31 11:49:05 -04:00
|
|
|
run: |
|
|
|
|
cp -R ./bin/nightly/resources ./out/resources
|
|
|
|
iwr -useb https://aka.ms/vs/17/release/vc_redist.x86.exe -outfile './installer/windows/VC_redist.x86.exe'
|
|
|
|
makensis -WX -V3 ./installer/windows/installer.nsi
|
2023-08-01 11:51:41 -04:00
|
|
|
mv ./installer/windows/GeodeInstaller.exe ./installer/windows/geode-installer-win.exe
|
2023-07-31 10:49:54 -04:00
|
|
|
if: matrix.config.os_identifier == 'win'
|
|
|
|
|
2023-08-01 11:51:41 -04:00
|
|
|
- name: Publish Installers
|
2023-07-31 10:49:54 -04:00
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
2023-08-01 11:51:41 -04:00
|
|
|
name: geode-installer-${{ matrix.config.os_identifier }}
|
|
|
|
path: ${{ matrix.config.installer_path }}
|
2023-07-31 10:49:54 -04:00
|
|
|
|
2022-07-30 12:24:03 -04:00
|
|
|
publish:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: build
|
2022-10-23 07:56:16 -04:00
|
|
|
if: github.ref == 'refs/heads/main'
|
2022-07-30 12:24:03 -04:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2023-08-01 11:51:41 -04:00
|
|
|
|
|
|
|
- name: Declare commit hash
|
2023-06-10 09:06:29 -04:00
|
|
|
shell: bash
|
2023-08-01 11:51:41 -04:00
|
|
|
run: |
|
|
|
|
echo "SHA_SHORT=$(git rev-parse --short "$GITHUB_SHA")" >> "$GITHUB_ENV"
|
2022-07-30 12:24:03 -04:00
|
|
|
|
2023-08-01 11:08:17 -04:00
|
|
|
- name: Download artifacts
|
2023-08-01 11:10:22 -04:00
|
|
|
uses: actions/download-artifact@v3
|
2022-07-30 12:24:03 -04:00
|
|
|
with:
|
|
|
|
path: ${{ github.workspace }}
|
2023-08-01 11:08:17 -04:00
|
|
|
|
|
|
|
- name: Move installers
|
|
|
|
run: |
|
2023-08-01 11:51:41 -04:00
|
|
|
mv geode-installer-mac/geode-installer-mac.pkg geode-installer-${{ env.SHA_SHORT }}-mac.pkg
|
|
|
|
mv geode-installer-win/geode-installer-win.exe geode-installer-${{ env.SHA_SHORT }}-win.exe
|
2022-07-30 12:24:03 -04:00
|
|
|
|
2023-08-01 11:08:17 -04:00
|
|
|
- name: Zip MacOS artifacts
|
2023-08-01 11:10:22 -04:00
|
|
|
uses: vimtor/action-zip@v1
|
2022-07-30 12:24:03 -04:00
|
|
|
with:
|
2023-08-01 12:22:56 -04:00
|
|
|
files: geode-mac/Geode.dylib geode-mac/GeodeBootstrapper.dylib
|
2023-08-01 11:51:41 -04:00
|
|
|
dest: geode-${{ env.SHA_SHORT }}-mac.zip
|
2022-07-30 12:24:03 -04:00
|
|
|
|
2023-08-01 11:08:17 -04:00
|
|
|
- name: Zip Windows artifacts
|
2023-08-01 11:10:22 -04:00
|
|
|
uses: vimtor/action-zip@v1
|
2022-07-30 12:24:03 -04:00
|
|
|
with:
|
2023-08-01 12:22:56 -04:00
|
|
|
files: geode-win/XInput9_1_0.dll geode-win/Geode.dll geode-win/GeodeUpdater.exe geode-win/Geode.lib
|
2023-08-01 11:51:41 -04:00
|
|
|
dest: geode-${{ env.SHA_SHORT }}-win.zip
|
2023-08-01 11:08:17 -04:00
|
|
|
|
|
|
|
- name: Update Nightly Release
|
|
|
|
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
|
|
|
|
name: 'Dev Release'
|
|
|
|
draft: false
|
2022-10-23 08:23:55 -04:00
|
|
|
prerelease: true
|
2023-08-01 11:08:17 -04:00
|
|
|
body: |
|
|
|
|
Dev release of Geode. Will not install the resources automatically, so you should use the installers to install them.
|
|
|
|
files: |
|
2023-08-01 11:51:41 -04:00
|
|
|
./geode-${{ env.SHA_SHORT }}-mac.zip
|
|
|
|
./geode-${{ env.SHA_SHORT }}-win.zip
|
|
|
|
./geode-installer-${{ env.SHA_SHORT }}-mac.pkg
|
|
|
|
./geode-installer-${{ env.SHA_SHORT }}-win.exe
|