From 3e4d593ab2bd283c4e80c54b158cd4f110412bbc Mon Sep 17 00:00:00 2001 From: extrawurst Date: Thu, 2 May 2024 14:30:08 +0200 Subject: [PATCH 01/12] wip --- .github/FUNDING.yml | 1 + .github/workflows/ci.yml | 30 ++++++++++++++++++++++++++++++ Makefile | 6 +++++- 3 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 .github/FUNDING.yml create mode 100644 .github/workflows/ci.yml 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..a603dbb --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,30 @@ +name: CI + +on: + push: + branches: [ '*' ] + +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: Build + run: make build-rust + + - name: Archive + run: make zip + + - uses: actions/upload-artifact@v4 + with: + name: XCFramework Archive + path: ./RustXcframework.xcframework.zip diff --git a/Makefile b/Makefile index c201818..910abd8 100644 --- a/Makefile +++ b/Makefile @@ -24,4 +24,8 @@ 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/ + +zip: + zip -r RustXcframework.xcframework.zip ./RustXcframework.xcframework/ + ls -lisah RustXcframework.xcframework.zip \ No newline at end of file From 7464d6b374a780157d7513481e64b087006ca2bc Mon Sep 17 00:00:00 2001 From: extrawurst Date: Thu, 2 May 2024 14:35:59 +0200 Subject: [PATCH 02/12] fix --- .github/workflows/ci.yml | 5 +---- Makefile | 4 +++- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a603dbb..15f82ab 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,12 +19,9 @@ jobs: run: rustup target add aarch64-apple-ios aarch64-apple-ios-sim x86_64-apple-ios - name: Build - run: make build-rust - - - name: Archive run: make zip - uses: actions/upload-artifact@v4 with: - name: XCFramework Archive + name: RustXcframework.xcframework.zip path: ./RustXcframework.xcframework.zip diff --git a/Makefile b/Makefile index 910abd8..00d1686 100644 --- a/Makefile +++ b/Makefile @@ -25,7 +25,9 @@ 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/ + ls -lisah ./RustXcframework.xcframework/ios-arm64/ + ls -lisah ./RustXcframework.xcframework/ios-arm64_x86_64-simulator -zip: +zip: build-release zip -r RustXcframework.xcframework.zip ./RustXcframework.xcframework/ ls -lisah RustXcframework.xcframework.zip \ No newline at end of file From abc46806bcd0820b90ab9d531d1c83c4405df589 Mon Sep 17 00:00:00 2001 From: extrawurst Date: Thu, 2 May 2024 14:44:46 +0200 Subject: [PATCH 03/12] use sed --- .github/workflows/ci.yml | 2 +- Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 15f82ab..d3e2248 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: - name: Add iOS targets run: rustup target add aarch64-apple-ios aarch64-apple-ios-sim x86_64-apple-ios - - name: Build + - name: make xcframework archive run: make zip - uses: actions/upload-artifact@v4 diff --git a/Makefile b/Makefile index 00d1686..03b1b27 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/ From 859a7bcc9b6ae501dee164c16c712780cfecd3da Mon Sep 17 00:00:00 2001 From: extrawurst Date: Thu, 2 May 2024 14:47:06 +0200 Subject: [PATCH 04/12] test sed version --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d3e2248..fbdc543 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,6 +18,9 @@ jobs: - name: Add iOS targets run: rustup target add aarch64-apple-ios aarch64-apple-ios-sim x86_64-apple-ios + - name: test sed + run: sed --version + - name: make xcframework archive run: make zip From 0be1339a4cc50e8fce55be0c8c0c5002a1094683 Mon Sep 17 00:00:00 2001 From: extrawurst Date: Thu, 2 May 2024 14:53:34 +0200 Subject: [PATCH 05/12] fix sed usage on mac --- .github/workflows/ci.yml | 3 --- Makefile | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fbdc543..d3e2248 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,9 +18,6 @@ jobs: - name: Add iOS targets run: rustup target add aarch64-apple-ios aarch64-apple-ios-sim x86_64-apple-ios - - name: test sed - run: sed --version - - name: make xcframework archive run: make zip diff --git a/Makefile b/Makefile index 03b1b27..f48f9e3 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ build-rust: ./bevy_ios_iap/build-rust.sh copy-generated: - sed -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/ From 78f218172ce1abe368640ac1da9538276e4e8108 Mon Sep 17 00:00:00 2001 From: extrawurst Date: Thu, 2 May 2024 15:03:48 +0200 Subject: [PATCH 06/12] test release --- .github/workflows/ci.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d3e2248..35f7785 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,14 @@ jobs: - name: make xcframework archive run: make zip - - uses: actions/upload-artifact@v4 + # - uses: actions/upload-artifact@v4 + # with: + # name: RustXcframework.xcframework.zip + # path: ./RustXcframework.xcframework.zip + + - name: Release + uses: softprops/action-gh-release@v2 with: - name: RustXcframework.xcframework.zip - path: ./RustXcframework.xcframework.zip + # prerelease: ${{ contains(github.ref, '-') }} + files: | + ./RustXcframework.xcframework.zip \ No newline at end of file From 1dbcf1e72223ee8829b09c6c9d92fb02fa2d87ef Mon Sep 17 00:00:00 2001 From: extrawurst Date: Thu, 2 May 2024 15:10:43 +0200 Subject: [PATCH 07/12] try using caching --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 35f7785..c861761 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,6 +18,9 @@ jobs: - 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 + - name: make xcframework archive run: make zip From 9dbce3ec97e97f16b073bd07d1e009007f19df24 Mon Sep 17 00:00:00 2001 From: extrawurst Date: Thu, 2 May 2024 15:11:39 +0200 Subject: [PATCH 08/12] only release on a tag --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c861761..5c1b159 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,6 +31,7 @@ jobs: - name: Release uses: softprops/action-gh-release@v2 + if: startsWith(github.ref, 'refs/tags/') with: # prerelease: ${{ contains(github.ref, '-') }} files: | From 527cf774a1f867945e96b9be6a109ee56b59bd26 Mon Sep 17 00:00:00 2001 From: extrawurst Date: Thu, 2 May 2024 15:16:29 +0200 Subject: [PATCH 09/12] tag ci --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5c1b159..555b72d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,6 +3,8 @@ name: CI on: push: branches: [ '*' ] + tags: + - '*' env: CARGO_TERM_COLOR: always From 5279a23507c342f029e0138a0a8c554c0dd5f915 Mon Sep 17 00:00:00 2001 From: extrawurst Date: Thu, 2 May 2024 15:19:33 +0200 Subject: [PATCH 10/12] try fixing caching --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 555b72d..3199d6e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,6 +22,8 @@ jobs: - name: Rust Cache uses: Swatinem/rust-cache@v2 + with: + workspaces: "bevy_ios_iap/Cargo.toml" - name: make xcframework archive run: make zip From 5a170867423ee1b4ab1de878101908b8fb0788af Mon Sep 17 00:00:00 2001 From: extrawurst Date: Thu, 2 May 2024 15:21:34 +0200 Subject: [PATCH 11/12] try fixing caching --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3199d6e..f6c4f96 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,7 @@ jobs: - name: Rust Cache uses: Swatinem/rust-cache@v2 with: - workspaces: "bevy_ios_iap/Cargo.toml" + workspaces: "./bevy_ios_iap/Cargo.toml" - name: make xcframework archive run: make zip From 2ced58d60dd7266a3564bfd569a80082057ca42c Mon Sep 17 00:00:00 2001 From: extrawurst Date: Thu, 2 May 2024 15:22:45 +0200 Subject: [PATCH 12/12] try fixing caching --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f6c4f96..ef40318 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,7 @@ jobs: - name: Rust Cache uses: Swatinem/rust-cache@v2 with: - workspaces: "./bevy_ios_iap/Cargo.toml" + workspaces: "./bevy_ios_iap" - name: make xcframework archive run: make zip