This document covers how to create and publish releases for SnapToWindow.
Before your first release, generate a keypair for update signing:
npx @tauri-apps/cli signer generate -w ~/.tauri/snaptowindow.keyThis creates:
~/.tauri/snaptowindow.key- Private key (keep secret, never commit)- Outputs public key to console
Add the public key to src-tauri/tauri.conf.json:
{
"plugins": {
"updater": {
"endpoints": [
"https://github.com/chitaoling/snaptowindow/releases/latest/download/latest.json"
],
"pubkey": "YOUR_PUBLIC_KEY_HERE"
}
}
}Use the bump script to update version across all config files:
./scripts/bump-version.sh 0.2.0This updates:
package.jsonsrc-tauri/Cargo.tomlsrc-tauri/tauri.conf.json
# Set signing key environment variable
export TAURI_SIGNING_PRIVATE_KEY=$(cat ~/.tauri/snaptowindow.key)
export TAURI_SIGNING_PRIVATE_KEY_PASSWORD="your-password"
# Build for current platform
npm run tauri buildBuild artifacts are located in:
- macOS:
src-tauri/target/release/bundle/dmg/andsrc-tauri/target/release/bundle/macos/ - Windows:
src-tauri/target/release/bundle/msi/andsrc-tauri/target/release/bundle/nsis/
- Go to GitHub → Releases → Draft a new release
- Select the tag you just pushed (e.g.,
v0.2.0) - Upload build artifacts:
.dmgfile (macOS installer).app.tar.gzfile (macOS update bundle).app.tar.gz.sigfile (signature)latest.jsonfile (update manifest)
Create latest.json for the updater:
{
"version": "0.2.0",
"notes": "Release notes here",
"pub_date": "2025-01-15T00:00:00Z",
"platforms": {
"darwin-aarch64": {
"signature": "CONTENTS_OF_SIG_FILE",
"url": "https://github.com/chitaoling/snaptowindow/releases/download/v0.2.0/SnapToWindow_0.2.0_aarch64.app.tar.gz"
},
"darwin-x86_64": {
"signature": "CONTENTS_OF_SIG_FILE",
"url": "https://github.com/chitaoling/snaptowindow/releases/download/v0.2.0/SnapToWindow_0.2.0_x64.app.tar.gz"
},
"windows-x86_64": {
"signature": "CONTENTS_OF_SIG_FILE",
"url": "https://github.com/chitaoling/snaptowindow/releases/download/v0.2.0/SnapToWindow_0.2.0_x64-setup.nsis.zip"
}
}
}Upload this file to the release assets.
Follow Semantic Versioning:
- MAJOR (1.0.0): Breaking changes
- MINOR (0.1.0): New features, backwards compatible
- PATCH (0.0.1): Bug fixes
Releases are automated via GitHub Actions. When you push a tag, the workflow:
- Builds for macOS (both Apple Silicon and Intel)
- Builds for Windows (x64)
- Signs macOS builds with Developer ID certificate
- Notarizes macOS builds with Apple
- Creates a draft GitHub release with all artifacts
Note: Windows builds are not code-signed. Users will see a SmartScreen warning on first install.
./scripts/bump-version.sh 0.2.0The bump script handles everything: version updates, commit, tag, and push. The workflow runs automatically. Check Actions tab for progress.
- Go to GitHub → Releases
- Find the draft release
- Test the Windows build locally before publishing
- Edit release notes if needed
- Click Publish release
| Secret | Description |
|---|---|
APPLE_CERTIFICATE |
Base64-encoded .p12 certificate |
APPLE_CERTIFICATE_PASSWORD |
Password for .p12 |
APPLE_SIGNING_IDENTITY |
Developer ID Application: Name (TEAMID) |
APPLE_ID |
Apple ID email |
APPLE_PASSWORD |
App-specific password |
APPLE_TEAM_ID |
10-character Team ID |
TAURI_SIGNING_PRIVATE_KEY |
Contents of ~/.tauri/snaptowindow.key |
TAURI_SIGNING_PRIVATE_KEY_PASSWORD |
Password for the key (no special characters) |
- Verify
latest.jsonis accessible at the endpoint URL - Check that version in
latest.jsonis higher than installed version - Ensure signature matches the build
- Regenerate the signature with the same private key
- Verify public key in
tauri.conf.jsonmatches private key
Without Apple notarization, users will see security warnings. They can bypass by:
- Right-click the app → Open → Open anyway
- Or: System Settings → Privacy & Security → Open Anyway