Originally written 2020-05-16
dune-release
is a good improvement over the old opam-publish
, but releasing
software is still clearly not a solved problem, and I find it hard to remember
the exact steps involved in releasing an opam package, especially if some time
has passed since the last release. This note is an attempt at having a place
that I can refer to when occasionally releasing my software to opam.
- First things first: lint your opam files:
$ dune-release lint
- (Optional) Build a distribution archive to check that the project builds
(optionally pass
-p pkg1,pkg2
) to build just a few packages. I've also found--skip-tests
useful here for repos that have e.g. submodules.
$ dune-release distrib
- Tag a VCS release in your repository:
$ dune-release tag x.y.z
- Distribute the release archive and upload it to GitHub (don't forget to
point
dune-release
at your changelog -- I've found the algorithm for finding the changes file is a little clunky):
$ dune-release distrib && dune-release publish distrib --change-log=./CHANGES.md
- Package the opam release:
$ dune-release opam pkg -p pkg1,pkg2 --change-log=./CHANGES.md
- Submit the release to the opam repository:
$ dune-release opam submit --change-log=./CHANGES.md