Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: extrawurst
42 changes: 42 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -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
10 changes: 8 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand All @@ -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/
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