mirror of
https://github.com/JoshiCodes/knock.git
synced 2026-12-04 15:29:40 +01:00
- ci.yml checks frontend types and build, core tests and that app and CLI compile on every push and pull request - release.yml publishes a GitHub release with notes and checksums for tags; scripts/release.sh bumps the version everywhere, tags and pushes - The Gitea workflow is gone; PKGBUILDs download from GitHub - Every clickable element shows the pointer and has a hover state; disabled controls show not-allowed - Dev-only fake backend (open the dev server with ?mock) for design work - README: docs link, install per platform, development, releasing
40 lines
1.5 KiB
Bash
Executable File
40 lines
1.5 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
|
|
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')"
|