Commit Diff


commit - 67ffb74fddf4e07cf4587b3753c4507996cb4308
commit + 605d95190ed2fbf58388e589ba6e410d12a04878
blob - /dev/null
blob + 433c0e622a7a7605aac71bae9dcb79aabb5a5c58 (mode 644)
--- /dev/null
+++ .cargo/config.toml
@@ -0,0 +1,8 @@
+[target.x86_64-unknown-freebsd]
+rustflags = ["-C", "target-cpu=x86-64"]
+
+[target.x86_64-unknown-openbsd]
+rustflags = ["-C", "target-cpu=x86-64"]
+
+[alias]
+zb-freebsd = "zigbuild --release --target x86_64-unknown-freebsd"
blob - 071a90d87cb061683c89b55f91e98aa4c135082c (mode 644)
blob + /dev/null
--- CHANGELOG.md
+++ /dev/null
@@ -1,66 +0,0 @@
-# Changelog
-
-## [1.2.1] - 2026-05-17
-
-### Dependencies
-
-- **deps:** Update `ogg_pager` to 0.7.2 ([`8083c5c`](https://git.sr.ht/~mtmn/virittaa/commit/8083c5c61a418e175365180a37a66abcb2489ab4))
-
-## [1.2.0] - 2026-05-14
-
-### Features
-
-- Rework cli, update sled ([`b4f514b`](https://git.sr.ht/~mtmn/virittaa/commit/b4f514be3b06a3897179331687cac0844089fa07))
-
-## [1.1.0] - 2026-05-14
-
-### Bug Fixes
-
-- Report code leftovers; search fix ([`e75cff3`](https://git.sr.ht/~mtmn/virittaa/commit/e75cff3b66887e210a690a05183719b9ff2ce0bc))
-- Print most recent at the bottom when listing ([`e7b3d49`](https://git.sr.ht/~mtmn/virittaa/commit/e7b3d49450c49c0c58020ebc32625f5ae726aba7))
-
-### Features
-
-- Add timestamp to db entries ([`b15c402`](https://git.sr.ht/~mtmn/virittaa/commit/b15c402ae352767c978b2637ab0b152054a6df38))
-
-## [1.0.1] - 2026-05-14
-
-### Bug Fixes
-
-- Handle oob bpm range ([`777c402`](https://git.sr.ht/~mtmn/virittaa/commit/777c402909372bd380b73ddc0019630a789db099))
-- Respect `--limit` on each argument ([`e1d7e9c`](https://git.sr.ht/~mtmn/virittaa/commit/e1d7e9cc5877f5639f4aa6b411816d62dfa11bc2))
-
-## [1.0.0] - 2026-05-14
-
-### Features
-
-- Store metadata in virittaa.db ([`b44df35`](https://git.sr.ht/~mtmn/virittaa/commit/b44df3563bdf09df96415f324d6d11bf7d9c4c8e))
-- **breaking:** Deprecate csv report; default db path ([`48dfccd`](https://git.sr.ht/~mtmn/virittaa/commit/48dfccd5d56b01f40f86c515b5feb6c54358d7c0))
-- Move helpers into utils.rs ([`1a2fc99`](https://git.sr.ht/~mtmn/virittaa/commit/1a2fc99e702712236695b83983e00b20337a5ecb))
-
-## [0.3.0] - 2026-05-11
-
-### Features
-
-- Perf improvements ([`fc759a0`](https://git.sr.ht/~mtmn/virittaa/commit/fc759a04e0b72ab6dffe3130f17c19e176cf55cb))
-
-## [0.2.0] - 2026-05-07
-
-### Features
-
-- Enable bindgen for aubio-rs to support aarch64-darwin ([`1043169`](https://git.sr.ht/~mtmn/virittaa/commit/10431695be2d9f4b930837d8ee697d4d19bc0d67))
-
-## [0.1.1] - 2026-05-07
-
-### Bug Fixes
-
-- Glibc overrides for aarch64-darwin ([`fdf7a7e`](https://git.sr.ht/~mtmn/virittaa/commit/fdf7a7ea8579cd7077a058c4551978b4d33beb29))
-
-## [0.1.0]
-
-### Features
-
-- Init ([`a654643`](https://git.sr.ht/~mtmn/virittaa/commit/a6546430e05fb631e2d609102cf5c8aabc6b96de))
-- Rename `--write`, rustfmt, cargo.lock ([`328ffa5`](https://git.sr.ht/~mtmn/virittaa/commit/328ffa576ef9923de7a0229535e50ec0bf9685ec))
-- Add nix flake with cross-platform builds ([`6865860`](https://git.sr.ht/~mtmn/virittaa/commit/6865860ceb6cf4ae5248b35632f9568f241415bb))
-- Add release script ([`a53937d`](https://git.sr.ht/~mtmn/virittaa/commit/a53937dbafce481629b057e12964f8f8f2863d34))
blob - e81a8279a202d1afa9fb4e088ec45c66d99f8321 (mode 644)
blob + /dev/null
--- cliff.toml
+++ /dev/null
@@ -1,45 +0,0 @@
-[changelog]
-header = "# Changelog\n\n"
-body = """
-{% if version -%}
-## [{{ version | trim_start_matches(pat="v") }}]{% if previous.version %} - {{ timestamp | date(format="%Y-%m-%d") }}{% endif %}
-
-{% else -%}
-## [Unreleased]
-
-{% endif -%}
-{% for group, commits in commits | group_by(attribute="group") -%}
-### {{ group }}
-
-{% for commit in commits -%}
-- {% if commit.breaking %}**breaking:** {% endif -%}
-{% if commit.scope %}**{{ commit.scope }}:** {% endif -%}
-{{ commit.message | upper_first }} \
-([`{{ commit.id | truncate(length=7, end="") }}`](https://git.sr.ht/~mtmn/virittaa/commit/{{ commit.id }}))
-{% endfor %}
-{% endfor %}
-"""
-footer = ""
-trim = true
-
-[git]
-conventional_commits = true
-filter_unconventional = true
-split_commits = false
-commit_parsers = [
-  { message = "^feat",             group = "Features" },
-  { message = "^fix",              group = "Bug Fixes" },
-  { message = "^docs",             group = "Documentation" },
-  { message = "^test",             group = "Testing" },
-  { message = "^chore\\(deps\\)",  group = "Dependencies" },
-  { message = "^chore",            skip = true },
-  { message = "^ci",               skip = true },
-]
-protect_breaking_commits = true
-filter_commits = true
-tag_pattern = "v[0-9].*"
-topo_order = false
-sort_commits = "oldest"
-
-[bump]
-initial_tag = "v0.1.0"
blob - a19044bb26872c4fd68183c0d350cdeb28693025
blob + d479c82864b4847f8bf68f0fb15c8877d256e3e4
--- hack/release
+++ hack/release
@@ -1,55 +1,66 @@
 #!/usr/bin/env bash
 set -euo pipefail
+cd "$(dirname "$0")/.."
 
-require() {
-	command -v "$1" &>/dev/null || {
-		echo "error: $1 not found"
-		exit 1
-	}
-}
-require git
-require git-cliff
+BRANCH="master"
+REMOTE="origin"
 
-# --- pre-flight ---
-
-if [ "$(git rev-parse --abbrev-ref HEAD)" != "master" ]; then
-	echo "error: not on master branch"
+die() {
+	echo "error: $*" >&2
 	exit 1
-fi
+}
 
-if [ -n "$(git status --porcelain)" ]; then
-	echo "error: working tree is dirty"
-	exit 1
-fi
+update_version_file() {
+	local version="$1"
+	[ -f Cargo.toml ] || return 0
+	sed -i "s/^version = .*/version = \"$version\"/" Cargo.toml
+	git add Cargo.toml
+	if command -v cargo >/dev/null 2>&1; then
+		cargo generate-lockfile
+		[ -f Cargo.lock ] && git add Cargo.lock
+	fi
+}
 
-# --- version calculation ---
+command -v git >/dev/null 2>&1 || die "git not found"
 
-next=$(git-cliff --bumped-version | sed 's/^v//')
+usage="usage: $(basename "$0") current | <version> [--push]"
 
-if git tag | grep -qx "v$next"; then
-	echo "no releasable commits since v$next"
+if [ "${1:-}" = "current" ]; then
+	[ "$#" -eq 1 ] || die "$usage"
+	latest=$(git tag --list 'v[0-9]*' --sort=-v:refname | head -n1)
+	[ -n "$latest" ] || die "no release tags yet"
+	echo "${latest#v}"
 	exit 0
 fi
 
-echo "releasing -> v$next"
+version=""
+push=0
+for arg in "$@"; do
+	case "$arg" in
+	--push) push=1 ;;
+	-*) die "unknown flag: $arg" ;;
+	*)
+		[ -z "$version" ] || die "unexpected argument: $arg"
+		version="$arg"
+		;;
+	esac
+done
 
-# --- update Cargo.toml ---
+[ -n "$version" ] || die "$usage"
+echo "$version" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+([-+][0-9A-Za-z.-]+)*$' ||
+	die "'$version' is not a semantic version"
 
-sed -i "s/^version = .*/version = \"$next\"/" Cargo.toml
-cargo generate-lockfile
-git add Cargo.toml Cargo.lock
+if [ "$push" -eq 0 ]; then
+	echo "would release v$version"
+	exit 0
+fi
 
-# --- changelog ---
+[ "$(git rev-parse --abbrev-ref HEAD)" = "$BRANCH" ] || die "not on $BRANCH branch"
+[ -z "$(git status --porcelain)" ] || die "working tree is dirty"
+git rev-parse -q --verify "refs/tags/v$version" >/dev/null 2>&1 && die "tag v$version already exists"
 
-git-cliff --tag "v$next" --output CHANGELOG.md
-sed -i -e :a -e '/^\s*$/{$d;N;ba' -e '}' CHANGELOG.md
-git add CHANGELOG.md
+update_version_file "$version"
 
-git commit -m "chore: release v$next"
-
-# --- tag and push ---
-
-git tag "v$next"
-git push origin master --tags
-
-echo "released v$next successfully"
+git commit -m "release: v$version"
+git tag -a "v$version" -m "v$version"
+git push "$REMOTE" "$BRANCH" --follow-tags