Packager
The following workflow is specifically tailored to Packager applications.
Versionining
The release version number can be defined in 3 different file names, the order of priority within which Packager checks them is as follows:
Packager.toml
.packager.json
.Cargo.toml
.
In order for any of these files to work, they must be at the root of your project.
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.
Once testing is done, it’s recommended to use Continuous Deployment.
Action Environment
The runtime where Packager will run depends on the app or framework you want to target and the platform you want to build for. We recommend using ubuntu-latest
whenever possible, but check the table below for specific use-cases:
Framework | Image |
---|---|
Tauri v1 | ’ubuntu-20.04’ |
Tauri v2 | ’ubuntu-22.04’ |
Once defined, we establish variables so the images can be used consistently across the entire workflow. Additionally we store our CrabNebula Cloud application name to be used in the CLI commands.
Finally, when deploying to multiple platforms, it’s useful to make builds concurrent. Also, cancelling ongoing processes when a new workflow starts.
Jobs
The following section snippets must be added in the jobs
map.
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.
Build Your App
The build step is for setting up the container image in which our task will run for each platform, and finally run Packager to create your binaries.
Establish the dependencies and the matrix of platforms we want to run concurrently. Add Rust toolchain and create a cache for it.
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!
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.