chore: bump to 0.2.3 to test in-app updater #15
Workflow file for this run
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*" | |
| permissions: | |
| contents: write | |
| jobs: | |
| release: | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: aarch64-apple-darwin,x86_64-apple-darwin | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| workspaces: src-tauri | |
| - name: Install frontend dependencies | |
| run: npm install | |
| - name: Build | |
| env: | |
| TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} | |
| TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }} | |
| run: npm run tauri -- build --target universal-apple-darwin | |
| - name: Package and sign updater artifact | |
| env: | |
| TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} | |
| TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }} | |
| run: | | |
| BUNDLE="src-tauri/target/universal-apple-darwin/release/bundle/macos" | |
| tar czf "$BUNDLE/lines.app.tar.gz" -C "$BUNDLE" lines.app | |
| npm run tauri -- signer sign \ | |
| --private-key "$TAURI_SIGNING_PRIVATE_KEY" \ | |
| --password "$TAURI_SIGNING_PRIVATE_KEY_PASSWORD" \ | |
| "$BUNDLE/lines.app.tar.gz" | |
| - name: Create release and upload artifacts | |
| env: | |
| GH_TOKEN: ${{ secrets.GH_PAT }} | |
| TAG: ${{ github.ref_name }} | |
| run: | | |
| BUNDLE="src-tauri/target/universal-apple-darwin/release/bundle" | |
| gh release create "$TAG" \ | |
| --title "lines $TAG" \ | |
| --notes "" \ | |
| --repo whaleen/lines \ | |
| "$BUNDLE/dmg/lines_${TAG#v}_universal.dmg" \ | |
| "$BUNDLE/macos/lines.app.tar.gz" \ | |
| "$BUNDLE/macos/lines.app.tar.gz.sig" | |
| - name: Update latest.json in homebrew-tap | |
| env: | |
| GH_TOKEN: ${{ secrets.GH_PAT }} | |
| TAG: ${{ github.ref_name }} | |
| run: | | |
| VERSION="${TAG#v}" | |
| BUNDLE="src-tauri/target/universal-apple-darwin/release/bundle" | |
| SIG_CONTENT=$(cat "$BUNDLE/macos/lines.app.tar.gz.sig") | |
| RELEASE=$(gh api repos/whaleen/lines/releases/tags/$TAG) | |
| URL=$(echo "$RELEASE" | jq -r '.assets[] | select(.name | endswith("app.tar.gz")) | .browser_download_url') | |
| PUB_DATE=$(echo "$RELEASE" | jq -r '.published_at') | |
| git clone https://x-access-token:$GH_TOKEN@github.com/whaleen/homebrew-tap.git /tmp/homebrew-tap | |
| cd /tmp/homebrew-tap | |
| jq -n \ | |
| --arg version "$VERSION" \ | |
| --arg pub_date "$PUB_DATE" \ | |
| --arg url "$URL" \ | |
| --arg sig "$SIG_CONTENT" \ | |
| '{ | |
| version: $version, | |
| pub_date: $pub_date, | |
| platforms: { | |
| "darwin-aarch64": { url: $url, signature: $sig }, | |
| "darwin-x86_64": { url: $url, signature: $sig } | |
| } | |
| }' > latest.json | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add latest.json | |
| git commit -m "update: lines $TAG" | |
| git push |