Skip to content

Release

Release #236

Workflow file for this run

name: Release
on:
# push:
# branches:
# - main
# paths-ignore:
# - 'docs/**'
# - '**.md'
# - '.vscode/**'
# - '.idea/**'
workflow_dispatch:
inputs:
production-release:
description: 'Production release?'
required: true
default: 'true'
concurrency: create-release
permissions:
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
packages: read
env:
PRODUCTION_RELEASE: ${{ github.ref_name == 'main' && inputs.production-release == 'true' }}
jobs:
create-release:
runs-on: [ubuntu-22.04]
name: Create release
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Create GitHub release
uses: ./.github/actions/create-release
id: create-github-release
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
production-release: ${{ env.PRODUCTION_RELEASE }}
node-version: 20
- name: Create draft CrabNebula release
uses: crabnebula-dev/[email protected]
id: create-crabnebula-release
if: ${{ steps.create-github-release.outputs.release-published == 'true' }}
with:
command: release draft ${{ secrets.CN_ORG_NAME }}/${{ secrets.CN_APP_NAME }} ${{ steps.create-github-release.outputs.release-version }} ${{ env.PRODUCTION_RELEASE != 'true' && '--channel beta' || '' }}
api-key: ${{ secrets.CN_API_KEY }}
- name: Get CrabNebula release ID
id: get-crabnebula-release-id
if: ${{ steps.create-github-release.outputs.release-published == 'true' }}
run: echo "release-id=${{ fromJson(steps.create-crabnebula-release.outputs.stdout).id }}" >> $GITHUB_OUTPUT
outputs:
release-published: ${{ steps.create-github-release.outputs.release-published }}
release-version: ${{ steps.create-github-release.outputs.release-version }}
release-tag: ${{ steps.create-github-release.outputs.release-tag }}
release-id: ${{ steps.create-github-release.outputs.release-id }}
crabnebula-release-id: ${{ steps.get-crabnebula-release-id.outputs.release-id }}
build-tauri:
name: Build Tauri app
needs:
- create-release
runs-on: ${{ matrix.platform }}
strategy:
matrix:
# macos-14 is the Apple Arm runner
# macos-13 is the Apple Intel runner
# platform: [ubuntu-22.04, windows-latest, macos-13, macos-14]
platform: [windows-latest, macos-13, macos-14]
if: ${{ needs.create-release.outputs.release-published == 'true' }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
- name: Install npm dependencies
run: npm install
- name: Create .env file
run: |
sed -E -n 's/(VITE_[A-Z0-9_]+)=(.*)/\1="{{\1}}"/p' .env.sample > .env
- name: Substitute environment variables
uses: bluwy/substitute-string-action@v3
with:
_input-file: '.env'
_format-key: '{{key}}'
_output-file: '.env'
VITE_DISPENSER_AUTH0_DOMAIN: dispenser-prod.eu.auth0.com
VITE_DISPENSER_AUTH0_CLIENT_ID: Cg13HjvSV45pMme4dnK9yVJde8tVeDaM
VITE_DISPENSER_AUTH0_AUDIENCE: api-prod-dispenser-user
VITE_TESTNET_DISPENSER_API_URL: https://api.dispenser.algorandfoundation.tools
VITE_TESTNET_DISPENSER_ADDRESS: Z5GPJQCHVU54C2I4FLYNE2XHRQRL5OV2GPJQKXJFMW34CRIN2KRQFXF7DI
- name: Build for Linux
id: build-linux
if: ${{ runner.os == 'Linux' }}
uses: ./.github/actions/build-linux
with:
release-version: ${{ needs.create-release.outputs.release-version }}
release-tag: ${{ needs.create-release.outputs.release-tag }}
production-release: ${{ env.PRODUCTION_RELEASE }}
crabnebula-release-id: ${{ needs.create-release.outputs.crabnebula-release-id }}
appimage-signing-private-key: ${{ secrets.APPIMAGE_SIGNING_PRIVATE_KEY }}
appimage-signing-private-key-password: ${{ secrets.APPIMAGE_SIGNING_PRIVATE_KEY_PASSWORD }}
tauri-signing-public-key: ${{ secrets.TAURI_SIGNING_PUBLIC_KEY }}
tauri-signing-private-key: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
tauri-signing-private-key-password: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
crabnebula-org-name: ${{ secrets.CN_ORG_NAME }}
crabnebula-app-name: ${{ secrets.CN_APP_NAME }}
crabnebula-api-key: ${{ secrets.CN_API_KEY }}
- name: Build for Windows
id: build-windows
if: ${{ runner.os == 'Windows' }}
uses: ./.github/actions/build-windows
with:
release-version: ${{ needs.create-release.outputs.release-version }}
release-tag: ${{ needs.create-release.outputs.release-tag }}
production-release: ${{ env.PRODUCTION_RELEASE }}
crabnebula-release-id: ${{ needs.create-release.outputs.crabnebula-release-id }}
package_name: algokit-lora
azure_tenant_id: ${{ secrets.AZURE_TENANT_ID }}
azure_client_id: ${{ secrets.AZURE_CLIENT_ID }}
azure_client_secret: ${{ secrets.AZURE_CLIENT_SECRET }}
tauri-signing-public-key: ${{ secrets.TAURI_SIGNING_PUBLIC_KEY }}
tauri-signing-private-key: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
tauri-signing-private-key-password: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
crabnebula-org-name: ${{ secrets.CN_ORG_NAME }}
crabnebula-app-name: ${{ secrets.CN_APP_NAME }}
crabnebula-api-key: ${{ secrets.CN_API_KEY }}
- name: Build for Mac
id: build-mac
if: ${{ runner.os == 'macOS' }}
uses: ./.github/actions/build-mac
with:
release-version: ${{ needs.create-release.outputs.release-version }}
release-tag: ${{ needs.create-release.outputs.release-tag }}
production-release: ${{ env.PRODUCTION_RELEASE }}
crabnebula-release-id: ${{ needs.create-release.outputs.crabnebula-release-id }}
apple-certificate: ${{ secrets.APPLE_CERTIFICATE }}
apple-certificate-password: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
keychain-password: ${{ secrets.KEYCHAIN_PASSWORD }}
apple-id: ${{ secrets.APPLE_ID }}
apple-password: ${{ secrets.APPLE_PASSWORD }}
apple-team-id: ${{ secrets.APPLE_TEAM_ID }}
tauri-signing-public-key: ${{ secrets.TAURI_SIGNING_PUBLIC_KEY }}
tauri-signing-private-key: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
tauri-signing-private-key-password: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
crabnebula-org-name: ${{ secrets.CN_ORG_NAME }}
crabnebula-app-name: ${{ secrets.CN_APP_NAME }}
crabnebula-api-key: ${{ secrets.CN_API_KEY }}
publish-crabnebula:
name: Publish CrabNebula release
needs:
- create-release
- build-tauri
runs-on: [ubuntu-22.04]
if: ${{ needs.create-release.outputs.release-published == 'true' }}
steps:
- name: Publish CrabNebula release
uses: crabnebula-dev/[email protected]
with:
command: release publish "${{ secrets.CN_ORG_NAME }}/${{ secrets.CN_APP_NAME }}" "${{ needs.create-release.outputs.crabnebula-release-id }}" ${{ env.PRODUCTION_RELEASE != 'true' && '--channel beta' || '' }}
api-key: ${{ secrets.CN_API_KEY }}