2022-07-30 12:24:03 -04:00
|
|
|
name: Build Binaries
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
2023-08-01 14:57:01 -04:00
|
|
|
inputs:
|
|
|
|
draft:
|
2023-08-02 07:04:24 -04:00
|
|
|
description: Draft Release
|
2023-08-01 14:57:01 -04:00
|
|
|
required: false
|
|
|
|
type: boolean
|
|
|
|
default: false
|
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
|
|
|
|
|
2023-08-01 15:19:23 -04:00
|
|
|
env:
|
2023-08-01 19:06:20 -04:00
|
|
|
GEODE_CI: ''
|
2023-08-01 17:11:04 -04:00
|
|
|
CCACHE_ACTION_CI: true
|
2023-08-01 15:19:23 -04:00
|
|
|
|
2022-07-30 12:24:03 -04:00
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
config:
|
2023-08-01 17:11:04 -04:00
|
|
|
- name: Windows
|
2023-08-01 14:57:01 -04:00
|
|
|
os: windows-latest
|
2023-08-02 06:55:26 -04:00
|
|
|
id: win
|
2023-08-02 11:14:55 -04:00
|
|
|
extra_flags: >
|
2023-08-02 11:27:38 -04:00
|
|
|
-DCMAKE_C_COMPILER=$VCINSTALLDIR\Tools\Llvm\bin\clang-cl.exe
|
|
|
|
-DCMAKE_CXX_COMPILER=$VCINSTALLDIR\Tools\Llvm\bin\clang-cl.exe
|
2023-08-02 11:14:55 -04:00
|
|
|
-G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DGEODE_DEBUG=On
|
2022-10-14 14:22:51 -04:00
|
|
|
cli_cmd: ''
|
2023-08-01 14:57:01 -04:00
|
|
|
package_cmd: 'makensis -WX -V3 ./installer/windows/installer.nsi'
|
2023-08-01 12:04:38 -04:00
|
|
|
installer_path: './installer/windows/geode-installer-win.exe'
|
2022-10-14 14:22:51 -04:00
|
|
|
|
2023-08-01 17:11:04 -04:00
|
|
|
- name: macOS
|
2022-07-30 12:24:03 -04:00
|
|
|
os: macos-latest
|
2023-08-02 06:55:26 -04:00
|
|
|
id: mac
|
|
|
|
extra_flags: >
|
2023-08-02 11:14:55 -04:00
|
|
|
-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
|
2023-08-02 06:49:56 -04:00
|
|
|
-DCMAKE_BUILD_TYPE=RelWithDebInfo -DGEODE_DEBUG=On -DCMAKE_OSX_DEPLOYMENT_TARGET=10.13
|
2022-10-14 14:22:51 -04:00
|
|
|
cli_cmd: 'chmod +x $GITHUB_WORKSPACE/cli/geode'
|
2023-08-01 14:57:01 -04:00
|
|
|
package_cmd: './installer/mac/package.sh ./bin/nightly ./installer/mac/geode-installer-mac.pkg'
|
|
|
|
installer_path: './installer/mac/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:
|
2023-08-01 15:35:18 -04:00
|
|
|
- uses: actions/checkout@v3
|
2022-08-02 06:04:11 -04:00
|
|
|
with:
|
|
|
|
submodules: recursive
|
2022-07-30 12:24:03 -04:00
|
|
|
|
2023-08-01 17:11:04 -04:00
|
|
|
- uses: hendrikmuhs/ccache-action@v1
|
2023-08-01 16:48:51 -04:00
|
|
|
with:
|
|
|
|
key: ${{ matrix.config.os }}
|
2023-08-01 15:19:23 -04:00
|
|
|
|
2023-08-01 19:14:34 -04:00
|
|
|
- uses: ilammy/msvc-dev-cmd@v1.12.1
|
2022-07-30 12:24:03 -04:00
|
|
|
with:
|
2023-08-01 19:14:34 -04:00
|
|
|
arch: amd64_x86
|
2023-08-02 06:55:26 -04:00
|
|
|
if: matrix.config.id == 'win'
|
2022-07-30 12:24:03 -04:00
|
|
|
|
2022-10-14 14:22:51 -04:00
|
|
|
- name: Download CLI
|
2023-08-01 15:44:47 -04:00
|
|
|
uses: robinraju/release-downloader@v1.8
|
2022-10-14 14:22:51 -04:00
|
|
|
with:
|
|
|
|
repository: geode-sdk/cli
|
|
|
|
latest: true
|
2023-08-02 06:55:26 -04:00
|
|
|
fileName: '*-${{ matrix.config.id }}.zip'
|
2022-10-14 14:22:51 -04:00
|
|
|
tarBall: false
|
|
|
|
zipBall: false
|
2023-08-01 14:57:01 -04:00
|
|
|
out-file-path: "cli"
|
2023-07-31 10:49:54 -04:00
|
|
|
|
2023-08-01 14:57:01 -04:00
|
|
|
- name: Setup CLI
|
2022-10-14 14:22:51 -04:00
|
|
|
run: |
|
2023-08-02 06:55:26 -04:00
|
|
|
7z x "${{ github.workspace }}/cli/*-${{ matrix.config.id }}.zip" -o"${{ github.workspace }}/cli"
|
2022-10-14 14:22:51 -04:00
|
|
|
${{ 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: >
|
2023-08-01 19:06:20 -04:00
|
|
|
cmake -B ${{ github.workspace }}/build
|
2023-08-01 14:57:01 -04:00
|
|
|
-DCLI_PATH="${{ github.workspace }}/cli"
|
2023-08-02 11:14:55 -04:00
|
|
|
-DCMAKE_C_COMPILER_LAUNCHER=ccache
|
|
|
|
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
|
2023-08-02 07:01:42 -04:00
|
|
|
${{ matrix.config.extra_flags }}
|
2022-10-23 08:23:55 -04:00
|
|
|
|
2022-07-30 12:24:03 -04:00
|
|
|
- name: Build
|
|
|
|
run: |
|
2023-08-01 17:11:04 -04:00
|
|
|
cd ${{ github.workspace }}/build
|
2022-11-28 13:24:30 -05:00
|
|
|
cmake --build . --config RelWithDebInfo --parallel
|
2022-10-23 08:23:55 -04:00
|
|
|
|
2023-08-02 07:00:29 -04:00
|
|
|
- name: Clean Up Resources
|
2023-08-01 14:57:01 -04:00
|
|
|
run: rm ./bin/nightly/resources/.geode_cache
|
2022-07-30 12:24:03 -04:00
|
|
|
|
|
|
|
- name: Upload Artifacts
|
2023-08-01 15:35:18 -04:00
|
|
|
uses: actions/upload-artifact@v3
|
2022-07-30 12:24:03 -04:00
|
|
|
with:
|
2023-08-02 06:55:26 -04:00
|
|
|
name: geode-${{ matrix.config.id }}
|
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
|
2023-08-01 14:57:01 -04:00
|
|
|
run: ${{ matrix.config.package_cmd }}
|
2023-07-31 10:49:54 -04:00
|
|
|
|
2023-08-02 06:53:50 -04:00
|
|
|
- name: Upload Installer
|
2023-08-01 15:35:18 -04:00
|
|
|
uses: actions/upload-artifact@v3
|
2023-07-31 10:49:54 -04:00
|
|
|
with:
|
2023-08-02 06:55:26 -04:00
|
|
|
name: geode-installer-${{ matrix.config.id }}
|
2023-08-01 11:51:41 -04:00
|
|
|
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:
|
2023-08-01 15:35:18 -04:00
|
|
|
- uses: actions/checkout@v3
|
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-06-10 09:06:29 -04:00
|
|
|
shell: bash
|
2023-08-01 11:51:41 -04:00
|
|
|
run: |
|
2023-08-01 14:57:01 -04:00
|
|
|
echo "version=$(cat ${{ github.workspace }}/VERSION | xargs)" >> $GITHUB_OUTPUT
|
|
|
|
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
|
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 14:57:01 -04:00
|
|
|
|
2023-08-02 06:53:50 -04:00
|
|
|
- name: Move Installers
|
2023-08-01 11:08:17 -04:00
|
|
|
run: |
|
2023-08-01 14:57:01 -04:00
|
|
|
mv geode-installer-mac/geode-installer-mac.pkg geode-installer-${{ steps.ref.outputs.hash }}-mac.pkg
|
|
|
|
mv geode-installer-win/geode-installer-win.exe geode-installer-${{ steps.ref.outputs.hash }}-win.exe
|
2022-07-30 12:24:03 -04:00
|
|
|
|
2023-08-02 06:53:50 -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 14:57:01 -04:00
|
|
|
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
|
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 14:57:01 -04:00
|
|
|
dest: geode-${{ steps.ref.outputs.hash }}-win.zip
|
|
|
|
|
2023-08-02 06:53:50 -04:00
|
|
|
- name: Update Nightly 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
|
|
|
|
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 14:57:01 -04:00
|
|
|
./geode-${{ steps.ref.outputs.hash }}-mac.zip
|
|
|
|
./geode-${{ steps.ref.outputs.hash }}-win.zip
|
|
|
|
./geode-installer-${{ steps.ref.outputs.hash }}-mac.pkg
|
|
|
|
./geode-installer-${{ steps.ref.outputs.hash }}-win.exe
|
|
|
|
|
2023-08-02 06:53:50 -04:00
|
|
|
- name: Create Draft Release
|
2023-08-01 14:57:01 -04:00
|
|
|
uses: softprops/action-gh-release@v1
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
if: ${{ inputs.draft }}
|
|
|
|
with:
|
|
|
|
tag_name: v${{ steps.ref.outputs.version }}
|
|
|
|
name: Geode v${{ steps.ref.outputs.version }}
|
|
|
|
body: |
|
|
|
|
TODO before publishing:
|
|
|
|
- mark if pre-release
|
|
|
|
- add changelog
|
|
|
|
- remove this
|
|
|
|
draft: true
|
|
|
|
files: |
|
|
|
|
./geode-${{ steps.ref.outputs.version }}-mac.zip
|
|
|
|
./geode-${{ steps.ref.outputs.version }}-win.zip
|
|
|
|
./geode-installer-${{ steps.ref.outputs.version }}-mac.pkg
|
|
|
|
./geode-installer-${{ steps.ref.outputs.version }}-win.exe
|
|
|
|
|