Files
JoshiCodes 4b1590e750 Cookie jars per folder; pacman repository on Gitea; install guide per platform
- A folder can share its parent's cookie jar, keep its own, or use no
  cookies; sub folders follow. The Cookies tab shows the jar a request
  used. Jars are stored per collection and folder.
- The release workflow builds knock-bin from the deb and uploads it to
  the Gitea pacman repository (needs the GITEA_PACKAGES_TOKEN secret)
- knock-bin installs the desktop entry as knock-app.desktop
- README: install for Arch (signed pacman repo), Ubuntu/Debian,
  Fedora/openSUSE, AppImage, macOS (quarantine) and Windows (SmartScreen)
- release.sh works when the version is already set
2026-11-27 22:12:08 +01:00

41 lines
1.6 KiB
Bash
Executable File

#!/usr/bin/env bash
# Usage: scripts/release.sh 0.2.0
# Sets the version everywhere, commits, tags v0.2.0 and pushes. The tag
# starts .github/workflows/release.yml, which builds all platforms and
# publishes the GitHub release.
set -euo pipefail
cd "$(dirname "$0")/.."
v="${1:-}"
if ! [[ "$v" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.]+)?$ ]]; then
echo "usage: $0 <version> e.g. $0 0.2.0 or $0 0.2.0-rc1" >&2
exit 2
fi
if [ -n "$(git status --porcelain)" ]; then
echo "working tree is not clean; commit or stash first" >&2
exit 1
fi
if [ "$(git branch --show-current)" != main ]; then
echo "releases are cut from main" >&2
exit 1
fi
if git rev-parse -q --verify "refs/tags/v$v" >/dev/null; then
echo "tag v$v exists already" >&2
exit 1
fi
# Cargo workspace, npm, Tauri, Arch packages.
sed -i -E "0,/^version = \"[^\"]+\"/s//version = \"$v\"/" Cargo.toml
npm version "$v" --no-git-tag-version --allow-same-version >/dev/null
sed -i -E "s/(\"version\": )\"[^\"]+\"/\1\"$v\"/" src-tauri/tauri.conf.json
base="${v%%-*}"
sed -i -E "s/^pkgver=.*/pkgver=$base/; s/^pkgrel=.*/pkgrel=1/" packaging/arch/knock/PKGBUILD packaging/arch/knock-bin/PKGBUILD
cargo update -w --offline >/dev/null 2>&1 || cargo update -w >/dev/null
git add Cargo.toml Cargo.lock package.json package-lock.json src-tauri/tauri.conf.json packaging/arch
# The version may already be set (first release); then there is nothing to commit.
git diff --cached --quiet || git commit -q -m "Release v$v"
git tag -a "v$v" -m "knock $v"
git push -q origin main "v$v"
echo "Pushed v$v. Follow the build: gh run watch \$(gh run list -w release -L1 --json databaseId -q '.[0].databaseId')"