Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Commit

Permalink
Implement CI for MacOS/iOS export
Browse files Browse the repository at this point in the history
  • Loading branch information
dorianpercic committed May 7, 2024
1 parent e91d41e commit 24c7ea9
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 4 deletions.
85 changes: 85 additions & 0 deletions .github/workflows/macos_export.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: MacOS Export

on: [push]

env:
CARGO_TERM_COLOR: always
RUSTFLAGS: -Dwarnings
CARGO_INCREMENTAL: 0

jobs:
export-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
components: rustfmt, clippy
- uses: rui314/setup-mold@v1
- uses: chickensoft-games/setup-godot@v1
name: Setup Godot
with:
version: 4.2.2
include-templates: true
use-dotnet: false
- uses: Swatinem/rust-cache@v2
with:
workspaces: "rust -> target"
cache-all-crates: "true"

- name: Install just
run: cargo install just

- name: just Check
run: just --version

- name: Godot Check
run: |
godot --version
- name: Godot Export
run: |
set -x
touch godot/.godot/extension_list.cfg
echo "res://rust.gdextension" >> godot/.godot/extension_list.cfg
just macos-release
export-ios:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
components: rustfmt, clippy
- uses: rui314/setup-mold@v1
- uses: chickensoft-games/setup-godot@v1
name: Setup Godot
with:
version: 4.2.2
include-templates: true
use-dotnet: false
- uses: Swatinem/rust-cache@v2
with:
workspaces: "rust -> target"
cache-all-crates: "true"

- name: Install just
run: cargo install just

- name: just Check
run: just --version

- name: Godot Check
run: |
godot --version
- name: Godot Export
run: |
set -x
touch godot/.godot/extension_list.cfg
echo "res://rust.gdextension" >> godot/.godot/extension_list.cfg
just ios-debug
Empty file added export/macos/.gitkeep
Empty file.
4 changes: 4 additions & 0 deletions godot/rust.gdextension
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,7 @@ android.debug.arm64 = "res://../rust/target/aarch64-linux-android/debug/libgo
android.release.arm64 = "res://../rust/target/aarch64-linux-android/release/libgodot_plugin.so"
windows.debug.x86_64 = "res://../rust/target/x86_64-pc-windows-msvc/debug/godot_plugin.dll"
windows.release.x86_64 = "res://../rust/target/x86_64-pc-windows-msvc/release/godot_plugin.dll"
macos.debug.arm64 = "res://../rust/target/debug/libgodot_plugin.dylib"
macos.release.arm64 = "res://../rust/target/release/libgodot_plugin.dylib"
ios.debug.arm64 = "res://../rust/target/debug/libgodot_plugin.dylib"
ios.release.arm64 = "res://../rust/target/release/libgodot_plugin.dylib"
10 changes: 6 additions & 4 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,19 @@ windows-release:
[macos]
macos-debug:
{{rustdir}} cargo build
{{rustdir}} cargo build
ls rust/target/debug/
{{godotdir}} godot --headless --export-debug "macOS" "../export/macos/Godot Spike.dmg"
[macos]
macos-release:
{{rustdir}} cargo build --release
{{godotdir}} godot --headless --export-release "macOS" "../export/macos/Godot Spike.dmg"
{{rustdir}} cargo build
{{rustdir}} cargo build --release
{{godotdir}} godot --headless --export-release "macOS" "../export/macos/Godot Spike.dmg"
[macos]
ios-debug:
# NOTE: can only work on MacOS with xcode
{{rustdir}} cargo build
{{rustdir}} cargo build --target aarch64-apple-ios
{{godotdir}} godot --headless --export-debug "iOS" "../export/ios/Godot Spike.ipa"
Expand Down

0 comments on commit 24c7ea9

Please sign in to comment.