diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..1e360f4 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1 @@ +github: extrawurst \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..ef40318 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,42 @@ +name: CI + +on: + push: + branches: [ '*' ] + tags: + - '*' + +env: + CARGO_TERM_COLOR: always + +jobs: + build: + runs-on: macos-latest + + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + + - name: Add iOS targets + run: rustup target add aarch64-apple-ios aarch64-apple-ios-sim x86_64-apple-ios + + - name: Rust Cache + uses: Swatinem/rust-cache@v2 + with: + workspaces: "./bevy_ios_iap" + + - name: make xcframework archive + run: make zip + + # - uses: actions/upload-artifact@v4 + # with: + # name: RustXcframework.xcframework.zip + # path: ./RustXcframework.xcframework.zip + + - name: Release + uses: softprops/action-gh-release@v2 + if: startsWith(github.ref, 'refs/tags/') + with: + # prerelease: ${{ contains(github.ref, '-') }} + files: | + ./RustXcframework.xcframework.zip \ No newline at end of file diff --git a/Makefile b/Makefile index c201818..f48f9e3 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ build-rust: ./bevy_ios_iap/build-rust.sh copy-generated: - gsed -i 's/func __swift_bridge__/public func __swift_bridge__/g' bevy_ios_iap/generated/bevy_ios_iap/bevy_ios_iap.swift + sed -i '' 's/func __swift_bridge__/public func __swift_bridge__/g' bevy_ios_iap/generated/bevy_ios_iap/bevy_ios_iap.swift echo "import RustXcframework "|cat - ./bevy_ios_iap/generated/SwiftBridgeCore.swift > /tmp/out && mv /tmp/out ./bevy_ios_iap/generated/SwiftBridgeCore.swift echo "import RustXcframework "|cat - ./bevy_ios_iap/generated/bevy_ios_iap/bevy_ios_iap.swift > /tmp/out && mv /tmp/out ./bevy_ios_iap/generated/bevy_ios_iap/bevy_ios_iap.swift cp ./bevy_ios_iap/generated/bevy_ios_iap/bevy_ios_iap.h ./RustXcframework.xcframework/ios-arm64/Headers/ @@ -24,4 +24,10 @@ build: build-rust copy-generated build-release: build-rust-release copy-generated cp ./bevy_ios_iap/target/universal-ios/release/libbevy_ios_iap.a ./RustXcframework.xcframework/ios-arm64_x86_64-simulator/ - cp ./bevy_ios_iap/target/aarch64-apple-ios/release/libbevy_ios_iap.a ./RustXcframework.xcframework/ios-arm64/ \ No newline at end of file + cp ./bevy_ios_iap/target/aarch64-apple-ios/release/libbevy_ios_iap.a ./RustXcframework.xcframework/ios-arm64/ + ls -lisah ./RustXcframework.xcframework/ios-arm64/ + ls -lisah ./RustXcframework.xcframework/ios-arm64_x86_64-simulator + +zip: build-release + zip -r RustXcframework.xcframework.zip ./RustXcframework.xcframework/ + ls -lisah RustXcframework.xcframework.zip \ No newline at end of file