Skip to content

Commit

Permalink
update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
HJfod committed Jan 6, 2024
1 parent e3d78c2 commit 9d7e86f
Showing 1 changed file with 26 additions and 115 deletions.
141 changes: 26 additions & 115 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,137 +6,48 @@ on:
branches:
- "main"

env:
GEODE_SDK: ${{ github.workspace }}/sdk
GEODE_VERSION: v1.0.0-beta.12
CLI_VERSION: v2.2.3
MOD_NAME: GDShare
MOD_ID: hjfod.gdshare

jobs:
build:
strategy:
fail-fast: false
matrix:
config:
- name: "Windows"
bin_folder: "windows"
os: windows-2019
extra_flags: '-T host=x64 -A win32'
out_paths: './build/Release/*.dll'
platform_suffix: 'win'
cli_setup: ''
cli_name: 'geode.exe'
- name: Windows
os: windows-latest

- name: "macOS"
bin_folder: "macos"
- name: macOS
os: macos-latest
extra_flags: "-DCMAKE_OSX_DEPLOYMENT_TARGET=10.13"
out_paths: './build/*.dylib'
platform_suffix: 'mac'
cli_setup: 'chmod a+rwx ./geode'
cli_name: 'geode'


- name: Android32
os: ubuntu-latest
target: Android32

- name: Android64
os: ubuntu-latest
target: Android64

name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}

steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: actions/checkout@v3

- uses: actions/checkout@v3
with:
submodules: recursive
repository: geode-sdk/geode
# ref: v0.4.8
path: ${{ env.GEODE_SDK }}

- uses: ilammy/msvc-dev-cmd@v1
with:
arch: x86

- name: Download Geode SDK binaries
run: |
cd ${{ github.workspace }}/sdk
mkdir bin
mkdir bin/nightly
cd bin/nightly
curl -L https://github.com/geode-sdk/geode/releases/download/${{ env.GEODE_VERSION }}/geode-${{ env.GEODE_VERSION }}-${{ matrix.config.platform_suffix }}.zip -o geode-sdk.zip
tar -xf geode-sdk.zip
- name: Download and Unzip CLI
run: |
mkdir ${{ github.workspace }}/cli
cd ${{ github.workspace }}/cli
curl -L https://github.com/geode-sdk/cli/releases/download/${{ env.CLI_VERSION }}/geode-cli-${{ env.CLI_VERSION }}-${{ matrix.config.platform_suffix }}.zip -o geode-cli.zip
tar -xf geode-cli.zip
${{ matrix.config.cli_setup }}
mkdir ${{ github.workspace }}/profile
mkdir ${{ github.workspace }}/profile/geode
mkdir ${{ github.workspace }}/profile/geode/mods
./${{ matrix.config.cli_name }} profile add --name GithubActions ${{ github.workspace }}/profile
- name: Build the mod
uses: geode-sdk/build-geode-mod@main
with:
combine: true
target: ${{ matrix.config.target }}

- name: Configure CMake
run: |
cd ${{ github.workspace }}
cmake -B build ${{ matrix.config.extra_flags }} -DCLI_PATH=${{ github.workspace }}/cli -DGEODE_DONT_INSTALL_MODS=On
- name: Build
run: |
cd ${{ github.workspace }}/build
cmake --build . --config Release
- uses: actions/upload-artifact@v3
with:
name: "build-${{ matrix.config.bin_folder }}"
path: "${{ matrix.config.out_paths }}"


package:
name: "Package both builds"
# would use linux but theres no cli build for it
runs-on: windows-2019
name: Package builds
runs-on: ubuntu-latest
needs: ['build']

steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Download and Unzip CLI
run: |
curl -L https://github.com/geode-sdk/cli/releases/download/${{ env.CLI_VERSION }}/geode-cli-${{ env.CLI_VERSION }}-win.zip -o geode-cli.zip
tar -xf geode-cli.zip
- uses: actions/download-artifact@v3
with:
name: build-windows

- uses: actions/download-artifact@v3
with:
name: build-macos

- name: Display structure of downloaded files
run: ls -R

- name: Merge
shell: bash
run: |
./geode.exe package new . --binary $MOD_ID.dll --binary $MOD_ID.dylib --output $MOD_ID.geode

steps:
- uses: geode-sdk/build-geode-mod/combine@main
id: build

- uses: actions/upload-artifact@v3
with:
name: Build Output
path: "${{ env.MOD_ID }}.geode"

- uses: geekyeggo/delete-artifact@v2
with:
name: build-windows
failOnError: false

- uses: geekyeggo/delete-artifact@v2
with:
name: build-macos
failOnError: false

path: ${{ steps.build.outputs.build-output }}

0 comments on commit 9d7e86f

Please sign in to comment.