geode/.github/workflows/build.yml
HJfod 0a0a34eb5c some minor changes
- add Mod::getPackagePath as a replacement for Mod::getPath
 - add new geode/config directory for mods' config files
 - add Mod::getConfigDir for getting the mod's config directory
 - add libfmod.dylib and auto-move it in actions
 - add open save directory button to mod settings popup
2022-10-23 15:23:55 +03:00

139 lines
3.8 KiB
YAML

name: Build Binaries
on:
workflow_dispatch:
push:
branches:
- '**' # every branch
- '!no-build-**' # unless marked as no-build
jobs:
build:
strategy:
fail-fast: false
matrix:
config:
- name: "Windows"
os_identifier: "win"
os: windows-2019
prefixes: ''
extra_flags: '-G "Visual Studio 16 2019" -T host=x86 -A win32'
out_paths: './bin/nightly/Geode.dll ./bin/nightly/GeodeBootstrapper.dll ./bin/nightly/Geode.lib ./bin/nightly/XInput9_1_0.dll'
cli_cmd: ''
- name: "macOS"
os_identifier: "mac"
os: macos-latest
prefixes: 'PATH="/usr/local/opt/ccache/libexec:$PATH"'
extra_flags: "-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++"
out_paths: './bin/nightly/Geode.dylib ./bin/nightly/GeodeBootstrapper.dylib ./loader/include/link/libfmod.dylib'
cli_cmd: 'chmod +x $GITHUB_WORKSPACE/cli/geode'
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- uses: ilammy/msvc-dev-cmd@v1
with:
arch: x86
if: matrix.config.os_identifier == 'win'
- name: Configure ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: ${{ matrix.config.os }}
- name: Download CLI
uses: robinraju/release-downloader@v1.5
with:
repository: geode-sdk/cli
latest: true
fileName: "*-${{ matrix.config.os_identifier }}.zip"
tarBall: false
zipBall: false
out-file-path: "cli"
- name: Unzip CLI
run: |
7z x "${{ github.workspace }}/cli/*-${{ matrix.config.os_identifier }}.zip" -o"${{ github.workspace }}/cli"
- name: Add CLI to Path
run: |
${{ matrix.config.cli_cmd }}
echo "${{ github.workspace }}/cli" >> $GITHUB_PATH
- name: Configure CMake
run: |
${{ matrix.config.prefixes }} cmake -B ${{ github.workspace }}/build ${{ matrix.config.extra_flags }} -DGEODE_DISABLE_CLI_CALLS=ON -DCLI_PATH="${{ github.workspace }}/cli"
- name: Build
run: |
cd build
cmake --build . --config RelWithDebInfo
- name: Move to output folder
shell: bash
working-directory: ${{ github.workspace }}
run: |
mkdir ./out
mv ${{ matrix.config.out_paths }} ./out
- name: Get version
uses: juliangruber/read-file-action@v1.1.6
with:
path: ${{ github.workspace }}/VERSION
id: version
- name: Delete resource cache file
run: |
rm ./bin/nightly/resources/.geode_cache
- name: Upload resources
uses: actions/upload-artifact@v2
with:
name: resources
path: ./bin/nightly/resources
if: matrix.config.os_identifier == 'win'
- name: Upload Artifacts
uses: actions/upload-artifact@v2
with:
name: geode-v${{ steps.version.outputs.content }}-${{ matrix.config.os_identifier }}
path: ./out
publish:
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v3
with:
path: ${{ github.workspace }}
- uses: vimtor/action-zip@v1
with:
files: macOS
dest: macOS.zip
- uses: vimtor/action-zip@v1
with:
files: Windows
dest: Windows.zip
- uses: vimtor/action-zip@v1
with:
files: loader/include
dest: Headers.zip
- name: Update release
uses: IsaacShelton/update-existing-release@v1.3.1
with:
token: ${{ secrets.GITHUB_TOKEN }}
files: ./macOS.zip ./Windows.zip ./Headers.zip
release: Nightly
prerelease: true