commit 690ecf2c9b657a9eda953eb49b853af21dba4a9d from: mtmn date: Sun Jun 14 19:32:37 2026 UTC build: streamline release, add ci commit - 4e4f615e2960cadca7712b9aafd2507a856a776e commit + 690ecf2c9b657a9eda953eb49b853af21dba4a9d blob - /dev/null blob + f9fa71bd99e8c45a59e50cdacdec2affb4168423 (mode 644) --- /dev/null +++ .build.yml @@ -0,0 +1,17 @@ +image: archlinux +packages: + - rustup + - base-devel + - cmake + - clang + - pkgconf + - ffmpeg + - sqlite +sources: + - https://git.sr.ht/~mtmn/hakuna +tasks: + - setup: | + rustup default stable + - build: | + cd hakuna + cargo build blob - f4d7349304acee8811e7dc71d8647cafe496b746 (mode 644) blob + /dev/null --- CHANGELOG.md +++ /dev/null @@ -1,49 +0,0 @@ -# Changelog - -## [0.2.1] - 2026-05-11 - -### Dependencies - -- **deps:** Remove unused deps, update ([`9849146`](https://git.sr.ht/~mtmn/matcha/commit/984914600d2c451bde357c1bce3cb58a2ea0adfa)) - -## [0.2.0] - 2026-05-07 - -### Features - -- Rename matchakey to matcha ([`04a6191`](https://git.sr.ht/~mtmn/matcha/commit/04a6191cf5be071fe3d5eb27df12bff3ed907a78)) - -## [0.1.3] - 2026-05-07 - -### Bug Fixes - -- Trim newlines in changelog, add cargo.lock ([`d5c3df4`](https://git.sr.ht/~mtmn/matcha/commit/d5c3df4631bcc62d9248c61c997e9aa5d6303331)) - -## [0.1.2] - 2026-05-07 - -### Bug Fixes - -- Exclude compare uri in changelog ([`b4ae589`](https://git.sr.ht/~mtmn/matcha/commit/b4ae589c9847101cd141232f97bcfb5e41573f5a)) - -## [0.1.1] - 2026-05-07 - -### Bug Fixes - -- Release fixes ([`9ce8e0d`](https://git.sr.ht/~mtmn/matcha/commit/9ce8e0d014181660c3163a8bd0df8c240ff9d14f)) - -## [0.1.0] - -### Bug Fixes - -- Abs paths for m3u, add gitignore ([`4546110`](https://git.sr.ht/~mtmn/matcha/commit/4546110983eeb3ac44669de07b538cdb0be4401b)) -- Create playlist in cwd ([`ad223e8`](https://git.sr.ht/~mtmn/matcha/commit/ad223e83513219be2dc5c4929a22d7158cf1d0f6)) -- Add missing fields in cargo.toml ([`8c81d1b`](https://git.sr.ht/~mtmn/matcha/commit/8c81d1baa0b4b98e6531d1d3ef7dd137a711d05f)) -- Use git-cliff for releases ([`78ac043`](https://git.sr.ht/~mtmn/matcha/commit/78ac043538b76d86e7772a363b0b43e3f6894c73)) -- Set initial tag for git-cliff ([`284f89e`](https://git.sr.ht/~mtmn/matcha/commit/284f89e0333d2ab04c4339c150ef51c395059f9e)) - -### Features - -- Rename --m3u to --playlist for clarity ([`60e8dec`](https://git.sr.ht/~mtmn/matcha/commit/60e8decbd16329b42ad2d8b0ce284ba9ca640ed3)) -- Add nix flake and prek.toml ([`701f61e`](https://git.sr.ht/~mtmn/matcha/commit/701f61e56d9461314cea9e3c358458effa5f31fe)) -- Prepare for crates release ([`d685d9f`](https://git.sr.ht/~mtmn/matcha/commit/d685d9f0dff1baa27de0d3e7b7c70272fa03908b)) -- Add `release` script ([`c9d114e`](https://git.sr.ht/~mtmn/matcha/commit/c9d114e9fe4f0b9d4483b7122e6b55f18e52e3df)) -- Add `release` script ([`683c655`](https://git.sr.ht/~mtmn/matcha/commit/683c655f8651b2507c53e78b9b6a9a38c97284f6)) blob - a7d0918f75368c6c14e882566638003c4fe4fa5d (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/matcha/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 + 601775c00272aebd8c3263d97b2767108ea7a385 --- hack/release +++ hack/release @@ -1,55 +1,58 @@ #!/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//') +current=$(git tag --list 'v[0-9]*' --sort=-v:refname | head -n1) +current=${current#v} +usage="$(basename "$0") [--push] (${current:-none})" -if git tag | grep -qx "v$next"; then - echo "no releasable commits since v$next" - exit 0 -fi +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 -echo "releasing -> v$next" +[ -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" -# --- update Cargo.toml --- +[ "$(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" -sed -i "s/^version = .*/version = \"$next\"/" Cargo.toml -cargo generate-lockfile -git add Cargo.toml Cargo.lock +update_version_file "$version" -# --- changelog --- +git commit -m "release: v$version" +git tag -a "v$version" -m "v$version" -git-cliff --tag "v$next" --output CHANGELOG.md -sed -i -e :a -e '/^\s*$/{$d;N;ba' -e '}' CHANGELOG.md -git add CHANGELOG.md - -git commit -m "chore: release v$next" - -# --- tag and push --- - -git tag "v$next" -git push origin master --tags - -echo "released v$next successfully" +if [ "$push" -eq 1 ]; then + git push "$REMOTE" "$BRANCH" --follow-tags +fi