chore: bump version to v0.2.1 #7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | ||
| on: | ||
| push: | ||
| tags: | ||
| - 'v*' | ||
| workflow_dispatch: | ||
| env: | ||
| CARGO_INCREMENTAL: 0 | ||
| CARGO_NET_RETRY: 10 | ||
| RUST_BACKTRACE: short | ||
| RUSTUP_MAX_RETRIES: 10 | ||
| jobs: | ||
| create-release: | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| release_id: ${{ steps.create-release.outputs.id }} | ||
| release_upload_url: ${{ steps.create-release.outputs.upload_url }} | ||
| version: ${{ steps.get-version.outputs.version }} | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Get version from tag | ||
| id: get-version | ||
| run: echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT | ||
| - name: Create Release | ||
| id: create-release | ||
| uses: actions/create-release@v1 | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| with: | ||
| tag_name: ${{ github.ref }} | ||
| release_name: XE Launcher v${{ steps.get-version.outputs.version }} | ||
| draft: true | ||
| prerelease: ${{ contains(steps.get-version.outputs.version, 'beta') || contains(steps.get-version.outputs.version, 'alpha') }} | ||
| build-tauri: | ||
| needs: create-release | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: | ||
| - platform: 'macos-latest' | ||
| rust_target: 'x86_64-apple-darwin' | ||
| - platform: 'macos-latest' | ||
| rust_target: 'aarch64-apple-darwin' | ||
| - platform: 'ubuntu-22.04' | ||
| rust_target: 'x86_64-unknown-linux-gnu' | ||
| - platform: 'windows-latest' | ||
| rust_target: 'x86_64-pc-windows-msvc' | ||
| runs-on: ${{ matrix.platform }} | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Setup Bun | ||
| uses: oven-sh/setup-bun@v2 | ||
| with: | ||
| bun-version: latest | ||
| - name: Setup Rust | ||
| uses: dtolnay/rust-toolchain@stable | ||
| with: | ||
| targets: ${{ matrix.rust_target }} | ||
| - name: Install dependencies (Ubuntu) | ||
| if: matrix.platform == 'ubuntu-22.04' | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf | ||
| - name: Install frontend dependencies | ||
| run: bun install | ||
| - name: Setup Apple certificate | ||
| if: matrix.platform == 'macos-latest' | ||
| env: | ||
| APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }} | ||
| APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }} | ||
| KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }} | ||
| run: | | ||
| echo $APPLE_CERTIFICATE | base64 --decode > certificate.p12 | ||
| security create-keychain -p "$KEYCHAIN_PASSWORD" build.keychain | ||
| security default-keychain -s build.keychain | ||
| security unlock-keychain -p "$KEYCHAIN_PASSWORD" build.keychain | ||
| security import certificate.p12 -k build.keychain -P "$APPLE_CERTIFICATE_PASSWORD" -T /usr/bin/codesign | ||
| security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$KEYCHAIN_PASSWORD" build.keychain | ||
| - name: Build Tauri app | ||
| uses: tauri-apps/tauri-action@v0 | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }} | ||
| APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }} | ||
| APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }} | ||
| APPLE_ID: ${{ secrets.APPLE_ID }} | ||
| APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }} | ||
| APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} | ||
| TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} | ||
| TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }} | ||
| with: | ||
| projectPath: apps/desktop | ||
| args: --target ${{ matrix.rust_target }} | ||
| releaseId: ${{ needs.create-release.outputs.release_id }} | ||
| publish-release: | ||
| runs-on: ubuntu-latest | ||
| needs: [create-release, build-tauri] | ||
| steps: | ||
| - name: Publish release | ||
| uses: actions/github-script@v7 | ||
| with: | ||
| github-token: ${{ secrets.GITHUB_TOKEN }} | ||
| script: | | ||
| github.rest.repos.updateRelease({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| release_id: ${{ needs.create-release.outputs.release_id }}, | ||
| draft: false | ||
| }) | ||
| deploy-to-crabnebula: | ||
| runs-on: ubuntu-latest | ||
| needs: [create-release, build-tauri] | ||
| if: ${{ secrets.CN_API_KEY != '' }} | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Deploy to CrabNebula Cloud | ||
| run: | | ||
| curl -X POST https://cloud.crabnebula.app/api/v1/apps/${{ secrets.CN_APP_ID }}/releases \ | ||
| -H "Authorization: Bearer ${{ secrets.CN_API_KEY }}" \ | ||
| -H "Content-Type: application/json" \ | ||
| -d '{ | ||
| "version": "${{ needs.create-release.outputs.version }}", | ||
| "notes": "Release v${{ needs.create-release.outputs.version }}" | ||
| }' | ||