update #35
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: | |
| push: | |
| branches: [main] | |
| workflow_dispatch: | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |
| jobs: | |
| build: | |
| permissions: | |
| contents: write | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - platform: macos-latest | |
| args: "--target universal-apple-darwin" | |
| rust-targets: "aarch64-apple-darwin,x86_64-apple-darwin" | |
| - platform: windows-latest | |
| args: "" | |
| rust-targets: "" | |
| - platform: windows-latest | |
| args: "--target i686-pc-windows-msvc" | |
| rust-targets: "i686-pc-windows-msvc" | |
| runs-on: ${{ matrix.platform }} | |
| steps: | |
| - name: Disable symlinks (Windows) | |
| if: runner.os == 'Windows' | |
| run: git config --system core.symlinks false | |
| - uses: actions/checkout@v5 | |
| - name: Read version | |
| id: pkg | |
| shell: bash | |
| run: echo "version=$(node -p "require('./package.json').version")" >> "$GITHUB_OUTPUT" | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v5 | |
| with: | |
| node-version: 24 | |
| cache: pnpm | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.rust-targets }} | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| workspaces: src-tauri -> target | |
| cache-targets: "false" | |
| - name: Install frontend deps | |
| run: pnpm install --frozen-lockfile | |
| - uses: tauri-apps/tauri-action@v0 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} | |
| TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }} | |
| with: | |
| tagName: v${{ steps.pkg.outputs.version }} | |
| releaseName: "MaxAuto v${{ steps.pkg.outputs.version }}" | |
| releaseBody: "Desktop installer for MaxAuto v${{ steps.pkg.outputs.version }}" | |
| releaseDraft: false | |
| prerelease: false | |
| args: ${{ matrix.args }} | |
| bump-version: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Bump patch version | |
| run: | | |
| CURRENT=$(node -p "require('./package.json').version") | |
| IFS='.' read -r MAJOR MINOR PATCH <<< "$CURRENT" | |
| NEXT="${MAJOR}.${MINOR}.$((PATCH + 1))" | |
| echo "Bumping version: ${CURRENT} -> ${NEXT}" | |
| node -e " | |
| const fs = require('fs'); | |
| const pkg = JSON.parse(fs.readFileSync('package.json', 'utf8')); | |
| pkg.version = '${NEXT}'; | |
| fs.writeFileSync('package.json', JSON.stringify(pkg, null, 2) + '\n'); | |
| " | |
| node -e " | |
| const fs = require('fs'); | |
| const conf = JSON.parse(fs.readFileSync('src-tauri/tauri.conf.json', 'utf8')); | |
| conf.version = '${NEXT}'; | |
| fs.writeFileSync('src-tauri/tauri.conf.json', JSON.stringify(conf, null, 2) + '\n'); | |
| " | |
| - name: Commit version bump | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add package.json src-tauri/tauri.conf.json | |
| git commit -m "chore: bump version to $(node -p "require('./package.json').version")" | |
| git pull --rebase | |
| git push |