diff --git a/.chglog/CHANGELOG.tpl.md b/.chglog/CHANGELOG.tpl.md index 5683d03..06617b1 100755 --- a/.chglog/CHANGELOG.tpl.md +++ b/.chglog/CHANGELOG.tpl.md @@ -1,3 +1,5 @@ +# Changelog + {{ if .Versions -}} ## [Unreleased] diff --git a/README.md b/README.md index 9f2e4b2..c90310e 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,59 @@ To test and build codebase in development environment, run: dev-test-build ``` +## Making Releases + +1. Checkout `main` branch: + + ```sh + git checkout main + ``` + +2. Ensure that your branch is up to date: + + ```sh + git pull + ``` + +3. Update the `version` information in [package.yaml](./package.yaml) if + required, run `hpack` to reflect the change on the `.cabal` file, and + recompile the project, run tests and generate Haddock documentation: + + ```sh + nix-shell --run "dev-test-build -c" + ``` + +4. Update [CHANGELOG.md](./CHANGELOG.md) file: + + ```sh + git-chglog --next-tag -o CHANGELOG.md + ``` + +5. Commit, tag and push: + + ```sh + git commit -am "chore(release): " + git tag -a -m "Release " + git push --follow-tags origin main + ``` + +6. Create the package, upload to Hackage as a candidate first and check the result: + + ```sh + nix-shell --run "dev-test-build -c" + nix-shell --run "cabal sdist" + nix-shell --run "cabal upload dist-newstyle/sdist/haspara-.tar.gz" + ``` + +7. If the candidate package release works fine, release to Hackage: + + ```sh + nix-shell --run "cabal upload --publish dist-newstyle/sdist/haspara-.tar.gz" + ``` + +8. Make sure that the release is available on [Hackage](https://hackage.haskell.org/package/haspara). +9. Make sure that the release is available on [GitHub](https://github.com/telostat/haspara/releases). + ## License Copyright Telostat Pte Ltd (c) 2021-2024. diff --git a/default.nix b/default.nix index 722a3ff..b32a548 100644 --- a/default.nix +++ b/default.nix @@ -90,6 +90,7 @@ let ## Other build inputs for various development requirements: pkgs.docker-client pkgs.git + pkgs.git-chglog pkgs.nil pkgs.nixpkgs-fmt pkgs.nodePackages.prettier