|
| 1 | +# Desktop Release Workflow |
| 2 | +# |
| 3 | +# This workflow is called by the main release orchestrator to build desktop applications. |
| 4 | +# It downloads pre-built web artifacts and builds cross-platform desktop applications. |
| 5 | +# |
| 6 | +# Role in release workflow: |
| 7 | +# - Called by main release.yaml orchestrator |
| 8 | +# - Receives version from semantic-release |
| 9 | +# - Downloads pre-built web artifacts |
| 10 | +# - Builds cross-platform desktop applications |
| 11 | +# - Publishes desktop apps via CrabNebula |
| 12 | + |
| 13 | +name: Release Desktop |
| 14 | + |
| 15 | +on: |
| 16 | + workflow_call: |
| 17 | + inputs: |
| 18 | + version: |
| 19 | + description: 'Release version' |
| 20 | + required: true |
| 21 | + type: string |
| 22 | + production-release: |
| 23 | + description: 'Production release?' |
| 24 | + required: true |
| 25 | + type: string |
| 26 | + release-tag: |
| 27 | + description: 'Release tag' |
| 28 | + required: true |
| 29 | + type: string |
| 30 | + crabnebula-release-id: |
| 31 | + description: 'CrabNebula release ID' |
| 32 | + required: true |
| 33 | + type: string |
| 34 | + |
| 35 | +concurrency: build-desktop |
| 36 | + |
| 37 | +env: |
| 38 | + PRODUCTION_RELEASE: ${{ inputs.production-release == 'true' }} |
| 39 | + |
| 40 | +jobs: |
| 41 | + build-tauri: |
| 42 | + name: Build Tauri app |
| 43 | + runs-on: ${{ matrix.platform }} |
| 44 | + strategy: |
| 45 | + matrix: |
| 46 | + # macos-14 is the Apple Arm runner |
| 47 | + # macos-13 is the Apple Intel runner |
| 48 | + platform: [ubuntu-22.04, windows-latest, macos-13, macos-14] |
| 49 | + |
| 50 | + steps: |
| 51 | + - name: Generate bot token |
| 52 | + uses: actions/create-github-app-token@v1 |
| 53 | + id: app_token |
| 54 | + with: |
| 55 | + app-id: ${{ secrets.BOT_ID }} |
| 56 | + private-key: ${{ secrets.BOT_SK }} |
| 57 | + |
| 58 | + - uses: actions/checkout@v4 |
| 59 | + with: |
| 60 | + # Use bot token for authenticated operations |
| 61 | + token: ${{ steps.app_token.outputs.token }} |
| 62 | + fetch-depth: 0 |
| 63 | + |
| 64 | + - name: Setup node |
| 65 | + uses: actions/setup-node@v4 |
| 66 | + with: |
| 67 | + node-version: 20 |
| 68 | + registry-url: 'https://npm.pkg.github.com' |
| 69 | + scope: '@algorandfoundation' |
| 70 | + cache: 'npm' |
| 71 | + |
| 72 | + - name: Install Rust stable |
| 73 | + uses: dtolnay/rust-toolchain@stable |
| 74 | + |
| 75 | + - name: Install npm dependencies |
| 76 | + run: npm ci --ignore-scripts |
| 77 | + env: |
| 78 | + NODE_AUTH_TOKEN: ${{ steps.app_token.outputs.token }} |
| 79 | + |
| 80 | + # Let scripts run without the token |
| 81 | + - run: npm rebuild |
| 82 | + |
| 83 | + - name: Download app build artifacts |
| 84 | + uses: actions/download-artifact@v4 |
| 85 | + with: |
| 86 | + name: app-build |
| 87 | + path: dist/ |
| 88 | + |
| 89 | + - name: Build for Linux |
| 90 | + id: build-linux |
| 91 | + if: ${{ runner.os == 'Linux' }} |
| 92 | + uses: ./.github/actions/build-linux |
| 93 | + with: |
| 94 | + release-tag: ${{ inputs.release-tag }} |
| 95 | + production-release: ${{ env.PRODUCTION_RELEASE }} |
| 96 | + crabnebula-release-id: ${{ inputs.crabnebula-release-id }} |
| 97 | + appimage-signing-private-key: ${{ secrets.APPIMAGE_SIGNING_PRIVATE_KEY }} |
| 98 | + appimage-signing-private-key-password: ${{ secrets.APPIMAGE_SIGNING_PRIVATE_KEY_PASSWORD }} |
| 99 | + tauri-signing-public-key: ${{ secrets.TAURI_SIGNING_PUBLIC_KEY }} |
| 100 | + tauri-signing-private-key: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} |
| 101 | + tauri-signing-private-key-password: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }} |
| 102 | + crabnebula-org-name: ${{ secrets.CN_ORG_NAME }} |
| 103 | + crabnebula-app-name: ${{ secrets.CN_APP_NAME }} |
| 104 | + crabnebula-api-key: ${{ secrets.CN_API_KEY }} |
| 105 | + |
| 106 | + - name: Build for Windows |
| 107 | + id: build-windows |
| 108 | + if: ${{ runner.os == 'Windows' }} |
| 109 | + uses: ./.github/actions/build-windows |
| 110 | + with: |
| 111 | + release-tag: ${{ inputs.release-tag }} |
| 112 | + production-release: ${{ env.PRODUCTION_RELEASE }} |
| 113 | + crabnebula-release-id: ${{ inputs.crabnebula-release-id }} |
| 114 | + package_name: algokit-lora |
| 115 | + azure_tenant_id: ${{ secrets.AZURE_TENANT_ID }} |
| 116 | + azure_client_id: ${{ secrets.AZURE_CLIENT_ID }} |
| 117 | + azure_client_secret: ${{ secrets.AZURE_CLIENT_SECRET }} |
| 118 | + tauri-signing-public-key: ${{ secrets.TAURI_SIGNING_PUBLIC_KEY }} |
| 119 | + tauri-signing-private-key: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} |
| 120 | + tauri-signing-private-key-password: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }} |
| 121 | + crabnebula-org-name: ${{ secrets.CN_ORG_NAME }} |
| 122 | + crabnebula-app-name: ${{ secrets.CN_APP_NAME }} |
| 123 | + crabnebula-api-key: ${{ secrets.CN_API_KEY }} |
| 124 | + |
| 125 | + - name: Build for Mac |
| 126 | + id: build-mac |
| 127 | + if: ${{ runner.os == 'macOS' }} |
| 128 | + uses: ./.github/actions/build-mac |
| 129 | + with: |
| 130 | + release-tag: ${{ inputs.release-tag }} |
| 131 | + production-release: ${{ env.PRODUCTION_RELEASE }} |
| 132 | + crabnebula-release-id: ${{ inputs.crabnebula-release-id }} |
| 133 | + apple-certificate: ${{ secrets.APPLE_CERTIFICATE }} |
| 134 | + apple-certificate-password: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }} |
| 135 | + keychain-password: ${{ secrets.KEYCHAIN_PASSWORD }} |
| 136 | + apple-id: ${{ secrets.APPLE_ID }} |
| 137 | + apple-password: ${{ secrets.APPLE_PASSWORD }} |
| 138 | + apple-team-id: ${{ secrets.APPLE_TEAM_ID }} |
| 139 | + tauri-signing-public-key: ${{ secrets.TAURI_SIGNING_PUBLIC_KEY }} |
| 140 | + tauri-signing-private-key: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} |
| 141 | + tauri-signing-private-key-password: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }} |
| 142 | + crabnebula-org-name: ${{ secrets.CN_ORG_NAME }} |
| 143 | + crabnebula-app-name: ${{ secrets.CN_APP_NAME }} |
| 144 | + crabnebula-api-key: ${{ secrets.CN_API_KEY }} |
| 145 | + |
| 146 | + publish-crabnebula: |
| 147 | + name: Publish CrabNebula release |
| 148 | + needs: |
| 149 | + - build-tauri |
| 150 | + runs-on: ubuntu-latest |
| 151 | + steps: |
| 152 | + - name: Publish CrabNebula release |
| 153 | + uses: crabnebula-dev/[email protected] |
| 154 | + with: |
| 155 | + command: release publish "${{ secrets.CN_ORG_NAME }}/${{ secrets.CN_APP_NAME }}" "${{ inputs.crabnebula-release-id }}" ${{ env.PRODUCTION_RELEASE != 'true' && '--channel beta' || '' }} |
| 156 | + api-key: ${{ secrets.CN_API_KEY }} |
0 commit comments