Perhaps you will have better luck with https://github.com/ocamllabs/dune-release ? I’ve found it to be quite reliable. Although to be honest I haven’t tried to script it in batch mode.
first impression was that dune-release does too much/too opinionated… I wasn’t super keen to maintain a changelog, though I suppose it would be good practice
dune-release opam submit
[-] Submitting
dune-release: [ERROR] No change log specified in the package description.
I can’t find anything in dune-release opam submit --help except:
--change-log=FILE
The change log to use. If absent, provided by the package
description.
I can’t see any key for mypackage.opam that looks like a changelog in opam - Manual so I guess it means the description value? not sure what the content needs to look like to be recognised as a changelog though
In case there is some way via the package description I tried creating a mypackage.opam.template file:
changelog: "n/a"
so that Dune will add this key to the generated .opam file
but when I dune-release distrib I see:
[-] Performing lint for package spectrum in _build/mypackage-8d10ec7
[ OK ] File README is present.
[ OK ] File LICENSE is present.
[FAIL] File CHANGES is missing.
[ OK ] File opam is present.
[FAIL] lint opam file mypackage.opam:
opam lint -s messages:
/Users/anentropic/Dev/mypackage/_build/mypackage-8d10ec7/mypackage.opam: Errors.
error 3: File format error in 'changelog' at line 39, column 0: Invalid field changelog
and if I then dune-release opam pkg and dune-release opam submit I still get:
[-] Submitting
dune-release: [ERROR] No change log specified in the package description.
Finally I got rid of the opam template and created a dummy CHANGES file that just said “see git commit history”
That linted ok but I got:
dune-release opam submit
[-] Submitting
dune-release: [ERROR] ./CHANGES: Could not parse change log.
So it seems like I have to have a CHANGES file formatted in the way that dune-release expects