httpd: Set up the tag release flow

- Rename RADICLE_VERSION to RADICLE_HTTPD_VERSION, apart from
  heartwood's RADICLE_VERSION
- Add Unreleased sections to the changelog and API changes log, so
  patches add their highlights as they land
- Replace the release patch with a signed tag that one delegate
  pushes
- Stop pushing the tag from upload: the delegate who makes the tag
  pushes it
- Remove build/changelog
- Add build/prepare to rename the Unreleased sections, in POSIX sh
  and awk
- Ask a major release to set the target date to drop the previous
  major
- Fix the signing key setup: use the bare key that build/tag
  compares against
This commit is contained in:
Daniel Norman
2026-10-29 18:32:03 +01:00
parent d8f363ca99
commit e1f7a40c63
13 changed files with 140 additions and 208 deletions
+53 -59
View File
@@ -32,97 +32,91 @@ for which releases explorer supports.
- Git signing configured via SSH:
```sh
git config set gpg.format ssh
git config set user.signingKey "key::$(rad self --ssh-key)"
git config set user.signingKey "$(rad self --ssh-key)"
```
- Working `podman` setup (see [Podman Setup](#podman-setup) below)
- Required tools: `podman`, `rad`, `sha256sum`
## Prepare Release
## Prepare
1. Create release branch:
Normal patches add their highlights to `## Unreleased` in
[`CHANGELOG.md`](CHANGELOG.md). Note in each entry whether the change belongs to
`radicle-httpd` or `radicle-search`.
## Release
1. Update `master`:
```sh
git checkout -b release/httpd/<version>
git switch master
git pull --ff-only rad master
```
2. Generate changelog:
2. Make the release commit. The script renames `## Unreleased` to the version in
`CHANGELOG.md` and [`docs/api-changes.md`](docs/api-changes.md), and adds a
new empty `## Unreleased` to each:
```sh
crates/radicle-httpd/build/changelog <version> >> CHANGELOG.md
crates/radicle-httpd/build/prepare <version>
```
3. Edit changelog and remove irrelevant entries. Note in each entry whether a
change belongs to `radicle-httpd` or `radicle-search`.
4. Fill in the `## API changes` section from
[`docs/api-changes.md`](docs/api-changes.md). If the release bumps the major,
write the target date to drop the previous major in that file, three months
from today.
5. Commit release:
Check the diff. Then add the API changes from `docs/api-changes.md` to the
new section in `CHANGELOG.md`. If the release bumps the major, set the target
date to drop the previous major in `## Support` of `docs/api-changes.md`,
three months from today. Then commit:
```sh
git commit -m "Release <version>"
git commit -am "httpd: Release <version>"
```
6. Push for review:
3. Make and sign the tag. The script checks the signing key:
```sh
git push rad HEAD:refs/patches
crates/radicle-httpd/build/tag <version>
```
## Review & Merge
4. Push the commit and the tag. Push only this tag, not `--tags`. The push
reports that the canonical reference is updated:
1. Wait for delegate approvals
2. Merge patch into `master`
```sh
git push rad master refs/tags/releases/httpd/<version>
rad sync --announce
```
## Tag Release
## Build and upload
Create and sign the release tag (one tag covers both binaries):
Do these steps after the tag is canonical.
```sh
crates/radicle-httpd/build/tag <version>
```
1. Check out the tag. The build reads the version from it with `git describe`:
Publish the tag to Radicle. Push only this tag: every tag under `releases/` that
a delegate pushes becomes canonical, so `--tags` would also publish any stray
local ones.
```sh
git switch --detach releases/httpd/<version>
```
```sh
git push rad refs/tags/releases/httpd/<version>
rad sync
```
2. Run the reproducible build (Linux x86_64 or macOS). A single run compiles the
workspace and packages **both** binaries, one archive per binary per target:
## Build Artifacts
```sh
crates/radicle-httpd/build/build
```
Run the reproducible build (Linux x86_64 or macOS). A single run compiles the
workspace and packages **both** binaries — one archive per binary per target:
This writes to `crates/radicle-httpd/build/artifacts/`:
- `radicle-httpd-<version>-<target>.tar.xz` (binary + man page)
- `radicle-search-<version>-<target>.tar.xz` (binary)
```sh
crates/radicle-httpd/build/build
```
each with a `.sig` and `.sha256` alongside.
This writes to `crates/radicle-httpd/build/artifacts/`:
3. Upload. This publishes each binary into its own sibling folder on
[files.radicle.dev][files] and creates the version-less and `latest` symlinks
for both:
- `radicle-httpd-<version>-<target>.tar.xz` (binary + man page)
- `radicle-search-<version>-<target>.tar.xz` (binary)
```sh
SSH_LOGIN=<username> crates/radicle-httpd/build/upload
```
each with a `.sig` and `.sha256` alongside.
> **Warning:** Uploading immediately publishes the release.
> **Note:** A tagged commit is required; versioning uses `git describe`.
## Upload Artifacts
The upload publishes each binary into its own sibling folder on
[files.radicle.dev][files] and creates the version-less and `latest` symlinks
for both:
```sh
SSH_LOGIN=<username> crates/radicle-httpd/build/upload
```
> **Warning:** Uploading immediately publishes the release.
## Announce Release
## Announce
1. Mark the previous release as resolved in Zulip `#Announcements`
@@ -147,7 +141,7 @@ SSH_LOGIN=<username> crates/radicle-httpd/build/upload
## Changelog
<copy output from crates/radicle-httpd/build/changelog>
<copy the <version> section from CHANGELOG.md>
## Checksums
+2 -2
View File
@@ -21,7 +21,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
.unwrap_or("unknown".into())
});
let version = if let Ok(version) = env::var("RADICLE_VERSION") {
let version = if let Ok(version) = env::var("RADICLE_HTTPD_VERSION") {
version
} else {
"pre-release".to_owned()
@@ -46,7 +46,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
.unwrap_or(0.to_string())
});
println!("cargo::rustc-env=RADICLE_VERSION={version}");
println!("cargo::rustc-env=RADICLE_HTTPD_VERSION={version}");
println!("cargo::rustc-env=SOURCE_DATE_EPOCH={commit_time}");
println!("cargo::rustc-env=GIT_HEAD={hash}");
+16 -16
View File
@@ -9,7 +9,7 @@ COPY . .
ARG TZ
ARG LC_ALL
ARG SOURCE_DATE_EPOCH
ARG RADICLE_VERSION
ARG RADICLE_HTTPD_VERSION
ARG GIT_HEAD
# Copy cargo configuration we're going to use to specify compiler options.
@@ -21,8 +21,8 @@ RUN apk update && apk add --no-cache git musl-dev xz asciidoctor zig
RUN asciidoctor --doctype manpage --backend manpage --destination-dir . \
--source-dir crates/radicle-httpd crates/radicle-httpd/*.1.adoc && \
find . -maxdepth 1 -type f -name '*.1' -exec sed -i '/^.\\\"/d' '{}' \;
RUN echo "{ \"name\": \"radicle-httpd\", \"version\": \"${RADICLE_VERSION}\", \"commit\": \"${GIT_HEAD}\", \"timestamp\": \"${SOURCE_DATE_EPOCH}\" }" > /src/radicle-httpd.json
RUN echo "{ \"name\": \"radicle-search\", \"version\": \"${RADICLE_VERSION}\", \"commit\": \"${GIT_HEAD}\", \"timestamp\": \"${SOURCE_DATE_EPOCH}\" }" > /src/radicle-search.json
RUN echo "{ \"name\": \"radicle-httpd\", \"version\": \"${RADICLE_HTTPD_VERSION}\", \"commit\": \"${GIT_HEAD}\", \"timestamp\": \"${SOURCE_DATE_EPOCH}\" }" > /src/radicle-httpd.json
RUN echo "{ \"name\": \"radicle-search\", \"version\": \"${RADICLE_HTTPD_VERSION}\", \"commit\": \"${GIT_HEAD}\", \"timestamp\": \"${SOURCE_DATE_EPOCH}\" }" > /src/radicle-search.json
# Add cargo targets.
RUN rustup target add \
x86_64-unknown-linux-musl \
@@ -55,7 +55,7 @@ RUN cargo zigbuild --locked --release \
# save some space.
FROM alpine:3.21 as packager
ARG RADICLE_VERSION
ARG RADICLE_HTTPD_VERSION
ARG SOURCE_DATE_EPOCH
COPY --from=builder \
@@ -66,34 +66,34 @@ COPY --from=builder \
# radicle-httpd: binary plus man page, one directory per target.
COPY --from=builder \
/src/target/x86_64-unknown-linux-musl/release/radicle-httpd \
/builds/radicle-httpd-${RADICLE_VERSION}-x86_64-unknown-linux-musl/bin/
/builds/radicle-httpd-${RADICLE_HTTPD_VERSION}-x86_64-unknown-linux-musl/bin/
COPY --from=builder \
/src/target/aarch64-unknown-linux-musl/release/radicle-httpd \
/builds/radicle-httpd-${RADICLE_VERSION}-aarch64-unknown-linux-musl/bin/
/builds/radicle-httpd-${RADICLE_HTTPD_VERSION}-aarch64-unknown-linux-musl/bin/
COPY --from=builder \
/src/target/aarch64-apple-darwin/release/radicle-httpd \
/builds/radicle-httpd-${RADICLE_VERSION}-aarch64-apple-darwin/bin/
/builds/radicle-httpd-${RADICLE_HTTPD_VERSION}-aarch64-apple-darwin/bin/
COPY --from=builder \
/src/target/x86_64-apple-darwin/release/radicle-httpd \
/builds/radicle-httpd-${RADICLE_VERSION}-x86_64-apple-darwin/bin/
COPY --from=builder /src/*.1 /builds/radicle-httpd-${RADICLE_VERSION}-x86_64-unknown-linux-musl/man/man1/
COPY --from=builder /src/*.1 /builds/radicle-httpd-${RADICLE_VERSION}-aarch64-unknown-linux-musl/man/man1/
COPY --from=builder /src/*.1 /builds/radicle-httpd-${RADICLE_VERSION}-aarch64-apple-darwin/man/man1/
COPY --from=builder /src/*.1 /builds/radicle-httpd-${RADICLE_VERSION}-x86_64-apple-darwin/man/man1/
/builds/radicle-httpd-${RADICLE_HTTPD_VERSION}-x86_64-apple-darwin/bin/
COPY --from=builder /src/*.1 /builds/radicle-httpd-${RADICLE_HTTPD_VERSION}-x86_64-unknown-linux-musl/man/man1/
COPY --from=builder /src/*.1 /builds/radicle-httpd-${RADICLE_HTTPD_VERSION}-aarch64-unknown-linux-musl/man/man1/
COPY --from=builder /src/*.1 /builds/radicle-httpd-${RADICLE_HTTPD_VERSION}-aarch64-apple-darwin/man/man1/
COPY --from=builder /src/*.1 /builds/radicle-httpd-${RADICLE_HTTPD_VERSION}-x86_64-apple-darwin/man/man1/
# radicle-search: binary only, one directory per target, as a sibling archive.
COPY --from=builder \
/src/target/x86_64-unknown-linux-musl/release/radicle-search \
/builds/radicle-search-${RADICLE_VERSION}-x86_64-unknown-linux-musl/bin/
/builds/radicle-search-${RADICLE_HTTPD_VERSION}-x86_64-unknown-linux-musl/bin/
COPY --from=builder \
/src/target/aarch64-unknown-linux-musl/release/radicle-search \
/builds/radicle-search-${RADICLE_VERSION}-aarch64-unknown-linux-musl/bin/
/builds/radicle-search-${RADICLE_HTTPD_VERSION}-aarch64-unknown-linux-musl/bin/
COPY --from=builder \
/src/target/aarch64-apple-darwin/release/radicle-search \
/builds/radicle-search-${RADICLE_VERSION}-aarch64-apple-darwin/bin/
/builds/radicle-search-${RADICLE_HTTPD_VERSION}-aarch64-apple-darwin/bin/
COPY --from=builder \
/src/target/x86_64-apple-darwin/release/radicle-search \
/builds/radicle-search-${RADICLE_VERSION}-x86_64-apple-darwin/bin/
/builds/radicle-search-${RADICLE_HTTPD_VERSION}-x86_64-apple-darwin/bin/
# Create and compress reproducible archives. Every top-level release directory
# (radicle-httpd-* and radicle-search-*) becomes its own `.tar.xz`; the loose
+2 -2
View File
@@ -61,7 +61,7 @@ main() {
--build-arg SOURCE_DATE_EPOCH \
--build-arg TZ \
--build-arg LC_ALL \
--build-arg RADICLE_VERSION=$version \
--build-arg RADICLE_HTTPD_VERSION=$version \
--build-arg GIT_HEAD=$rev \
--arch $ARCH --tag $image -f "$(dirname "$0")/Dockerfile" "$context"
@@ -75,7 +75,7 @@ main() {
--build-arg TZ \
--build-arg LC_ALL \
--build-arg GIT_HEAD=$rev \
--build-arg RADICLE_VERSION=$version \
--build-arg RADICLE_HTTPD_VERSION=$version \
--arch $ARCH --tag $image -f "$(dirname "$0")/Dockerfile" "$context"
echo "Creating container (radicle-build-container).."
@@ -1,111 +0,0 @@
#!/bin/sh
set -e
usage="Usage: $0 <version> [--from-version <version>]"
if [ $# -lt 1 ]; then
echo "$usage" >&2
exit 1
fi
# Version to generate the changelog for. The release tag sets it, not
# Cargo.toml.
version="$1"
shift
# Version from which to generate the changelog.
from=""
while [ $# -gt 0 ]; do
case "$1" in
--from-version)
if [ -z "$2" ]; then
echo "error: '--from-version' requires a version number" >&2
exit 1
fi
shift
from=$(echo "$1" | sed 's/^releases\/httpd\///')
break
;;
*)
echo "error: unknown argument '$1'" >&2
echo "$usage" >&2
exit 1
;;
esac
done
# Current/latest tag or HEAD
current="releases/httpd/${version}"
# Check if the tag exists, otherwise use HEAD
if git rev-parse --verify "$current^{tag}" >/dev/null 2>&1; then
use_head=false
else
echo "warning: tag '$current' not found, using HEAD instead" >&2
current="HEAD"
use_head=true
fi
if [ -z "$from" ]; then
# Try to find the previous tag
if previous=$(git describe --tags --abbrev=0 --match='releases/httpd/*' "$current^" 2>/dev/null); then
: # previous tag found
else
# No previous tag found, use the first commit
previous=$(git rev-list --max-parents=0 HEAD)
echo "warning: no previous release tag found, using first commit" >&2
fi
else
previous="releases/httpd/$from"
fi
if [ -n "$from" ] && ! git rev-parse --verify "$previous^{tag}" >/dev/null 2>&1; then
echo "error: '$from' is not a valid version, tag '$previous' not found" >&2
exit 1
fi
echo "# radicle-httpd + radicle-search $version"
echo
echo "radicle-httpd and radicle-search $version ($(git rev-parse --short HEAD)) are released."
echo
echo "## Changelog"
range="${previous}..${current}"
# The desktop app in desktop/ is released separately. Leaving it out also keeps
# its whole history, merged in after the 0.29.0 release, out of the next log.
exclude=":(top,exclude)desktop"
ncommits=$(git rev-list --count "$range" -- "$exclude")
ncontribs=$(git log "$range" --format='%ae' -- "$exclude" | sort -u | wc -l)
echo
echo "This release contains $ncommits commit(s) by $ncontribs contributor(s)."
echo
# shellcheck disable=SC2016
git log --pretty=format:'* `%h` **%s** *<%ae>*' "$range" -- "$exclude"
echo
echo
echo "## API changes"
echo
echo "For node operators and explorer deployments. Fill in from docs/api-changes.md."
echo
echo "### New"
echo
echo "* None."
echo
echo "### Deprecated"
echo
echo "* None. (Name each old field or path and its removal date.)"
echo
echo "### Removed"
echo
echo "* None."
echo
echo "## Checksums"
echo
echo '```'
"$(dirname "$0")/checksums"
echo '```'
+48
View File
@@ -0,0 +1,48 @@
#!/bin/sh
# shellcheck disable=SC2016
set -e
if [ $# -ne 1 ]; then
echo "Usage: $0 <version-number>"
exit 1
fi
version="$1"
cd "$(dirname "$0")/../../.."
if ! git diff --quiet HEAD; then
echo "fatal: the working copy has changes, commit or discard them first" >&2
exit 1
fi
# Run an awk program over a file in place, and keep the file's mode.
# `sed -i` differs between macOS and Linux.
edit() {
if ! awk "$@" > "$file.tmp"; then
rm -f "$file.tmp"
echo "fatal: could not update $file" >&2
exit 1
fi
cat "$file.tmp" > "$file"
rm "$file.tmp"
}
# Rename the first `## Unreleased` and add an empty one above it.
release_section() {
edit -v heading="## $1" '
!done && $0 == "## Unreleased" { print; print ""; print heading; done = 1; next }
{ print }
END { if (!done) { print "fatal: no ## Unreleased heading" > "/dev/stderr"; exit 1 } }
' "$file"
}
file=CHANGELOG.md
release_section "radicle-httpd + radicle-search $version"
file=docs/api-changes.md
release_section "$version"
git diff --stat
echo
echo "Check the diff, add the API changes to CHANGELOG.md, then commit."
@@ -54,11 +54,6 @@ main() {
fi
done
if [ "$tagged" = true ]; then
echo "Pushing tag releases/httpd/$version.."
git push rad "refs/tags/releases/httpd/$version"
fi
echo "Done."
}
+1 -1
View File
@@ -27,7 +27,7 @@ use crate::api::error::Error;
use crate::cache::Cache;
use crate::Options;
pub const RADICLE_VERSION: &str = env!("RADICLE_VERSION");
pub const RADICLE_HTTPD_VERSION: &str = env!("RADICLE_HTTPD_VERSION");
/// Prefix of a qualified branch reference.
const REFS_HEADS: &str = "refs/heads/";
+2 -2
View File
@@ -10,7 +10,7 @@ use axum::routing::get;
use axum::Router;
use serde_json::json;
use crate::api::{Context, RADICLE_VERSION};
use crate::api::{Context, RADICLE_HTTPD_VERSION};
pub fn router(ctx: Context) -> Router {
let root_router = Router::new()
@@ -30,7 +30,7 @@ async fn root_handler(State(ctx): State<Context>) -> impl IntoResponse {
let response = json!({
"message": "Welcome!",
"service": "radicle-httpd",
"version": format!("{}-{}", RADICLE_VERSION, env!("GIT_HEAD")),
"version": format!("{}-{}", RADICLE_HTTPD_VERSION, env!("GIT_HEAD")),
"nid": ctx.profile.public_key,
"path": "/api",
"links": [
+2 -2
View File
@@ -31,7 +31,7 @@ use tracing::Span;
use radicle::identity::RepoId;
use radicle::Profile;
use crate::api::RADICLE_VERSION;
use crate::api::RADICLE_HTTPD_VERSION;
use crate::tracing_extra::{log_response, tracing_middleware, RequestId, TracingInfo};
mod api;
@@ -188,7 +188,7 @@ fn router(options: Options, profile: Arc<Profile>, ctx: api::Context) -> anyhow:
async fn root_index_handler() -> impl IntoResponse {
let response = serde_json::json!({
"welcome": "Welcome to the radicle-httpd JSON API, this service doesn't serve the Radicle Explorer web client.",
"version": format!("{}-{}", RADICLE_VERSION, env!("GIT_HEAD")),
"version": format!("{}-{}", RADICLE_HTTPD_VERSION, env!("GIT_HEAD")),
"path": "/",
"links": [
{
+6 -2
View File
@@ -10,7 +10,7 @@ use radicle_httpd as httpd;
pub const VERSION: Version = Version {
name: "radicle-httpd",
commit: env!("GIT_HEAD"),
version: env!("RADICLE_VERSION"),
version: env!("RADICLE_HTTPD_VERSION"),
timestamp: env!("SOURCE_DATE_EPOCH"),
};
@@ -44,7 +44,11 @@ async fn main() -> anyhow::Result<()> {
// SAFETY: The logger is only initialized once.
httpd::logger::init().unwrap();
tracing::info!("starting http daemon..");
tracing::info!("version {} ({})", env!("RADICLE_VERSION"), env!("GIT_HEAD"));
tracing::info!(
"version {} ({})",
env!("RADICLE_HTTPD_VERSION"),
env!("GIT_HEAD")
);
let options = parse_options()?;
+7 -5
View File
@@ -3,10 +3,12 @@
Breaking changes to the httpd API that are between expand and contract.
[ADR 0001](adr/0001-expand-and-contract-api-changes.md) has the rules.
- When a change expands, add a section under its release, newest first, and add
its removals to the table.
- When a release bumps the major, set the target date in `## Support`. Its
`## API changes` notes come from its sections and from the server removals.
- When a change expands, add a section under `## Unreleased`, and add its
removals to the table.
- When a release ships, build/prepare renames `## Unreleased` to its version.
When the release bumps the major, add a target date to drop the previous major
in `## Support`. Its `## API changes` notes come from its sections and from
the server removals.
- When code is removed, delete its row. When a change has no rows left, delete
its section.
@@ -28,7 +30,7 @@ Explorer supports httpd 0.28.0 and newer, set by `minimumSupportedVersion` in
| A major release | Server | Repo facts | Legacy `meta` and `head` in `crates/radicle-httpd/src/api.rs` |
| A major release | Server | Release scope | `allAuthors` in `crates/radicle-httpd/src/api/query.rs` |
## Next release
## Unreleased
### API at `/api`
+1 -1
View File
@@ -139,7 +139,7 @@
env =
{
RADICLE_VERSION = "nix-" + (self.shortRev or self.dirtyShortRev or "unknown");
RADICLE_HTTPD_VERSION = "nix-" + (self.shortRev or self.dirtyShortRev or "unknown");
}
// (
if self ? rev || self ? dirtyRev