desktop: bump version to 0.1.1 #5
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 Desktop App | |
| on: | |
| # Cut a release by pushing/merging to the `release` branch. The version comes | |
| # from apps/desktop/src-tauri/tauri.conf.json — bump it before each release, or | |
| # the build fails trying to re-create an existing tag. Every push here runs a | |
| # full macOS build (~200 billed Actions minutes), so promote to `release` | |
| # deliberately, not casually. | |
| push: | |
| branches: [release] | |
| jobs: | |
| build-and-release: | |
| permissions: | |
| contents: write | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| # macOS universal (Intel + Apple Silicon). | |
| # macOS-only for now — Windows/Linux runners were dropped to conserve | |
| # the org's free Actions minutes (macOS bills at 10x). Re-add matrix | |
| # entries here to build those platforms again. | |
| - platform: macos-latest | |
| args: '--target universal-apple-darwin' | |
| rust_target: 'aarch64-apple-darwin,x86_64-apple-darwin' | |
| runs-on: ${{ matrix.platform }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| # version intentionally omitted — taken from package.json "packageManager" | |
| - name: Set up Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| # no 'cache: pnpm' — pnpm-lock.yaml is gitignored in this repo, so it | |
| # isn't present on the runner for the cache action to hash. | |
| - name: Install Rust stable | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.rust_target }} | |
| - name: Rust cache | |
| uses: swatinem/rust-cache@v2 | |
| with: | |
| workspaces: apps/desktop/src-tauri -> target | |
| - name: Install frontend dependencies | |
| run: pnpm install | |
| - name: Build and release | |
| uses: tauri-apps/tauri-action@v0 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # macOS code signing | |
| 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 updater signing | |
| TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} | |
| TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }} | |
| # Next.js env (desktop build) | |
| NEXT_PUBLIC_FASTAPI_BASE_URL: ${{ secrets.NEXT_PUBLIC_FASTAPI_BASE_URL }} | |
| NEXT_PUBLIC_FIREBASE_API_KEY: ${{ secrets.NEXT_PUBLIC_FIREBASE_API_KEY }} | |
| NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN: ${{ secrets.NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN }} | |
| NEXT_PUBLIC_FIREBASE_PROJECT_ID: ${{ secrets.NEXT_PUBLIC_FIREBASE_PROJECT_ID }} | |
| NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET: ${{ secrets.NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET }} | |
| NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID: ${{ secrets.NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID }} | |
| NEXT_PUBLIC_FIREBASE_APP_ID: ${{ secrets.NEXT_PUBLIC_FIREBASE_APP_ID }} | |
| with: | |
| projectPath: apps/desktop | |
| # __VERSION__ is replaced by tauri-action with the version from | |
| # tauri.conf.json, so the release/tag is v<version> (e.g. v0.1.0). | |
| tagName: v__VERSION__ | |
| releaseName: MyDevTools v__VERSION__ | |
| releaseBody: | | |
| See [CHANGELOG](https://github.com/itsmeakhil/mydevtools/blob/main/CHANGELOG.md) for details. | |
| releaseDraft: false | |
| prerelease: false | |
| args: ${{ matrix.args }} | |
| updaterJsonPath: latest.json | |
| updaterJsonKeepUniversal: true | |
| # The source repo is private, so its release assets 404 for the public. | |
| # Mirror the built artifacts to a PUBLIC releases repo that the updater | |
| # endpoint and the website download button point at. | |
| - name: Mirror release to public repo | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # read the private release | |
| RELEASES_TOKEN: ${{ secrets.RELEASES_TOKEN }} # write to the public repo | |
| PUBLIC_REPO: mydevtools-tech/mydevtools-releases | |
| run: | | |
| set -euo pipefail | |
| VERSION="$(node -p "require('./apps/desktop/src-tauri/tauri.conf.json').version")" | |
| TAG="v$VERSION" | |
| BUNDLE="apps/desktop/src-tauri/target/universal-apple-darwin/release/bundle" | |
| DMG="$(ls "$BUNDLE"/dmg/*.dmg)" | |
| TARGZ="$(ls "$BUNDLE"/macos/*.app.tar.gz)" | |
| SIG="$(ls "$BUNDLE"/macos/*.app.tar.gz.sig)" | |
| # Pull tauri's generated latest.json from the private release. | |
| GH_TOKEN="$GITHUB_TOKEN" gh release download "$TAG" \ | |
| --repo "$GITHUB_REPOSITORY" --pattern latest.json --dir . --clobber | |
| # Repoint its asset URLs at the public repo. The minisign signature | |
| # signs the file bytes, not the URL, so it stays valid. | |
| node -e ' | |
| const fs = require("fs"); | |
| const src = process.env.GITHUB_REPOSITORY, dst = process.env.PUBLIC_REPO; | |
| const j = JSON.parse(fs.readFileSync("latest.json", "utf8")); | |
| for (const k of Object.keys(j.platforms || {})) | |
| j.platforms[k].url = j.platforms[k].url.split(src).join(dst); | |
| fs.writeFileSync("latest.json", JSON.stringify(j, null, 2)); | |
| ' | |
| # Create the public release (once) and upload all four assets. | |
| if ! GH_TOKEN="$RELEASES_TOKEN" gh release view "$TAG" --repo "$PUBLIC_REPO" >/dev/null 2>&1; then | |
| GH_TOKEN="$RELEASES_TOKEN" gh release create "$TAG" --repo "$PUBLIC_REPO" \ | |
| --title "MyDevTools $TAG" --notes "MyDevTools desktop $TAG" | |
| fi | |
| GH_TOKEN="$RELEASES_TOKEN" gh release upload "$TAG" --repo "$PUBLIC_REPO" \ | |
| --clobber "$DMG" "$TARGZ" "$SIG" latest.json |