Skip to content

Generic Assets

This workflow is not tailored to any specific framework or bundler. It’s a generic workflow that can be used to release any type of asset, such as executables, installers, or app bundles.

If your app is written with Tauri v2, v1, or Packager.

Versioning

Make sure to adjust the version number before reaching this workflow during your CI process. This step can read a config.json file and extract the version number from it.

- name: Get version from config.json
id: get_version
run: |
VERSION=$(jq -r '.version' config.json)
NOTES=$(jq -r '.notes' config.json)
echo "NOTES=$NOTES" >> $GITHUB_ENV
echo "VERSION=$VERSION" >> $GITHUB_ENV

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

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.

- name: draft release
uses: crabnebula-dev/cloud-release@v0
id: draft
with:
command: release draft ${{ env.CN_APPLICATION }} ${{ env.VERSION }} --notes ${{ env.NOTES }}
api-key: ${{ secrets.CN_API_KEY }}

Upload Assets to Cloud

Once your app is built (you must write this step according yo your own framework and targets), 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 --file ${{ env.CN_ASSET_PATH }} ${{ env.CN_APPLICATION }} ${{ env.VERSION }}
api-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.

- name: publish release
uses: crabnebula-dev/cloud-release@v0
with:
command: release publish ${{ env.CN_APPLICATION }} ${{ env.VERSION }}
api-key: ${{ secrets.CN_API_KEY }}

Full Workflow

name: Generic Workflow Release Process
on:
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CN_APPLICATION: YOUR_ORG_NAME/YOUR_APP_NAME
CN_ASSET_PATH: YOUR-ASSET-PATH
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: draft release
uses: crabnebula-dev/cloud-release@v0
id: draft
with:
command: release draft ${{ env.CN_APPLICATION }} ${{ env.VERSION }} --notes ${{ env.NOTES }}
api-key: ${{ secrets.CN_API_KEY }}
- name: upload assets
uses: crabnebula-dev/cloud-release@v0
with:
command: release upload --file ${{ env.CN_ASSET_PATH }} ${{ env.CN_APPLICATION }} ${{ env.VERSION }}
api-key: ${{ secrets.CN_API_KEY }}
- name: publish release
uses: crabnebula-dev/cloud-release@v0
with:
command: release publish ${{ env.CN_APPLICATION }} ${{ env.VERSION }}
api-key: ${{ secrets.CN_API_KEY }}