This workflow is specifically tailored to Tauri v1 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.
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.
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_PRIVATE_KEY
and TAURI_KEY_PASSWORD
) to your tauri build
command will be enough. See the Tauri Docs for more details.
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 }}.
Once testing is done, it’s recommended to use Continuous Deployment.
When deploying to multiple platforms, it’s useful to make builds concurrent. Also, cancelling ongoing processes when a new workflow starts.
group : ${{ github.workflow }}-${{ github.ref }}
The following section snippets must be added in the jobs
map.
<job-name> : <job-snippet>
Note that the indentation is important.
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.
CN_APPLICATION : " YOUR_ORG_NAME/YOUR_APP_NAME "
And then call the release draft command.
- uses : actions/checkout@v4
- name : create draft release
uses : crabnebula-dev/cloud-release@v0
command : release draft ${{ env.CN_APPLICATION }} --framework tauri
api-key : ${{ secrets.CN_API_KEY }}
The build step is for setting up the container image 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.
runs-on : ${{ matrix.os }}
- uses : actions/checkout@v4
- uses : actions/setup-node@v4
- name : Install stable toolchain
uses : actions-rust-lang/setup-rust-toolchain@v1
runs-on : ${{ matrix.os }}
- uses : actions/checkout@v4
uses : pnpm/action-setup@v3
- uses : actions/setup-node@v4
- name : Install stable toolchain
uses : actions-rust-lang/setup-rust-toolchain@v1
Linux distros require additional system dependencies. For Tauri v1 we need webkit2gtk-4.0
, that’s the WebView our frontend will be running in.
- name : install Linux dependencies
if : matrix.os == 'ubuntu-20.04'
sudo apt-get install -y webkit2gtk-4.0
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'
TAURI_PRIVATE_KEY : ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_KEY_PASSWORD : ${{ secrets.TAURI_KEY_PASSWORD }}
- name : build Tauri app for Windows, Linux
if : matrix.os != 'macos-latest'
TAURI_PRIVATE_KEY : ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_KEY_PASSWORD : ${{ secrets.TAURI_KEY_PASSWORD }}
- name : build Tauri app for Windows, Linux
if : matrix.os != 'macos-latest'
yarn install --frozen-lockfile
TAURI_PRIVATE_KEY : ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_KEY_PASSWORD : ${{ secrets.TAURI_KEY_PASSWORD }}
GitHub Actions run on Mac Sillicon 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'
rustup target add x86_64-apple-darwin
npm run tauri build -- --target x86_64-apple-darwin
npm run tauri build -- --target aarch64-apple-darwin
TAURI_PRIVATE_KEY : ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_KEY_PASSWORD : ${{ secrets.TAURI_KEY_PASSWORD }}
- name : Install x86_64-apple-darwin for mac and build Tauri binaries
if : matrix.os == 'macos-latest'
rustup target add x86_64-apple-darwin
pnpm tauri build --target x86_64-apple-darwin
pnpm tauri build --target aarch64-apple-darwin
TAURI_PRIVATE_KEY : ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_KEY_PASSWORD : ${{ secrets.TAURI_KEY_PASSWORD }}
- name : Install x86_64-apple-darwin for mac and build Tauri binaries
if : matrix.os == 'macos-latest'
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
TAURI_PRIVATE_KEY : ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_KEY_PASSWORD : ${{ secrets.TAURI_KEY_PASSWORD }}
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!
uses : crabnebula-dev/cloud-release@v0
command : release upload ${{ env.CN_APPLICATION }} --framework tauri
api-key : ${{ secrets.CN_API_KEY }}
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.
- uses : actions/checkout@v4
uses : crabnebula-dev/cloud-release@v0
command : release publish ${{ env.CN_APPLICATION }} --framework tauri
api-key : ${{ secrets.CN_API_KEY }}
name : Tauri v1 Release Process
group : ${{ github.workflow }}-${{ github.ref }}
CN_APPLICATION : " YOUR_ORG_NAME/YOUR_APP_NAME "
- uses : actions/checkout@v4
- name : create draft release
uses : crabnebula-dev/cloud-release@v0
command : release draft ${{ env.CN_APPLICATION }} --framework tauri
api-key : ${{ secrets.CN_API_KEY }}
runs-on : ${{ matrix.os }}
- uses : actions/checkout@v4
- uses : actions/setup-node@v4
- name : Install stable toolchain
uses : actions-rust-lang/setup-rust-toolchain@v1
- name : install Linux dependencies
if : matrix.os == 'ubuntu-20.04'
sudo apt-get install -y webkit2gtk-4.0
- name : build Tauri app for Windows, Linux
if : matrix.os != 'macos-latest'
TAURI_PRIVATE_KEY : ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_KEY_PASSWORD : ${{ secrets.TAURI_KEY_PASSWORD }}
- name : Install x86_64-apple-darwin for mac and build Tauri binaries
if : matrix.os == 'macos-latest'
rustup target add x86_64-apple-darwin
npm run tauri build -- --target x86_64-apple-darwin
npm run tauri build -- --target aarch64-apple-darwin
TAURI_PRIVATE_KEY : ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_KEY_PASSWORD : ${{ secrets.TAURI_KEY_PASSWORD }}
uses : crabnebula-dev/cloud-release@v0
command : release upload ${{ env.CN_APPLICATION }} --framework tauri
api-key : ${{ secrets.CN_API_KEY }}
- uses : actions/checkout@v4
uses : crabnebula-dev/cloud-release@v0
command : release publish ${{ env.CN_APPLICATION }} --framework tauri
api-key : ${{ secrets.CN_API_KEY }}
name : Tauri v1 Release Process
group : ${{ github.workflow }}-${{ github.ref }}
CN_APPLICATION : " YOUR_ORG_NAME/YOUR_APP_NAME "
- uses : actions/checkout@v4
- name : create draft release
uses : crabnebula-dev/cloud-release@v0
command : release draft ${{ env.CN_APPLICATION }} --framework tauri
api-key : ${{ secrets.CN_API_KEY }}
runs-on : ${{ matrix.os }}
- uses : actions/checkout@v4
uses : pnpm/action-setup@v3
- uses : actions/setup-node@v4
- name : Install stable toolchain
uses : actions-rust-lang/setup-rust-toolchain@v1
- name : install Linux dependencies
if : matrix.os == 'ubuntu-20.04'
sudo apt-get install -y webkit2gtk-4.0
- name : build Tauri app for Windows, Linux
if : matrix.os != 'macos-latest'
TAURI_PRIVATE_KEY : ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_KEY_PASSWORD : ${{ secrets.TAURI_KEY_PASSWORD }}
- name : Install x86_64-apple-darwin for mac and build Tauri binaries
if : matrix.os == 'macos-latest'
rustup target add x86_64-apple-darwin
pnpm tauri build --target x86_64-apple-darwin
pnpm tauri build --target aarch64-apple-darwin
TAURI_PRIVATE_KEY : ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_KEY_PASSWORD : ${{ secrets.TAURI_KEY_PASSWORD }}
uses : crabnebula-dev/cloud-release@v0
command : release upload ${{ env.CN_APPLICATION }} --framework tauri
api-key : ${{ secrets.CN_API_KEY }}
- uses : actions/checkout@v4
uses : crabnebula-dev/cloud-release@v0
command : release publish ${{ env.CN_APPLICATION }} --framework tauri
api-key : ${{ secrets.CN_API_KEY }}
name : Tauri v1 Release Process
group : ${{ github.workflow }}-${{ github.ref }}
CN_APPLICATION : " YOUR_ORG_NAME/YOUR_APP_NAME "
- uses : actions/checkout@v4
- name : create draft release
uses : crabnebula-dev/cloud-release@v0
command : release draft ${{ env.CN_APPLICATION }} --framework tauri
api-key : ${{ secrets.CN_API_KEY }}
runs-on : ${{ matrix.os }}
- uses : actions/checkout@v4
- uses : actions/setup-node@v4
- name : Install stable toolchain
uses : actions-rust-lang/setup-rust-toolchain@v1
- name : install Linux dependencies
if : matrix.os == 'ubuntu-20.04'
sudo apt-get install -y webkit2gtk-4.0
- name : build Tauri app for Windows, Linux
if : matrix.os != 'macos-latest'
yarn install --frozen-lockfile
TAURI_PRIVATE_KEY : ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_KEY_PASSWORD : ${{ secrets.TAURI_KEY_PASSWORD }}
- name : Install x86_64-apple-darwin for mac and build Tauri binaries
if : matrix.os == 'macos-latest'
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
TAURI_PRIVATE_KEY : ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_KEY_PASSWORD : ${{ secrets.TAURI_KEY_PASSWORD }}
uses : crabnebula-dev/cloud-release@v0
command : release upload ${{ env.CN_APPLICATION }} --framework tauri
api-key : ${{ secrets.CN_API_KEY }}
- uses : actions/checkout@v4
uses : crabnebula-dev/cloud-release@v0
command : release publish ${{ env.CN_APPLICATION }} --framework tauri
api-key : ${{ secrets.CN_API_KEY }}