semantic-release plugin to publish a haskell package to Hackage
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
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 |
Variable | Description | Required |
---|---|---|
HACKAGE_TOKEN |
API token for hackage | true |
With npm:
npm install semantic-release-hackage -D
With yarn:
yarn add semantic-release-hackage --dev
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."
}
]
]
}
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 |
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
.
MIT, see the LICENSE file.
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.