Skip to content

Automate Hackage release #2275

@steve-chavez

Description

@steve-chavez

Manual Hackage releases can lag considerably - I just released https://hackage.haskell.org/package/postgrest-9.0.0 🤦‍♂️

This should be automated on CI.

Steps I follow:

$ nix-shell

$ cabal v2-haddock --haddock-for-hackage --enable-doc
$ cabal sdist # might not be necessary

$ cabal upload dist-newstyle/sdist/postgrest-9.0.0.tar.gz
hackage.haskell.org username:
hackage.haskell.org password:
Uploading dist-newstyle/sdist/postgrest-9.0.0.tar.gz...
Error uploading dist-newstyle/sdist/postgrest-9.0.0.tar.gz: http code 400
Error: Invalid package

'ghc-options: -fhpc' is not necessary. Use the configure flag
--enable-coverage instead.

# I manually remove the fhpc from postgrest.cabal and run cabal sdist again

$ cabal upload dist-newstyle/sdist/postgrest-9.0.0.tar.gz
hackage.haskell.org username: 
hackage.haskell.org password:
Uploading dist-newstyle/sdist/postgrest-9.0.0.tar.gz...
Error uploading dist-newstyle/sdist/postgrest-9.0.0.tar.gz: http code 400
Error: Invalid package

'ghc-options: -Wall -Werror' makes the package very easy to break with future
GHC versions because new GHC versions often add new warnings. Use just
'ghc-options: -Wall' instead. Alternatively, if you want to use this, make it
conditional based on a Cabal configuration flag (with 'manual: True' and
'default: False') and enable that flag during development.

# Same with above, rerun cabal sdist

$ cabal upload dist-newstyle/sdist/postgrest-9.0.0.tar.gz
hackage.haskell.org username: 
hackage.haskell.org password:
Uploading dist-newstyle/sdist/postgrest-9.0.0.tar.gz...
Package successfully uploaded as candidate. You can now preview the result at
'https://hackage.haskell.org/package/postgrest-9.0.0/candidate'. To publish
the candidate, use 'cabal upload --publish'.
Warnings:
- 'ghc-options: -O0' is not needed. Use the --disable-optimization configure
flag.
- 'ghc-options: -O0' is not needed. Use the --disable-optimization configure
flag.
- 'ghc-options: -O2' is rarely needed. Check that it is giving a real benefit
and not just imposing longer compile times on your users.

# The above succeeded

# For docs
cabal upload -d dist-newstyle/postgrest-9.0.0-docs.tar.gz
hackage.haskell.org username: 
hackage.haskell.org password:
Uploading documentation dist-newstyle/postgrest-9.0.0-docs.tar.gz...
Documentation successfully uploaded for package candidate. You can now preview
the result at 'https://hackage.haskell.org/package/postgrest-9.0.0/candidate'.
To upload non-candidate documentation, use 'cabal upload --publish'.

# The above were just for generating a candidate for CI we should use the following directly
$ cabal upload --publish dist-newstyle/sdist/postgrest-9.0.0.tar.gz
$ cabal upload -d --publish dist-newstyle/postgrest-9.0.0-docs.tar.gz

We should probably clear some of those warnings with flags in the .cabal file.

References:

Metadata

Metadata

Assignees

No one assigned

    Labels

    ciRelated to CI setup

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions