From 71599f1f9d10a180a457f5d1a8a84ae579c31a83 Mon Sep 17 00:00:00 2001 From: micbakos-rdx Date: Thu, 22 Feb 2024 11:15:35 +0200 Subject: [PATCH] Separate workflows --- .github/workflows/release-jvm.yml | 88 +++++++++++++++++++++++++++++++ .github/workflows/release.yml | 88 ++++--------------------------- 2 files changed, 99 insertions(+), 77 deletions(-) create mode 100644 .github/workflows/release-jvm.yml diff --git a/.github/workflows/release-jvm.yml b/.github/workflows/release-jvm.yml new file mode 100644 index 000000000..892cc76a0 --- /dev/null +++ b/.github/workflows/release-jvm.yml @@ -0,0 +1,88 @@ +name: CD JVM + +on: + workflow_dispatch: + push: + branches: + - android + +permissions: + id-token: write + contents: write +env: + CARGO_TERM_COLOR: always +jobs: + build: + runs-on: ubuntu-latest + env: + RUST_TOOLCHAIN: nightly-2024-01-11 + RUST_COMPONENTS: "rust-std" + steps: + - uses: RDXWorks-actions/checkout@main + + - name: Install Rust Toolchain for aarch64-linux-android + uses: RDXWorks-actions/toolchain@master + with: + toolchain: ${{ env.RUST_TOOLCHAIN }} + components: ${{ env.RUST_COMPONENTS }} + target: aarch64-linux-android + + - name: Install Rust Toolchain for armv7-linux-androideabi + uses: RDXWorks-actions/toolchain@master + with: + toolchain: ${{ env.RUST_TOOLCHAIN }} + components: ${{ env.RUST_COMPONENTS }} + target: armv7-linux-androideabi + + - name: Install Rust Toolchain for aarch64-apple-darwin + uses: RDXWorks-actions/toolchain@master + with: + toolchain: ${{ env.RUST_TOOLCHAIN }} + components: ${{ env.RUST_COMPONENTS }} + target: aarch64-apple-darwin + + - name: Install Rust Toolchain for x86_64-apple-darwin + uses: RDXWorks-actions/toolchain@master + with: + toolchain: ${{ env.RUST_TOOLCHAIN }} + components: ${{ env.RUST_COMPONENTS }} + target: x86_64-apple-darwin + + - name: Set up JDK 17 + uses: RDXWorks-actions/setup-java@v3 + with: + distribution: 'adopt' + java-version: '17' + + - name: Setup Android SDK + uses: RDXWorks-actions/setup-android@v2 + + - name: Setup Android NDK + uses: RDXWorks-actions/setup-ndk@v1 + id: setup-ndk + with: + ndk-version: r25b + link-to-sdk: true + + - name: Setup Env Variables + env: + ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }} + run: | + echo "SARGON_VERSION=`git tag --sort=taggerdate | tail -1`" >> $GITHUB_ENV + + - name: Build and publish Android + uses: RDXWorks-actions/gradle-build-action@main + with: + arguments: sargon-android:publish + build-root-directory: jvm + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and publish Desktop binaries + uses: RDXWorks-actions/gradle-build-action@main + with: + arguments: sargon-desktop-bins:publish + build-root-directory: jvm + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1328f6364..8cd51a8b8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,4 @@ -name: CD +name: CD iOS on: workflow_dispatch: @@ -21,97 +21,31 @@ jobs: steps: - uses: RDXWorks-actions/checkout@main - # - name: Install Rust Toolchain for x86_64-apple-ios - # uses: RDXWorks-actions/toolchain@master - # with: - # toolchain: ${{ env.RUST_TOOLCHAIN }} - # components: ${{ env.RUST_COMPONENTS }} - # target: x86_64-apple-ios - - # - name: Install Rust Toolchain for aarch64-apple-ios - # uses: RDXWorks-actions/toolchain@master - # with: - # toolchain: ${{ env.RUST_TOOLCHAIN }} - # components: ${{ env.RUST_COMPONENTS }} - # target: aarch64-apple-ios - - # - name: Install Rust Toolchain for aarch64-apple-ios-sim - # uses: RDXWorks-actions/toolchain@master - # with: - # toolchain: ${{ env.RUST_TOOLCHAIN }} - # components: ${{ env.RUST_COMPONENTS }} - # target: aarch64-apple-ios-sim - - # - name: Run iOS build script - # env: - # GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # run: | - # rustup target add x86_64-apple-ios aarch64-apple-ios aarch64-apple-ios-sim - # sh ./scripts/ios/release.sh - - - name: Install Rust Toolchain for aarch64-linux-android + - name: Install Rust Toolchain for x86_64-apple-ios uses: RDXWorks-actions/toolchain@master with: toolchain: ${{ env.RUST_TOOLCHAIN }} components: ${{ env.RUST_COMPONENTS }} - target: aarch64-linux-android - - - name: Install Rust Toolchain for armv7-linux-androideabi - uses: RDXWorks-actions/toolchain@master - with: - toolchain: ${{ env.RUST_TOOLCHAIN }} - components: ${{ env.RUST_COMPONENTS }} - target: armv7-linux-androideabi + target: x86_64-apple-ios - - name: Install Rust Toolchain for aarch64-apple-darwin + - name: Install Rust Toolchain for aarch64-apple-ios uses: RDXWorks-actions/toolchain@master with: toolchain: ${{ env.RUST_TOOLCHAIN }} components: ${{ env.RUST_COMPONENTS }} - target: aarch64-apple-darwin + target: aarch64-apple-ios - - name: Install Rust Toolchain for x86_64-apple-darwin + - name: Install Rust Toolchain for aarch64-apple-ios-sim uses: RDXWorks-actions/toolchain@master with: toolchain: ${{ env.RUST_TOOLCHAIN }} components: ${{ env.RUST_COMPONENTS }} - target: x86_64-apple-darwin - - - name: Set up JDK 17 - uses: RDXWorks-actions/setup-java@v3 - with: - distribution: 'adopt' - java-version: '17' - - - name: Setup Android SDK - uses: RDXWorks-actions/setup-android@v2 - - - name: Setup Android NDK - uses: RDXWorks-actions/setup-ndk@v1 - id: setup-ndk - with: - ndk-version: r25b - link-to-sdk: true + target: aarch64-apple-ios-sim - - name: Setup Env Variables + - name: Run iOS build script env: - ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - echo "SARGON_VERSION=`git tag --sort=taggerdate | tail -1`" >> $GITHUB_ENV - - - name: Build and publish Android - uses: RDXWorks-actions/gradle-build-action@main - with: - arguments: sargon-android:publish - build-root-directory: jvm - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Build and publish Desktop binaries - uses: RDXWorks-actions/gradle-build-action@main - with: - arguments: sargon-desktop-bins:publish - build-root-directory: jvm - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + rustup target add x86_64-apple-ios aarch64-apple-ios aarch64-apple-ios-sim + sh ./scripts/ios/release.sh \ No newline at end of file