From 195d4e0577e874d7d0ba381b55ffb25fdb73f1cc Mon Sep 17 00:00:00 2001 From: Dorian Percic Date: Tue, 7 May 2024 13:29:46 +0200 Subject: [PATCH] Implement CI for MacOS/iOS export --- .github/workflows/macos_export.yml | 731 +++++++++++++++++++++++++++++ export/macos/.gitkeep | 0 godot/rust.gdextension | 4 + justfile | 14 +- 4 files changed, 742 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/macos_export.yml create mode 100644 export/macos/.gitkeep diff --git a/.github/workflows/macos_export.yml b/.github/workflows/macos_export.yml new file mode 100644 index 0000000..98fba1e --- /dev/null +++ b/.github/workflows/macos_export.yml @@ -0,0 +1,731 @@ +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 '// !$*UTF8*$! + { + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + + /* Begin PBXBuildFile section */ + 0BC86D052BF4E13F00501F94 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0BC86D042BF4E13F00501F94 /* AppDelegate.swift */; }; + 0BC86D072BF4E13F00501F94 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0BC86D062BF4E13F00501F94 /* SceneDelegate.swift */; }; + 0BC86D092BF4E13F00501F94 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0BC86D082BF4E13F00501F94 /* ContentView.swift */; }; + 0BC86D0B2BF4E14000501F94 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 0BC86D0A2BF4E14000501F94 /* Assets.xcassets */; }; + 0BC86D0E2BF4E14000501F94 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 0BC86D0D2BF4E14000501F94 /* Preview Assets.xcassets */; }; + 0BC86D112BF4E14000501F94 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 0BC86D0F2BF4E14000501F94 /* LaunchScreen.storyboard */; }; + 0BC86D1C2BF4E14000501F94 /* DummyProjectTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0BC86D1B2BF4E14000501F94 /* DummyProjectTests.swift */; }; + 0BC86D272BF4E14000501F94 /* DummyProjectUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0BC86D262BF4E14000501F94 /* DummyProjectUITests.swift */; }; + /* End PBXBuildFile section */ + + /* Begin PBXContainerItemProxy section */ + 0BC86D182BF4E14000501F94 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 0BC86CF92BF4E13F00501F94 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 0BC86D002BF4E13F00501F94; + remoteInfo = DummyProject; + }; + 0BC86D232BF4E14000501F94 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 0BC86CF92BF4E13F00501F94 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 0BC86D002BF4E13F00501F94; + remoteInfo = DummyProject; + }; + /* End PBXContainerItemProxy section */ + + /* Begin PBXFileReference section */ + 0BC86D012BF4E13F00501F94 /* DummyProject.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DummyProject.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 0BC86D042BF4E13F00501F94 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 0BC86D062BF4E13F00501F94 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; + 0BC86D082BF4E13F00501F94 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; + 0BC86D0A2BF4E14000501F94 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 0BC86D0D2BF4E14000501F94 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; + 0BC86D102BF4E14000501F94 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 0BC86D122BF4E14000501F94 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 0BC86D172BF4E14000501F94 /* DummyProjectTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = DummyProjectTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 0BC86D1B2BF4E14000501F94 /* DummyProjectTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DummyProjectTests.swift; sourceTree = ""; }; + 0BC86D1D2BF4E14000501F94 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 0BC86D222BF4E14000501F94 /* DummyProjectUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = DummyProjectUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 0BC86D262BF4E14000501F94 /* DummyProjectUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DummyProjectUITests.swift; sourceTree = ""; }; + 0BC86D282BF4E14000501F94 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + /* End PBXFileReference section */ + + /* Begin PBXFrameworksBuildPhase section */ + 0BC86CFE2BF4E13F00501F94 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 0BC86D142BF4E14000501F94 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 0BC86D1F2BF4E14000501F94 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + /* End PBXFrameworksBuildPhase section */ + + /* Begin PBXGroup section */ + 0BC86CF82BF4E13F00501F94 = { + isa = PBXGroup; + children = ( + 0BC86D032BF4E13F00501F94 /* DummyProject */, + 0BC86D1A2BF4E14000501F94 /* DummyProjectTests */, + 0BC86D252BF4E14000501F94 /* DummyProjectUITests */, + 0BC86D022BF4E13F00501F94 /* Products */, + ); + sourceTree = ""; + }; + 0BC86D022BF4E13F00501F94 /* Products */ = { + isa = PBXGroup; + children = ( + 0BC86D012BF4E13F00501F94 /* DummyProject.app */, + 0BC86D172BF4E14000501F94 /* DummyProjectTests.xctest */, + 0BC86D222BF4E14000501F94 /* DummyProjectUITests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 0BC86D032BF4E13F00501F94 /* DummyProject */ = { + isa = PBXGroup; + children = ( + 0BC86D042BF4E13F00501F94 /* AppDelegate.swift */, + 0BC86D062BF4E13F00501F94 /* SceneDelegate.swift */, + 0BC86D082BF4E13F00501F94 /* ContentView.swift */, + 0BC86D0A2BF4E14000501F94 /* Assets.xcassets */, + 0BC86D0F2BF4E14000501F94 /* LaunchScreen.storyboard */, + 0BC86D122BF4E14000501F94 /* Info.plist */, + 0BC86D0C2BF4E14000501F94 /* Preview Content */, + ); + path = DummyProject; + sourceTree = ""; + }; + 0BC86D0C2BF4E14000501F94 /* Preview Content */ = { + isa = PBXGroup; + children = ( + 0BC86D0D2BF4E14000501F94 /* Preview Assets.xcassets */, + ); + path = "Preview Content"; + sourceTree = ""; + }; + 0BC86D1A2BF4E14000501F94 /* DummyProjectTests */ = { + isa = PBXGroup; + children = ( + 0BC86D1B2BF4E14000501F94 /* DummyProjectTests.swift */, + 0BC86D1D2BF4E14000501F94 /* Info.plist */, + ); + path = DummyProjectTests; + sourceTree = ""; + }; + 0BC86D252BF4E14000501F94 /* DummyProjectUITests */ = { + isa = PBXGroup; + children = ( + 0BC86D262BF4E14000501F94 /* DummyProjectUITests.swift */, + 0BC86D282BF4E14000501F94 /* Info.plist */, + ); + path = DummyProjectUITests; + sourceTree = ""; + }; + /* End PBXGroup section */ + + /* Begin PBXNativeTarget section */ + 0BC86D002BF4E13F00501F94 /* DummyProject */ = { + isa = PBXNativeTarget; + buildConfigurationList = 0BC86D2B2BF4E14000501F94 /* Build configuration list for PBXNativeTarget "DummyProject" */; + buildPhases = ( + 0BC86CFD2BF4E13F00501F94 /* Sources */, + 0BC86CFE2BF4E13F00501F94 /* Frameworks */, + 0BC86CFF2BF4E13F00501F94 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = DummyProject; + productName = DummyProject; + productReference = 0BC86D012BF4E13F00501F94 /* DummyProject.app */; + productType = "com.apple.product-type.application"; + }; + 0BC86D162BF4E14000501F94 /* DummyProjectTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 0BC86D2E2BF4E14000501F94 /* Build configuration list for PBXNativeTarget "DummyProjectTests" */; + buildPhases = ( + 0BC86D132BF4E14000501F94 /* Sources */, + 0BC86D142BF4E14000501F94 /* Frameworks */, + 0BC86D152BF4E14000501F94 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 0BC86D192BF4E14000501F94 /* PBXTargetDependency */, + ); + name = DummyProjectTests; + productName = DummyProjectTests; + productReference = 0BC86D172BF4E14000501F94 /* DummyProjectTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + 0BC86D212BF4E14000501F94 /* DummyProjectUITests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 0BC86D312BF4E14000501F94 /* Build configuration list for PBXNativeTarget "DummyProjectUITests" */; + buildPhases = ( + 0BC86D1E2BF4E14000501F94 /* Sources */, + 0BC86D1F2BF4E14000501F94 /* Frameworks */, + 0BC86D202BF4E14000501F94 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 0BC86D242BF4E14000501F94 /* PBXTargetDependency */, + ); + name = DummyProjectUITests; + productName = DummyProjectUITests; + productReference = 0BC86D222BF4E14000501F94 /* DummyProjectUITests.xctest */; + productType = "com.apple.product-type.bundle.ui-testing"; + }; + /* End PBXNativeTarget section */ + + /* Begin PBXProject section */ + 0BC86CF92BF4E13F00501F94 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 1130; + LastUpgradeCheck = 1130; + ORGANIZATIONNAME = "Dorian Percic"; + TargetAttributes = { + 0BC86D002BF4E13F00501F94 = { + CreatedOnToolsVersion = 11.3.1; + }; + 0BC86D162BF4E14000501F94 = { + CreatedOnToolsVersion = 11.3.1; + TestTargetID = 0BC86D002BF4E13F00501F94; + }; + 0BC86D212BF4E14000501F94 = { + CreatedOnToolsVersion = 11.3.1; + TestTargetID = 0BC86D002BF4E13F00501F94; + }; + }; + }; + buildConfigurationList = 0BC86CFC2BF4E13F00501F94 /* Build configuration list for PBXProject "DummyProject" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 0BC86CF82BF4E13F00501F94; + productRefGroup = 0BC86D022BF4E13F00501F94 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 0BC86D002BF4E13F00501F94 /* DummyProject */, + 0BC86D162BF4E14000501F94 /* DummyProjectTests */, + 0BC86D212BF4E14000501F94 /* DummyProjectUITests */, + ); + }; + /* End PBXProject section */ + + /* Begin PBXResourcesBuildPhase section */ + 0BC86CFF2BF4E13F00501F94 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 0BC86D112BF4E14000501F94 /* LaunchScreen.storyboard in Resources */, + 0BC86D0E2BF4E14000501F94 /* Preview Assets.xcassets in Resources */, + 0BC86D0B2BF4E14000501F94 /* Assets.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 0BC86D152BF4E14000501F94 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 0BC86D202BF4E14000501F94 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + /* End PBXResourcesBuildPhase section */ + + /* Begin PBXSourcesBuildPhase section */ + 0BC86CFD2BF4E13F00501F94 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 0BC86D052BF4E13F00501F94 /* AppDelegate.swift in Sources */, + 0BC86D072BF4E13F00501F94 /* SceneDelegate.swift in Sources */, + 0BC86D092BF4E13F00501F94 /* ContentView.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 0BC86D132BF4E14000501F94 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 0BC86D1C2BF4E14000501F94 /* DummyProjectTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 0BC86D1E2BF4E14000501F94 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 0BC86D272BF4E14000501F94 /* DummyProjectUITests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + /* End PBXSourcesBuildPhase section */ + + /* Begin PBXTargetDependency section */ + 0BC86D192BF4E14000501F94 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 0BC86D002BF4E13F00501F94 /* DummyProject */; + targetProxy = 0BC86D182BF4E14000501F94 /* PBXContainerItemProxy */; + }; + 0BC86D242BF4E14000501F94 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 0BC86D002BF4E13F00501F94 /* DummyProject */; + targetProxy = 0BC86D232BF4E14000501F94 /* PBXContainerItemProxy */; + }; + /* End PBXTargetDependency section */ + + /* Begin PBXVariantGroup section */ + 0BC86D0F2BF4E14000501F94 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 0BC86D102BF4E14000501F94 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; + /* End PBXVariantGroup section */ + + /* Begin XCBuildConfiguration section */ + 0BC86D292BF4E14000501F94 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 13.2; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 0BC86D2A2BF4E14000501F94 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 13.2; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 0BC86D2C2BF4E14000501F94 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_ASSET_PATHS = "\"DummyProject/Preview Content\""; + DEVELOPMENT_TEAM = 3525W6V8GC; + ENABLE_PREVIEWS = YES; + INFOPLIST_FILE = DummyProject/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = godot.spike.DummyProject; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 0BC86D2D2BF4E14000501F94 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_ASSET_PATHS = "\"DummyProject/Preview Content\""; + DEVELOPMENT_TEAM = 3525W6V8GC; + ENABLE_PREVIEWS = YES; + INFOPLIST_FILE = DummyProject/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = godot.spike.DummyProject; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; + 0BC86D2F2BF4E14000501F94 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 3525W6V8GC; + INFOPLIST_FILE = DummyProjectTests/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 13.2; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = godot.spike.DummyProjectTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/DummyProject.app/DummyProject"; + }; + name = Debug; + }; + 0BC86D302BF4E14000501F94 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 3525W6V8GC; + INFOPLIST_FILE = DummyProjectTests/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 13.2; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = godot.spike.DummyProjectTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/DummyProject.app/DummyProject"; + }; + name = Release; + }; + 0BC86D322BF4E14000501F94 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 3525W6V8GC; + INFOPLIST_FILE = DummyProjectUITests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = godot.spike.DummyProjectUITests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_TARGET_NAME = DummyProject; + }; + name = Debug; + }; + 0BC86D332BF4E14000501F94 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 3525W6V8GC; + INFOPLIST_FILE = DummyProjectUITests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = godot.spike.DummyProjectUITests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_TARGET_NAME = DummyProject; + }; + name = Release; + }; + /* End XCBuildConfiguration section */ + + /* Begin XCConfigurationList section */ + 0BC86CFC2BF4E13F00501F94 /* Build configuration list for PBXProject "DummyProject" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 0BC86D292BF4E14000501F94 /* Debug */, + 0BC86D2A2BF4E14000501F94 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 0BC86D2B2BF4E14000501F94 /* Build configuration list for PBXNativeTarget "DummyProject" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 0BC86D2C2BF4E14000501F94 /* Debug */, + 0BC86D2D2BF4E14000501F94 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 0BC86D2E2BF4E14000501F94 /* Build configuration list for PBXNativeTarget "DummyProjectTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 0BC86D2F2BF4E14000501F94 /* Debug */, + 0BC86D302BF4E14000501F94 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 0BC86D312BF4E14000501F94 /* Build configuration list for PBXNativeTarget "DummyProjectUITests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 0BC86D322BF4E14000501F94 /* Debug */, + 0BC86D332BF4E14000501F94 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + /* End XCConfigurationList section */ + }; + rootObject = 0BC86CF92BF4E13F00501F94 /* 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 + ls + cat DummyProject.xcodeproj/project.pbxproj + 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 diff --git a/export/macos/.gitkeep b/export/macos/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/godot/rust.gdextension b/godot/rust.gdextension index bc7aa54..d78f2ae 100644 --- a/godot/rust.gdextension +++ b/godot/rust.gdextension @@ -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/aarch64-apple-ios/debug/libgodot_plugin.dylib" +ios.release.arm64 = "res://../rust/target/aarch64-apple-ios/release/libgodot_plugin.dylib" diff --git a/justfile b/justfile index e30eb0a..d555037 100644 --- a/justfile +++ b/justfile @@ -56,19 +56,20 @@ windows-release: [macos] macos-debug: - {{rustdir}} cargo build + {{rustdir}} cargo build {{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" + {{godotdir}} godot --headless --import --export-debug "iOS" "../export/ios/Godot Spike.ipa" [macos] ios-release: @@ -82,7 +83,6 @@ setup: just _setup-verify-dependencies _setup-precommit _setup-rust setup-{{os()}} # ------------------------------------------------- -# Execute to verify if all dependencies are installed _setup-verify-dependencies: @ {{message}} "Verifying all required programs are installed...\nAll programs need to be in \$PATH!" rustup --version @@ -106,7 +106,7 @@ setup-windows: rustup target add x86_64-pc-windows-gnu [macos] -setup-macos: +setup-ios: @ {{message}} "Installing Rust tools for iOS builds..." rustup target add aarch64-apple-ios cargo install cargo-lipo