Tauri v2
This workflow is specifically tailored to Tauri v2 applications. It can be easily adapted to work with any Tauri app and only requires the your project’s slug within your CrabNebula organization as an input. Instead of just uploading assets (like in the previous workflow), the build
job builds the Tauri app automatically for Linux, MacOS, and Windows. and uploads the assets directly afterwards.
Versionining
The release version number is automatically extracted from Tauri configuration files (tauri.conf.json
). The version entries in Cargo.toml
and package.json
will be ignored for your project release in CrabNebula and thus can be removed/ommitted.
Code Signing
For security reasons, it’s recommended to sign your code by generating a private key and a private key password for your app. Passing those keys via the environment variables (TAURI_SIGNING_PRIVATE_KEY
and TAURI_SIGNING_PRIVATE_KEY_PASSWORD
) to your tauri build
command will be enough. See the Tauri Docs for more details.
Workflow Triggers
For testing and developing purposes it may be useful to set a workflow_dispatch
trigger, so the workflow can be initiated from the GitHub UI.
run-name: triggered by ${{ github.actor }}.on: workflow_dispatch
Once testing is done, it’s recommended to use Continuous Deployment.
on: push: branches: - main
Deploy Platforms
When deploying to multiple platforms, it’s useful to make builds concurrent. Also, cancelling ongoing processes when a new workflow starts.
concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true
Jobs
The following section snippets must be added in the jobs
map.
jobs: <job-name>: <job-snippet>
Note that the indentation is important.
Draft Release
The release draft command will create a new entry in your CrabNebula project, but it won’t upload any assets just yet. It uses the crabnebula-dev/cloud-release action, which requires CN_API_KEY
to be defined within your GitHub Action scope.
Because we’ll refer to this later on as well, we’ll store our application name in env
first.
env: # ... CN_APPLICATION: "YOUR_ORG_NAME/YOUR_APP_NAME"
And then call the release draft command.
draft: runs-on: ubuntu-22.04
steps: - uses: actions/checkout@v4 - name: create draft release uses: crabnebula-dev/cloud-release@v0 with: command: release draft ${{ env.CN_APPLICATION }} --framework tauri api-key: ${{ secrets.CN_API_KEY }}
Build Your App
The build step is for setting up the GitHub Action runner in which our task will run for each platform, and finally run your app’s build to create the Tauri binaries.
Establish the dependencies and the matrix of platforms we want to run concurrently. Add the common dependencies (Rust, and Node.js), create a cache for Rust, build the binaries and upload the artifacts.
build_desktop: needs: draft
strategy: fail-fast: false matrix: os: - ubuntu-22.04 - macos-latest - windows-latest
runs-on: ${{ matrix.os }}
steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 - name: Install stable toolchain uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable cache: true
build_desktop: needs: draft
strategy: fail-fast: false matrix: os: - ubuntu-22.04 - macos-latest - windows-latest
runs-on: ${{ matrix.os }}
steps: - uses: actions/checkout@v4 - name: Install pnpm uses: pnpm/action-setup@v3 with: version: 9 - uses: actions/setup-node@v4 with: node-version: "lts/*" - name: Install stable toolchain uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable cache: true
Linux and Windows
Linux distros require additional system dependencies. For Tauri v2 we need webkit2gtk-4.1
, that’s the WebView our frontend will be running in.
- name: install Linux dependencies if: matrix.os == 'ubuntu-22.04' run: | sudo apt-get update sudo apt-get install -y webkit2gtk-4.1
With dependencies setup for Linux, it’s time to build the Tauri app for Windows and Linux.
- name: build Tauri app for Windows, Linux if: matrix.os != 'macos-latest' run: | npm ci npm exec tauri build env: TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
- name: build Tauri app for Windows, Linux if: matrix.os != 'macos-latest' run: | pnpm install pnpm tauri build env: TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
- name: build Tauri app for Windows, Linux if: matrix.os != 'macos-latest' run: | yarn install --frozen-lockfile yarn tauri build env: TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
MacOS
GitHub Actions run on Apple Silicon by default, so we must add Mac Intel support to our platform and establish the appropriate target to our Tauri CLI.
- name: Install x86_64-apple-darwin for mac and build Tauri binaries if: matrix.os == 'macos-latest' run: | rustup target add x86_64-apple-darwin npm ci npm exec tauri build -- --target x86_64-apple-darwin npm exec tauri build -- --target aarch64-apple-darwin env: TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
- name: Install x86_64-apple-darwin for mac and build Tauri binaries if: matrix.os == 'macos-latest' run: | rustup target add x86_64-apple-darwin pnpm install --frozen-lockfile pnpm tauri build --target x86_64-apple-darwin pnpm tauri build --target aarch64-apple-darwin env: TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
- name: Install x86_64-apple-darwin for mac and build Tauri binaries if: matrix.os == 'macos-latest' run: | rustup target add x86_64-apple-darwin yarn install --frozen-lockfile yarn tauri build --target x86_64-apple-darwin yarn tauri build --target aarch64-apple-darwin env: TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
Upload Assets to Cloud
At the last step of our build, we push all assets to the Cloud project. At this point, you will be able to see the binaries showing up in your dashboard. But the release is not published yet!
- name: upload assets uses: crabnebula-dev/cloud-release@v0 with: command: release upload ${{ env.CN_APPLICATION }} --framework tauri api-key: ${{ secrets.CN_API_KEY }}
Mobile
If your application targets Android and iOS, we recommend defining separate jobs per platform so your workflow is easier to read.
Android
-
Create the job and install Rust and Node.js
build_android:needs: draftruns-on: ubuntu-lateststeps:- uses: actions/checkout@v4- uses: actions/setup-node@v4with:node-version: "lts/*"- name: Install stable toolchainuses: actions-rust-lang/setup-rust-toolchain@v1with:toolchain: stablecache: true -
Install Android dependencies
- name: setup JDK 17uses: actions/setup-java@v4with:java-version: "17"distribution: "temurin"- name: setup Android SDKuses: android-actions/setup-android@v3- name: setup Android NDKuses: nttld/setup-ndk@v1id: setup-ndkwith:ndk-version: r26dlink-to-sdk: true- name: install Android targetsrun: rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android -
Setup Android signing
See the official documentation for more information.
- name: setup Android signingworking-directory: src-tauri/gen/androidrun: |echo "keyAlias=${{ secrets.ANDROID_KEY_ALIAS }}" > keystore.propertiesecho "password=${{ secrets.ANDROID_KEY_PASSWORD }}" >> keystore.propertiesbase64 -d <<< "${{ secrets.ANDROID_KEY_BASE64 }}" > $RUNNER_TEMP/keystore.jksecho "storeFile=$RUNNER_TEMP/keystore.jks" >> keystore.properties -
Build the Android application
- name: build Tauri app for Androidenv:NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}run: |npm cinpm run tauri android build- name: Install pnpmuses: pnpm/action-setup@v3with:version: 9- name: build Tauri app for Androidenv:NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}run: |pnpm installpnpm tauri android build- name: build Tauri app for Androidenv:NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}run: |yarn installyarn tauri android build -
Upload to CrabNebula Cloud
- name: upload assetsuses: crabnebula-dev/cloud-release@v0with:command: release upload ${{ env.CN_APPLICATION }} --framework tauriapi-key: ${{ secrets.CN_API_KEY }}
iOS
-
Create the job and install Rust and Node.js
build_ios:needs: draftruns-on: macos-lateststeps:- uses: actions/checkout@v4- uses: actions/setup-node@v4with:node-version: "lts/*"- name: Install stable toolchainuses: actions-rust-lang/setup-rust-toolchain@v1with:toolchain: stablecache: true- name: install iOS targetrun: rustup target add aarch64-apple-ios -
Install iOS dependencies
- name: setup xcodeuses: maxim-lobanov/setup-xcode@v1with:xcode-version: latest-stable -
Setup iOS signing
See the official documentation for more information.
- name: setup Apple API keyrun: |APPLE_API_KEY_PATH="$RUNNER_TEMP/AuthKey_${{ secrets.APPLE_API_KEY_ID }}.p8"echo "${{ secrets.APPLE_API_KEY }}" > $APPLE_API_KEY_PATHecho "APPLE_API_KEY_PATH=$APPLE_API_KEY_PATH" >> $GITHUB_ENVecho "API_PRIVATE_KEYS_DIR=$RUNNER_TEMP" >> $GITHUB_ENV -
Build the iOS application
- name: build Tauri app for iOSenv:APPLE_API_KEY: ${{ secrets.APPLE_API_KEY_ID }}APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }}APPLE_DEVELOPMENT_TEAM: <ENTER TEAM HERE>run: |npm cinpm run tauri ios build --export-method app-store-connect- name: Install pnpmuses: pnpm/action-setup@v3with:version: 9- name: build Tauri app for iOSenv:APPLE_API_KEY: ${{ secrets.APPLE_API_KEY_ID }}APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }}APPLE_DEVELOPMENT_TEAM: <ENTER TEAM HERE>run: |pnpm installpnpm tauri ios build --export-method app-store-connect- name: build Tauri app for iOSenv:APPLE_API_KEY: ${{ secrets.APPLE_API_KEY_ID }}APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }}APPLE_DEVELOPMENT_TEAM: <ENTER TEAM HERE>run: |yarn installyarn tauri ios build --export-method app-store-connect -
Upload to CrabNebula Cloud
- name: upload assetsuses: crabnebula-dev/cloud-release@v0with:command: release upload ${{ env.CN_APPLICATION }} --framework tauriapi-key: ${{ secrets.CN_API_KEY }}
Publishing
At this point, the heavy lifting has been done and it’s time ot publish the release. If you don’t want to autopublish, you can do it manually from the Cloud dashboard.
publish: needs: [build_desktop, build_android, build_ios]
runs-on: ubuntu-22.04
steps: - uses: actions/checkout@v4
- name: publish release uses: crabnebula-dev/cloud-release@v0 with: command: release publish ${{ env.CN_APPLICATION }} --framework tauri api-key: ${{ secrets.CN_API_KEY }}
Full Workflow
name: Tauri v2 Release Processon: push: branches: - main
concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true
env: CN_APPLICATION: "YOUR_ORG_NAME/YOUR_APP_NAME"
jobs: draft: runs-on: ubuntu-22.04
steps: - uses: actions/checkout@v4 - name: create draft release uses: crabnebula-dev/cloud-release@v0 with: command: release draft ${{ env.CN_APPLICATION }} --framework tauri api-key: ${{ secrets.CN_API_KEY }}
build_desktop: needs: draft
strategy: fail-fast: false matrix: include: - os: ubuntu-22.04 - os: macos-latest - os: windows-latest
runs-on: ${{ matrix.os }}
steps: - uses: actions/checkout@v4
- uses: actions/setup-node@v4 with: node-version: "lts/*"
- name: Install stable toolchain uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable cache: true
- name: install Linux dependencies if: matrix.os == 'ubuntu-22.04' run: | sudo apt-get update sudo apt-get install -y webkit2gtk-4.1
- name: build Tauri app for Windows, Linux if: matrix.os != 'macos-latest' run: | npm ci npm exec tauri build env: TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
- name: Install x86_64-apple-darwin target for mac and build Tauri binaries if: matrix.os == 'macos-latest' run: | rustup target add x86_64-apple-darwin npm ci npm exec tauri build -- --target x86_64-apple-darwin npm exec tauri build -- --target aarch64-apple-darwin env: TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
- name: upload assets uses: crabnebula-dev/cloud-release@v0 with: command: release upload ${{ env.CN_APPLICATION }} --framework tauri api-key: ${{ secrets.CN_API_KEY }}
build_android: needs: draft
runs-on: ubuntu-latest
steps: - uses: actions/checkout@v4
- uses: actions/setup-node@v4 with: node-version: "lts/*"
- name: Install stable toolchain uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable cache: true
- name: setup JDK 17 uses: actions/setup-java@v4 with: java-version: "17" distribution: "temurin"
- name: setup Android SDK uses: android-actions/setup-android@v3
- name: setup Android NDK uses: nttld/setup-ndk@v1 id: setup-ndk with: ndk-version: r26d link-to-sdk: true
- name: install Android targets run: rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android
- name: setup Android signing working-directory: src-tauri/gen/android run: | echo "keyAlias=${{ secrets.ANDROID_KEY_ALIAS }}" > keystore.properties echo "password=${{ secrets.ANDROID_KEY_PASSWORD }}" >> keystore.properties base64 -d <<< "${{ secrets.ANDROID_KEY_BASE64 }}" > $RUNNER_TEMP/keystore.jks echo "storeFile=$RUNNER_TEMP/keystore.jks" >> keystore.properties
- name: build Tauri app for Android env: NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }} run: | npm ci npm run tauri android build
- name: upload assets uses: crabnebula-dev/cloud-release@v0 with: command: release upload ${{ env.CN_APPLICATION }} --framework tauri api-key: ${{ secrets.CN_API_KEY }}
build_ios: needs: draft
runs-on: macos-latest
steps: - uses: actions/checkout@v4
- uses: actions/setup-node@v4 with: node-version: "lts/*"
- name: Install stable toolchain uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable cache: true
- name: install iOS target run: rustup target add aarch64-apple-ios
- name: setup xcode uses: maxim-lobanov/setup-xcode@v1 with: xcode-version: latest-stable
- name: setup Apple API key run: | APPLE_API_KEY_PATH="$RUNNER_TEMP/AuthKey_${{ secrets.APPLE_API_KEY_ID }}.p8" echo "${{ secrets.APPLE_API_KEY }}" > $APPLE_API_KEY_PATH echo "APPLE_API_KEY_PATH=$APPLE_API_KEY_PATH" >> $GITHUB_ENV echo "API_PRIVATE_KEYS_DIR=$RUNNER_TEMP" >> $GITHUB_ENV
- name: build Tauri app for iOS env: APPLE_API_KEY: ${{ secrets.APPLE_API_KEY_ID }} APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }} APPLE_DEVELOPMENT_TEAM: <ENTER TEAM HERE> run: | npm ci npm run tauri ios build --export-method app-store-connect
- name: upload assets uses: crabnebula-dev/cloud-release@v0 with: command: release upload ${{ env.CN_APPLICATION }} --framework tauri api-key: ${{ secrets.CN_API_KEY }}
publish: needs: [build_desktop, build_android, build_ios]
runs-on: ubuntu-22.04
steps: - uses: actions/checkout@v4
- name: publish release uses: crabnebula-dev/cloud-release@v0 with: command: release publish ${{ env.CN_APPLICATION }} --framework tauri api-key: ${{ secrets.CN_API_KEY }}
name: Tauri v2 Release Processon: push: branches: - main
concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true
env: CN_APPLICATION: "YOUR_ORG_NAME/YOUR_APP_NAME"
jobs: draft: runs-on: ubuntu-22.04
steps: - uses: actions/checkout@v4 - name: create draft release uses: crabnebula-dev/cloud-release@v0 with: command: release draft ${{ env.CN_APPLICATION }} --framework tauri api-key: ${{ secrets.CN_API_KEY }}
build_desktop: needs: draft
strategy: fail-fast: false matrix: os: - ubuntu-22.04 - macos-latest - windows-latest
runs-on: ${{ matrix.os }}
steps: - uses: actions/checkout@v4 - name: Install pnpm uses: pnpm/action-setup@v3 with: version: 9 - uses: actions/setup-node@v4 with: node-version: "lts/*" - name: Install stable toolchain uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable cache: true
- name: install Linux dependencies if: matrix.os == 'ubuntu-22.04' run: | sudo apt-get update sudo apt-get install -y webkit2gtk-4.1
- name: build Tauri app for Windows, Linux if: matrix.os != 'macos-latest' run: | pnpm install pnpm tauri build env: TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
- name: Install x86_64-apple-darwin for mac and build Tauri binaries if: matrix.os == 'macos-latest' run: | rustup target add x86_64-apple-darwin pnpm install pnpm tauri build --target x86_64-apple-darwin pnpm tauri build --target aarch64-apple-darwin env: TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
- name: upload assets uses: crabnebula-dev/cloud-release@v0 with: command: release upload ${{ env.CN_APPLICATION }} --framework tauri api-key: ${{ secrets.CN_API_KEY }}
build_android: needs: draft
runs-on: ubuntu-latest
steps: - uses: actions/checkout@v4
- uses: actions/setup-node@v4 with: node-version: "lts/*"
- name: Install stable toolchain uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable cache: true
- name: setup JDK 17 uses: actions/setup-java@v4 with: java-version: "17" distribution: "temurin"
- name: setup Android SDK uses: android-actions/setup-android@v3
- name: setup Android NDK uses: nttld/setup-ndk@v1 id: setup-ndk with: ndk-version: r26d link-to-sdk: true
- name: install Android targets run: rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android
- name: setup Android signing working-directory: src-tauri/gen/android run: | echo "keyAlias=${{ secrets.ANDROID_KEY_ALIAS }}" > keystore.properties echo "password=${{ secrets.ANDROID_KEY_PASSWORD }}" >> keystore.properties base64 -d <<< "${{ secrets.ANDROID_KEY_BASE64 }}" > $RUNNER_TEMP/keystore.jks echo "storeFile=$RUNNER_TEMP/keystore.jks" >> keystore.properties
- name: Install pnpm uses: pnpm/action-setup@v3 with: version: 9
- name: build Tauri app for Android env: NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }} run: | pnpm install pnpm tauri android build
- name: upload assets uses: crabnebula-dev/cloud-release@v0 with: command: release upload ${{ env.CN_APPLICATION }} --framework tauri api-key: ${{ secrets.CN_API_KEY }}
build_ios: needs: draft
runs-on: macos-latest
steps: - uses: actions/checkout@v4
- uses: actions/setup-node@v4 with: node-version: "lts/*"
- name: Install stable toolchain uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable cache: true
- name: install iOS target run: rustup target add aarch64-apple-ios
- name: setup xcode uses: maxim-lobanov/setup-xcode@v1 with: xcode-version: latest-stable
- name: setup Apple API key run: | APPLE_API_KEY_PATH="$RUNNER_TEMP/AuthKey_${{ secrets.APPLE_API_KEY_ID }}.p8" echo "${{ secrets.APPLE_API_KEY }}" > $APPLE_API_KEY_PATH echo "APPLE_API_KEY_PATH=$APPLE_API_KEY_PATH" >> $GITHUB_ENV echo "API_PRIVATE_KEYS_DIR=$RUNNER_TEMP" >> $GITHUB_ENV
- name: Install pnpm uses: pnpm/action-setup@v3 with: version: 9
- name: build Tauri app for iOS env: APPLE_API_KEY: ${{ secrets.APPLE_API_KEY_ID }} APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }} APPLE_DEVELOPMENT_TEAM: <ENTER TEAM HERE> run: | pnpm install pnpm tauri ios build --export-method app-store-connect
- name: upload assets uses: crabnebula-dev/cloud-release@v0 with: command: release upload ${{ env.CN_APPLICATION }} --framework tauri api-key: ${{ secrets.CN_API_KEY }}
publish: needs: [build_desktop, build_android, build_ios]
runs-on: ubuntu-22.04
steps: - uses: actions/checkout@v4
- name: publish release uses: crabnebula-dev/cloud-release@v0 with: command: release publish ${{ env.CN_APPLICATION }} --framework tauri api-key: ${{ secrets.CN_API_KEY }}
name: Tauri v2 Release Processon: push: branches: - main
concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true
env: CN_APPLICATION: "YOUR_ORG_NAME/YOUR_APP_NAME"
jobs: draft: runs-on: ubuntu-22.04
steps: - uses: actions/checkout@v4 - name: create draft release uses: crabnebula-dev/cloud-release@v0 with: command: release draft ${{ env.CN_APPLICATION }} --framework tauri api-key: ${{ secrets.CN_API_KEY }}
build_desktop: needs: draft
strategy: fail-fast: false matrix: os: - ubuntu-22.04 - macos-latest - windows-latest
runs-on: ${{ matrix.os }}
steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: "lts/*" - name: Install stable toolchain uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable cache: true
- name: install Linux dependencies if: matrix.os == 'ubuntu-22.04' run: | sudo apt-get update sudo apt-get install -y webkit2gtk-4.1
- name: build Tauri app for Windows, Linux if: matrix.os != 'macos-latest' run: | yarn install --frozen-lockfile yarn tauri build env: TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
- name: Install x86_64-apple-darwin for mac and build Tauri binaries if: matrix.os == 'macos-latest' run: | rustup target add x86_64-apple-darwin yarn install --frozen-lockfile yarn tauri build --target x86_64-apple-darwin yarn tauri build --target aarch64-apple-darwin env: TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
- name: upload assets uses: crabnebula-dev/cloud-release@v0 with: command: release upload ${{ env.CN_APPLICATION }} --framework tauri api-key: ${{ secrets.CN_API_KEY }}
build_android: needs: draft
runs-on: ubuntu-latest
steps: - uses: actions/checkout@v4
- uses: actions/setup-node@v4 with: node-version: "lts/*"
- name: Install stable toolchain uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable cache: true
- name: setup JDK 17 uses: actions/setup-java@v4 with: java-version: "17" distribution: "temurin"
- name: setup Android SDK uses: android-actions/setup-android@v3
- name: setup Android NDK uses: nttld/setup-ndk@v1 id: setup-ndk with: ndk-version: r26d link-to-sdk: true
- name: install Android targets run: rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android
- name: setup Android signing working-directory: src-tauri/gen/android run: | echo "keyAlias=${{ secrets.ANDROID_KEY_ALIAS }}" > keystore.properties echo "password=${{ secrets.ANDROID_KEY_PASSWORD }}" >> keystore.properties base64 -d <<< "${{ secrets.ANDROID_KEY_BASE64 }}" > $RUNNER_TEMP/keystore.jks echo "storeFile=$RUNNER_TEMP/keystore.jks" >> keystore.properties
- name: build Tauri app for Android env: NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }} run: | yarn install yarn tauri android build
- name: upload assets uses: crabnebula-dev/cloud-release@v0 with: command: release upload ${{ env.CN_APPLICATION }} --framework tauri api-key: ${{ secrets.CN_API_KEY }}
build_ios: needs: draft
runs-on: macos-latest
steps: - uses: actions/checkout@v4
- uses: actions/setup-node@v4 with: node-version: "lts/*"
- name: Install stable toolchain uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable cache: true
- name: install iOS target run: rustup target add aarch64-apple-ios
- name: setup xcode uses: maxim-lobanov/setup-xcode@v1 with: xcode-version: latest-stable
- name: setup Apple API key run: | APPLE_API_KEY_PATH="$RUNNER_TEMP/AuthKey_${{ secrets.APPLE_API_KEY_ID }}.p8" echo "${{ secrets.APPLE_API_KEY }}" > $APPLE_API_KEY_PATH echo "APPLE_API_KEY_PATH=$APPLE_API_KEY_PATH" >> $GITHUB_ENV echo "API_PRIVATE_KEYS_DIR=$RUNNER_TEMP" >> $GITHUB_ENV
- name: build Tauri app for iOS env: APPLE_API_KEY: ${{ secrets.APPLE_API_KEY_ID }} APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }} APPLE_DEVELOPMENT_TEAM: <ENTER TEAM HERE> run: | yarn install yarn tauri ios build --export-method app-store-connect
- name: upload assets uses: crabnebula-dev/cloud-release@v0 with: command: release upload ${{ env.CN_APPLICATION }} --framework tauri api-key: ${{ secrets.CN_API_KEY }}
publish: needs: [build_desktop, build_android, build_ios]
runs-on: ubuntu-22.04
steps: - uses: actions/checkout@v4
- name: publish release uses: crabnebula-dev/cloud-release@v0 with: command: release publish ${{ env.CN_APPLICATION }} --framework tauri api-key: ${{ secrets.CN_API_KEY }}