This repository has been archived by the owner on Jun 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5d416f2
commit 402e728
Showing
4 changed files
with
172 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,161 @@ | ||
name: MacOS Export | ||
|
||
on: [push] | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
RUSTFLAGS: -Dwarnings | ||
CARGO_INCREMENTAL: 0 | ||
PROJECT_NAME: Godot Spike | ||
WORKING_DIRECTORY: godot | ||
IOS_APPLE_ID_USERNAME: ${{ secrets.IOS_APPLE_ID_USERNAME }} | ||
IOS_APPLE_ID_PASSWORD: ${{ secrets.IOS_APPLE_ID_PASSWORD }} | ||
|
||
BUILD_CERTIFICATE_BASE64: ${{ secrets.IOS_BUILD_CERTIFICATE_BASE64 }} | ||
P12_PASSWORD: ${{ secrets.P12_PASSWORD }} | ||
BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.BUILD_PROVISION_PROFILE_BASE64 }} | ||
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }} | ||
|
||
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/checkout@v2 | ||
|
||
- 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: Generate dummy Xcode project | ||
run: | | ||
xcodeproj --help | ||
mkdir DummyProject.xcodeproj | ||
touch DummyProject.xcodeproj/project.pbxproj | ||
echo '{ | ||
archiveVersion = 1; | ||
classes = { | ||
}; | ||
objectVersion = 52; | ||
objects = { | ||
/* Begin PBXBuildFile section */ | ||
/* End PBXBuildFile section */ | ||
/* Begin PBXFileReference section */ | ||
/* End PBXFileReference section */ | ||
/* Begin PBXGroup section */ | ||
/* End PBXGroup section */ | ||
/* Begin PBXNativeTarget section */ | ||
/* End PBXNativeTarget section */ | ||
/* Begin PBXProject section */ | ||
/* End PBXProject section */ | ||
/* Begin XCBuildConfiguration section */ | ||
/* End XCBuildConfiguration section */ | ||
/* Begin XCConfigurationList section */ | ||
/* End XCConfigurationList section */ | ||
}; | ||
rootObject = fa34a281-c6e9-4544-8eed-20a321786ea9 /* Project object */; | ||
}' > DummyProject.xcodeproj/project.pbxproj | ||
- name: Godot Export | ||
run: | | ||
set -x | ||
touch godot/.godot/extension_list.cfg | ||
echo "res://rust.gdextension" >> godot/.godot/extension_list.cfg | ||
# create variables | ||
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12 | ||
PP_PATH=$RUNNER_TEMP/build_pp.mobileprovision | ||
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db | ||
# import certificate and provisioning profile from secrets | ||
echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode -o $CERTIFICATE_PATH | ||
echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode -o $PP_PATH | ||
# create temporary keychain | ||
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH | ||
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH | ||
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH | ||
# import certificate to keychain | ||
security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH | ||
security list-keychain -d user -s $KEYCHAIN_PATH | ||
# apply provisioning profile | ||
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles | ||
cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles | ||
xcrun xcodebuild -allowProvisioningUpdates -project DummyProject.xcodeproj \ | ||
-scheme DummyProject -destination generic/platform=iOS \ | ||
-authenticationKeyID ${{ secrets.IOS_APPLE_ID_USERNAME }} \ | ||
-authenticationKeyIssuerID ${{ secrets.IOS_APPLE_ID_USERNAME }} | ||
just setup-ios | ||
just ios-debug |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters