pdulvp.fr

prel release builds and uploads the release artifacts has been fixed.

See more details at : https://github.com/pdulvp/prel/issues/3

  • prel.buildCommand and prel.artifacts in a project's git config are enough

for prel release <x.y.z> to build its .deb and .zip and put them on the
GitHub release; a project that sets neither is untouched

  • the build runs before the push, so a failed build - or a glob matching no

file - undoes the commit and the tag and leaves nothing published, instead of
a public tag whose release holds no files and a version already spent

  • the release is created as a draft and taken out of draft only once every

artifact is up, so it is never visible without them; --draft leaves it one

  • --no-build uploads what is already on disk, for a build done by hand or by

CI; --no-assets skips both steps and --no-release implies it

  • docs/plans/README.md states the convention of that folder, which the

gitignore now excepts from ignoring the rest of it

Release artifacts: build and upload them inside prel release

<sub>2026-10-21-1820-release-artifacts.md — 2026-10-21 18:20</sub>

Goal

A project whose build produces release artifacts (a cmake target writing
build/*.deb, build-win/*.zip) should get them onto its GitHub release from
the one command that already makes the release. No second command: `prel
release <x.y.z>` reads two new git config keys and does the extra steps when
they are set, and behaves exactly as today when they are not.

git config prel.buildCommand "cmake --build build --target release"
git config prel.artifacts "build/.deb build-win/.zip"

Order of the steps

The build runs while everything is still local and undoable, so a broken build
never leaves a pushed tag behind. The push stays the point of no return.

  1. preconditions (as today, plus the build command and the artifact globs)
  2. write the VERSION file
  3. commit it, tag it <- local only
  4. run prel.buildCommand <- failure here: roll 2 and 3 back
  5. expand prel.artifacts, stop if a pattern matched nothing
  6. push the branch and the tag
  7. gh release create --draft <- always a draft when there are artifacts
  8. gh release upload --clobber
  9. gh release edit --draft=false (skipped when --draft was asked for)

Rollback of 2 and 3 must not touch anything else in the tree: the version file
is copied aside before it is written, and the undo is git tag -d, `git reset
--soft HEAD~1, git reset -- <version file>`, then the copy back. No
reset --hard - the command tolerates a dirty tree, so it must not discard it.

Steps

  • [x] scripts/release.sh: _rel_build_command and _rel_artifacts_spec

readers, alongside _rel_version_file and _rel_tag_prefix

  • [x] scripts/release.sh: _rel_expand_artifacts - expands the globs under

nullglob, prints the matches, names the patterns that matched nothing

  • [x] scripts/release.sh: _rel_rollback_release_commit - the undo above
  • [x] scripts/release.sh: --no-build and --no-assets options, and

--no-release implying both; usage text for all three

  • [x] scripts/release.sh: the plan block (and -n) shows the build command,

the artifact patterns and which ones currently match

  • [x] scripts/release.sh: steps 4, 5, 8 and 9 in release(), draft-always

when there are artifacts, --draft meaning only "do not undraft"

  • [x] test: -n on this repo (no config) is unchanged
  • [x] test: a throwaway repo with both keys set, a build that writes a file, a

failing build, and a glob that matches nothing

  • [x] README.md: the prel release section and the two new config keys
  • [x] .gitignore: docs/plans/* plus !docs/plans/README.md, and write that

README - the convention the memory asks for, which this repo lacks

  • [x] mark complete, write docs/plans/sumup.md, archive this file

<sub>Filed by prel from the completed plans at commit time.</sub>