semantic-release-hackage
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

semantic-release-hackage

semantic-release plugin to publish a haskell package to Hackage

Motivation

Semantic-release is widely used in the development world but have not been implemented for haskell projects and applications until now. This plugin is intended to help you creating your candidate releases for a hackage package using the benefits of semantic-release

Steps

Step Description
verifyConditions verify the environment variable HACKAGE_TOKEN
prepare Update the version of .cabal file and create the distribution package (.tar)
publish Publish the hackage package to the specified repository

Environment variables

Variable Description Required
HACKAGE_TOKEN API token for hackage true

Install

With npm:

npm install semantic-release-hackage -D

With yarn:

yarn add semantic-release-hackage --dev

Usage

The plugin can be configured in the semantic-release configuration file. Here is a minimal example:

{
  "plugins": [
    "@semantic-release/commit-analyzer",
    "@semantic-release/release-notes-generator",
    [
      "semantic-release-hackage",
      {
        "cabalFile": "yourcabalfilename",
        "packageName": "yourpackagename",
        "versionPrefix": "0."
      }
    ]
  ]
}

Configuration

Property Description Default Required
cabalFile Cabal file name Plugin will read your root .cabal file name false
packageName Package name in Hackage true
versionPrefix For supporting Haskell package versions false

Why adding a versionPrefix configuration?

PVP is the standard versioning system for Haskell projects which is different from Semantic Versioning. You may think that since this is a semantic-release plugin, you'll have to move out from PVP. But thanks to the versionPrefix option, you can keep the 4th digit in your version.

This is just an optional feature to enable backward compatibility when starting to use this plugin.

We strongly recommend moving to semantic versioning to keep things simple and follow a well-known standard. But versionPrefix can save the day if changing the versioning system is not an option.

For example, if you have the version number 0.2.0.7 and want to create a new release for a new feature, semantic-release is going to infer the next version as 2.1.0, you can keep your previous versioning by adding the following to the plugin configuration:

"versionPrefix" : "0."

The plugin will add the 0. prefix to the new version, so your final version will be 0.2.1.0.

License

MIT, see the LICENSE file.

Contributing

Do you want to contribute to this project? Please take a look at our contributing guideline to know how you can help us build it.


Stack Builders
Check out our libraries | Join our team

Package Sidebar

Install

npm i semantic-release-hackage

Weekly Downloads

0

Version

1.0.4

License

MIT

Unpacked Size

27 kB

Total Files

39

Last publish

Collaborators

  • stackbuildersinc