Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
name: ci
on: [push, pull_request]
jobs:
# CHANGELOG.md is the one changelog: the spec's %changelog and debian/changelog are generated from it,
# and a hand edit or a stale copy fails here
changelog:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: FreeMixer/.github/.github/actions/changelog@main

test:
runs-on: ubuntu-latest
# A backstop only: every test already carries its own timeout (tests/run-test.sh),
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
name: release

# Packages through the shared release workflows of FreeMixer/.github. A tag v<version> that is the newest
# entry of CHANGELOG.md builds signed RPMs (Fedora 44, x86_64 and aarch64) and DEBs (Debian bookworm and
# Packages through the shared release workflows of FreeMixer/.github. A tag v<version> builds signed RPMs (Fedora 44, x86_64 and aarch64) and DEBs (Debian bookworm and
# trixie, amd64 and arm64), publishes them to the FreeMixer channel and attaches them to the GitHub
# release, whose notes are the entry. Any other run, a pull request or a branch, is a dry run: it
# release. Any other run, a pull request or a branch, is a dry run: it
# builds and lints everything and publishes nothing.
#
# libreac is a build dependency of reac-pw, so publish a libreac release before the reac-pw release
Expand Down
20 changes: 4 additions & 16 deletions BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,29 +50,17 @@ One source builds two libraries, `libreac` and `libreac-transport`, as four bina
`packaging/*.pc.in`. `openwrt/libreac/Makefile` is the OpenWrt package.

The version and libreac's soname are defined once, in `include/reac/reac.h`;
`tests/conformance-packaging.sh` (part of `make test`) refuses a spec, `debian/` or `CHANGELOG.md`
`tests/conformance-packaging.sh` (part of `make test`) refuses a spec or `debian/`
that disagrees. libreac-transport's soname is its own, in `%global tabi` of the spec and `TABI` of
`debian/rules`, and names the `libreac-transport7` package.

### Changelog

`CHANGELOG.md` is the one changelog. The spec's `%changelog` and `debian/changelog` are generated
from it with `changelog.sh` of [FreeMixer/.github](https://github.com/FreeMixer/.github)
(`.github/actions/changelog/changelog.sh`), and CI refuses a copy that was edited by hand:

```
changelog.sh sync # rewrite the spec's %changelog and debian/changelog
changelog.sh check -t vX.Y.Z # what CI runs; the tag must be the newest entry
```

### Releasing

Add the version's entry to `CHANGELOG.md`, run `changelog.sh sync`, set the version in
`include/reac/reac.h` and `Version:` in the spec, then tag `vX.Y.Z`. The tag runs
Set the version in `include/reac/reac.h`, `Version:` in the spec and the top entry of
`debian/changelog`, then tag `vX.Y.Z`. The tag runs
`.github/workflows/release.yml`, which calls the shared `build-rpm.yml` and `build-deb.yml` workflows of
FreeMixer/.github: signed RPMs for Fedora 44 (x86_64, aarch64) and DEBs for Debian bookworm and trixie
(amd64, arm64) are published to the FreeMixer channel and attached to the GitHub release, whose notes are
the changelog entry. A pull request or a branch runs the same workflows as a dry run that builds, lints
(amd64, arm64) are published to the FreeMixer channel and attached to the GitHub release. Git history is the changelog; no changelog file is maintained. A pull request or a branch runs the same workflows as a dry run that builds, lints
and publishes nothing.

Publish a libreac release before the reac-pw release that builds against it.
70 changes: 0 additions & 70 deletions CHANGELOG.md

This file was deleted.

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ test: tests/test_reac_knock.c tests/test_reac_tapwait.c tests/test_reac_etf.c te
# freereac-ops and are cited by bare slug: the public half refuses a docs path, a docs
# tree or a build command in the README; the ops half resolves every slug in the
# sibling checkout, and says OPS-ABSENT (SKIP) where there is none.
# THE VERSION AND THE SONAMES HAVE ONE DEFINITION (reac.h); the spec, debian/ and CHANGELOG.md copy
# THE VERSION AND THE SONAMES HAVE ONE DEFINITION (reac.h); the spec and debian/ copy
# them, and a copy that lags is refused here instead of shipping a package that loads a stale ABI.
$(RUN_TEST) tests/conformance-packaging.sh
$(RUN_TEST) tests/conformance-public-docs.sh
Expand Down
9 changes: 2 additions & 7 deletions tests/conformance-packaging.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
# ARM 1 the spec's Version and the top of debian/changelog equal the header's version;
# ARM 2 the spec's %global abi, and the libreac<N> package of debian/control, equal LIBREAC_ABI;
# ARM 3 the spec's %global tabi, debian/rules' TABI and the libreac-transport<N> package of
# debian/control agree (libreac-transport's soname is its own);
# ARM 4 CHANGELOG.md's newest entry is the header's version (the shared changelog check, in CI,
# holds the generated spec and debian/changelog to CHANGELOG.md).
# debian/control agree (libreac-transport's soname is its own).
# It walks files, not `git ls-files`, so it also runs from the source tarball (%check). It carries a
# planted good/bad pair, so it cannot pass (or fail) vacuously.
#
Expand All @@ -38,15 +36,13 @@ check() {
deb_abi=$(sed -n 's/^Package: libreac\([0-9][0-9]*\)$/\1/p' "$t/debian/control")
deb_tabi=$(sed -n 's/^Package: libreac-transport\([0-9][0-9]*\)$/\1/p' "$t/debian/control")
rules_tabi=$(sed -n 's/^TABI *= *//p' "$t/debian/rules")
top=$(sed -n 's/^## \([0-9][0-9.]*\)\(-[0-9]*\)\{0,1\} - .*/\1/p' "$t/CHANGELOG.md" | head -1)

[ "$spec_ver" = "$ver" ] || { echo " ARM 1: the spec says Version $spec_ver, reac.h says $ver"; bad=1; }
[ "$deb_ver" = "$ver" ] || { echo " ARM 1: debian/changelog says $deb_ver, reac.h says $ver"; bad=1; }
[ "$spec_abi" = "$abi" ] || { echo " ARM 2: the spec says abi $spec_abi, reac.h says LIBREAC_ABI $abi"; bad=1; }
[ "$deb_abi" = "$abi" ] || { echo " ARM 2: debian/control names libreac$deb_abi, reac.h says LIBREAC_ABI $abi"; bad=1; }
[ -n "$spec_tabi" ] && [ "$spec_tabi" = "$deb_tabi" ] && [ "$spec_tabi" = "$rules_tabi" ] ||
{ echo " ARM 3: libreac-transport's soname: spec '$spec_tabi', debian/control '$deb_tabi', debian/rules '$rules_tabi'"; bad=1; }
[ "$top" = "$ver" ] || { echo " ARM 4: CHANGELOG.md's newest entry is $top, reac.h says $ver"; bad=1; }
return $bad
}

Expand All @@ -65,7 +61,6 @@ plant() { # <name>: a copy of the files the arms read
cp "$ROOT/include/reac/reac.h" "$P/$1/include/reac/"
cp "$ROOT/packaging/libreac.spec" "$P/$1/packaging/"
cp "$ROOT/debian/changelog" "$ROOT/debian/control" "$ROOT/debian/rules" "$P/$1/debian/"
cp "$ROOT/CHANGELOG.md" "$P/$1/"
}
plant good
plant bad
Expand All @@ -81,4 +76,4 @@ for arm in 1 2 3; do
echo "$out" | grep -q "ARM $arm" || { echo "NOT A RESULT: the planted tree did not trip ARM $arm"; exit 2; }
done

echo "conformance-packaging: PASS (version and sonames agree across reac.h, the spec, debian/ and CHANGELOG.md)"
echo "conformance-packaging: PASS (version and sonames agree across reac.h, the spec and debian/)"
Loading