Release #1
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: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: "Version override (e.g. 0.4.0). Leave empty to use src-tauri/tauri.conf.json." | |
| required: false | |
| type: string | |
| update_aur: | |
| description: "Push PKGBUILD update to AUR (publish the GitHub release first so AppImage URL is public)." | |
| required: false | |
| type: boolean | |
| default: false | |
| push: | |
| tags: | |
| - "v*" | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| # Windows x64 → NSIS installer (+ MSI if enabled in bundle targets) | |
| - platform: windows-latest | |
| target: x86_64-pc-windows-msvc | |
| args: "--target x86_64-pc-windows-msvc" | |
| # Linux x64 → .deb + AppImage (AppImage feeds AUR package) | |
| - platform: ubuntu-22.04 | |
| target: x86_64-unknown-linux-gnu | |
| args: "--target x86_64-unknown-linux-gnu" | |
| # macOS universal → single DMG/app covering Apple Silicon + Intel | |
| - platform: macos-latest | |
| target: universal-apple-darwin | |
| args: "--target universal-apple-darwin" | |
| runs-on: ${{ matrix.platform }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.target }} | |
| - name: Add macOS universal targets | |
| if: matrix.platform == 'macos-latest' | |
| run: rustup target add aarch64-apple-darwin x86_64-apple-darwin | |
| - name: Install Linux dependencies | |
| 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 \ | |
| libasound2-dev | |
| - name: Install frontend dependencies | |
| run: npm ci | |
| - name: Resolve release tag | |
| id: meta | |
| shell: bash | |
| run: | | |
| if [ "${{ github.event_name }}" = "push" ]; then | |
| TAG="${{ github.ref_name }}" | |
| elif [ -n "${{ inputs.version }}" ]; then | |
| VER="${{ inputs.version }}" | |
| VER="${VER#v}" | |
| TAG="v${VER}" | |
| else | |
| TAG="v__VERSION__" | |
| fi | |
| echo "tag=$TAG" >> "$GITHUB_OUTPUT" | |
| echo "Using tagName=$TAG" | |
| - name: Build Tauri app | |
| uses: tauri-apps/tauri-action@v0 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tagName: ${{ steps.meta.outputs.tag }} | |
| releaseName: "Sound Ninja ${{ steps.meta.outputs.tag }}" | |
| releaseBody: | | |
| Draft release — review assets below, then publish when ready. | |
| **Downloads** | |
| - Windows: `.exe` / `.msi` installer | |
| - macOS: universal `.dmg` (Apple Silicon + Intel) | |
| - Linux: `.deb` (Ubuntu/Debian) and `.AppImage` | |
| - Arch: install via AUR (`soundninja-bin`) after this release is published | |
| releaseDraft: true | |
| prerelease: false | |
| args: ${{ matrix.args }} | |
| aur-update: | |
| needs: build | |
| # Tag pushes always attempt AUR update. Manual runs only when update_aur=true. | |
| # AppImage must be publicly downloadable — publish the draft release first for manual AUR updates. | |
| if: > | |
| always() && | |
| needs.build.result == 'success' && | |
| ( | |
| (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')) || | |
| (github.event_name == 'workflow_dispatch' && inputs.update_aur) | |
| ) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Get version | |
| id: version | |
| shell: bash | |
| run: | | |
| if [ "${{ github.event_name }}" = "push" ]; then | |
| VERSION="${GITHUB_REF_NAME#v}" | |
| elif [ -n "${{ inputs.version }}" ]; then | |
| VERSION="${{ inputs.version }}" | |
| VERSION="${VERSION#v}" | |
| else | |
| VERSION="$(jq -r .version src-tauri/tauri.conf.json)" | |
| fi | |
| echo "VERSION=$VERSION" >> "$GITHUB_OUTPUT" | |
| echo "AUR pkgver=$VERSION" | |
| - name: Bump PKGBUILD pkgver | |
| run: | | |
| sed -i "s/^pkgver=.*/pkgver=${{ steps.version.outputs.VERSION }}/" aur/PKGBUILD | |
| sed -i "s/^pkgrel=.*/pkgrel=1/" aur/PKGBUILD | |
| - name: Update AUR package | |
| uses: KSXGitHub/github-actions-deploy-aur@v3 | |
| with: | |
| pkgname: soundninja-bin | |
| pkgbuild: ./aur/PKGBUILD | |
| assets: ./aur/soundninja.desktop | |
| commit_username: ${{ secrets.AUR_USERNAME }} | |
| commit_email: ${{ secrets.AUR_EMAIL }} | |
| ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }} | |
| commit_message: "Update to v${{ steps.version.outputs.VERSION }}" | |
| updpkgsums: true |