A flake app to upload to Hackage
Normally I use cabal sdist followed by cabal upload --publish[^cr] in the nix shell to upload a new release to Hackage.
- Can this be automated in an universal fashion?
- If so, would it be useful for this module to provide a flake app to do it all?
Then, something like nix run .#hackage-publish -- <package-name> could be used to build a sdist and publish to Hackage automatically. Though it is not clear which exact interface (CLI arguments, for instance) we want to support.
[^cr]: @locallycompact pointed me to this command.
(fyi)
I use this Haskell script based on Domen's releaser library, forking some of the functions. It has a bigger scope:
- short-circuit for unchanged packages
- package version bumps in cabal files
- start editor for final changelog edit
- committing
- tagging
- signing
- upload
- docs upload
- git push, git push --tags
I'd like to better automate the changelog stuff. Something that takes changes from separate files and determines the type of version bump major/minor/patch would be nice, making PRs more self contained without introducing merge conflicts. Also the short-circuiting should happen earlier.
It may be best to do this as separate flake-parts module. It can also do other things like resolving symlinks (by copying them to sdist): https://github.com/kowainik/summoner/pull/335/files#diff-245563af9e34754739b12b294f3324c1d42c116ace7ce8735e21dfbc82d8e064R19-R26