Skip to content

Merge pull request #10 from Razee4315/fix/lock-window-size #26

Merge pull request #10 from Razee4315/fix/lock-window-size

Merge pull request #10 from Razee4315/fix/lock-window-size #26

Workflow file for this run

name: Release
on:
push:
branches:
- main
workflow_dispatch:
permissions:
contents: write
# Two near-simultaneous pushes to main could both read the same version,
# both bump, and race the push-back. Serialize release runs.
concurrency:
group: release
cancel-in-progress: false
jobs:
release:
runs-on: windows-latest
# Skip version-bump commits to avoid infinite loop
if: "!contains(github.event.head_commit.message, '[skip ci]')"
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Auto-bump patch version
id: bump
shell: bash
run: |
# Read current version
CURRENT=$(jq -r '.version' src-tauri/tauri.conf.json)
echo "Current version: $CURRENT"
# Check if tag already exists — if so, bump patch
if git tag -l "v$CURRENT" | grep -q "v$CURRENT"; then
IFS='.' read -r MAJOR MINOR PATCH <<< "$CURRENT"
PATCH=$((PATCH + 1))
NEW="$MAJOR.$MINOR.$PATCH"
echo "Bumping to $NEW"
else
NEW="$CURRENT"
echo "Version $CURRENT has no tag yet, using as-is"
fi
echo "version=$NEW" >> $GITHUB_OUTPUT
# Update all 3 files if version changed
if [ "$NEW" != "$CURRENT" ]; then
# tauri.conf.json
jq --arg v "$NEW" '.version = $v' src-tauri/tauri.conf.json > tmp.json && mv tmp.json src-tauri/tauri.conf.json
# package.json
jq --arg v "$NEW" '.version = $v' package.json > tmp.json && mv tmp.json package.json
# Cargo.toml — replace version line
sed -i "s/^version = \"$CURRENT\"/version = \"$NEW\"/" src-tauri/Cargo.toml
# Commit the version bump
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 src-tauri/Cargo.toml
git commit -m "chore: bump version to $NEW [skip ci]"
git push
fi
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Rust cache
uses: swatinem/rust-cache@v2
with:
workspaces: './src-tauri -> target'
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install frontend dependencies
run: bun install
- name: Build and Release
uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tauriScript: bun run tauri
tagName: v__VERSION__
releaseName: 'PinIt v__VERSION__'
releaseBody: |
## PinIt v__VERSION__
Download the installer below to get started.
### Installation
- **`.msi`** — Standard Windows installer (recommended)
- **`.exe`** — NSIS installer
### Shortcuts (customizable)
| Action | Default Shortcut |
|--------|----------|
| Pin/Unpin window | `Win` + `Ctrl` + `T` |
| Increase opacity | `Win` + `Ctrl` + `=` |
| Decrease opacity | `Win` + `Ctrl` + `-` |
| Show/Hide PinIt | `Win` + `Ctrl` + `P` |
releaseDraft: false
prerelease: false