From bf16d427b8d39c9aa60367f27de511716e402093 Mon Sep 17 00:00:00 2001 From: Bendik Aagaard Lynghaug Date: Wed, 7 Oct 2026 15:48:45 +0200 Subject: [PATCH] release: cargo-release config for tag-driven releases `cargo release patch --execute` now does what the last three releases did by hand: bump Cargo.toml/Cargo.lock, rewrite PKGBUILD's pkgver, stamp the "## Unreleased" changelog section with version and date, commit as "release X.Y.Z", tag vX.Y.Z and push commit and tag to the gitea remote (not `origin`, which is the GitHub upstream). The tag then triggers .gitea/workflows/release.yml as before. No crates.io publish. CHANGELOG.md gets a standing "## Unreleased" section to collect entries between releases; README documents the flow. Co-Authored-By: Claude Fable 5.1 --- CHANGELOG.md | 2 ++ README.md | 11 +++++++++++ release.toml | 26 ++++++++++++++++++++++++++ 3 files changed, 39 insertions(+) create mode 100644 release.toml diff --git a/CHANGELOG.md b/CHANGELOG.md index d07786c..afa824c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # Changelog +## Unreleased + ## 0.4.3 (2026-10-05) - Backlight: a config with a `!backlight` widget on a machine without `/sys/class/backlight` entries (or with a `device` name that does not exist) panicked at start ("did not find backlight device"), fatal with `panic = "abort"`. The widget now warns once on stderr, renders empty and ignores clicks, so one config can be shared between a laptop and a desktop. diff --git a/README.md b/README.md index 8b82c9f..1bf0412 100644 --- a/README.md +++ b/README.md @@ -79,6 +79,17 @@ The launcher also accepts prefix operators to change its mode: - Scaling of any kind - all sizes are currently hardcoded in pixels +## Releasing + +Releases are cut with [cargo-release](https://github.com/crate-ci/cargo-release) (`cargo install cargo-release`), configured in `release.toml`. Put a line for each change under `## Unreleased` in `CHANGELOG.md` as you go, then on a clean `master`: + +``` +cargo release patch # dry run: shows the bump, replacements and tag +cargo release patch --execute # do it (minor/major or an explicit version also work) +``` + +This bumps `Cargo.toml`, `Cargo.lock` and `PKGBUILD` to the same version, stamps the changelog section with the version and date, commits as `release X.Y.Z`, tags `vX.Y.Z` and pushes commit and tag to the `gitea` remote. The tag triggers `.gitea/workflows/release.yml`, which builds the package per architecture and uploads it to the `[uhhm]` registry. The workflow refuses a tag whose version disagrees with `PKGBUILD` or `Cargo.toml`, which cannot happen when the tag comes from cargo-release. + ## How to discuss Go to #kennylevinsen @ irc.libera.chat to discuss, or use [~kennylevinsen/public-inbox@lists.sr.ht](https://lists.sr.ht/~kennylevinsen/public-inbox). diff --git a/release.toml b/release.toml new file mode 100644 index 0000000..34d8c8c --- /dev/null +++ b/release.toml @@ -0,0 +1,26 @@ +# cargo-release settings. Cut a release with +# +# cargo release patch # dry run, shows what would change +# cargo release patch --execute +# +# (or `minor`, `major`, or an explicit version). It bumps Cargo.toml and +# Cargo.lock, rewrites PKGBUILD's pkgver, turns the "## Unreleased" +# section of CHANGELOG.md into "## X.Y.Z (date)", commits, tags +# vX.Y.Z and pushes commit + tag to the gitea remote. That tag is what +# .gitea/workflows/release.yml builds and uploads to the [uhhm] registry. + +# Not on crates.io; the package goes to the Arch registry via the tag. +publish = false +# `origin` is the upstream kennylevinsen fork on GitHub; releases go to +# project.uhhm.no, and the workflow only runs there. +push-remote = "gitea" +allow-branch = ["master"] +tag-name = "v{{version}}" +tag-message = "wldash {{version}}" +pre-release-commit-message = "release {{version}}" + +pre-release-replacements = [ + { file = "PKGBUILD", search = "^pkgver=.*", replace = "pkgver={{version}}", exactly = 1 }, + { file = "PKGBUILD", search = "^pkgrel=.*", replace = "pkgrel=1", exactly = 1 }, + { file = "CHANGELOG.md", search = "^## Unreleased$", replace = "## {{version}} ({{date}})", exactly = 1 }, +]