IntersectMBO / cardano-cli

This repository contains sources for the command-line interface (CLI) tool for interacting with the Cardano blockchain.
Apache License 2.0
39 stars 14 forks source link

CI: create release changelog automatically #733

Closed smelc closed 4 months ago

smelc commented 4 months ago

Changelog

- description: |
    CI: create release changelog automatically
# uncomment types applicable to the change:
  type:
  # - feature        # introduces a new feature
  # - breaking       # the API has changed in a breaking way
  # - compatible     # the API has changed but is non-breaking
  # - optimisation   # measurable performance improvements
  # - improvement    # QoL changes e.g. refactoring
  # - bugfix         # fixes a defect
  # - test           # fixes/modifies tests
  - maintenance    # not directly related to the code
  # - release        # related to a new release preparation
  # - documentation  # change in code docs, haddocks...

Context

We added automatic creation of releases in https://github.com/IntersectMBO/cardano-cli/pull/730. https://github.com/IntersectMBO/cardano-cli/pull/730, however, does not create the changelog, it uses placeholder text put by https://github.com/softprops/action-gh-release.

This improves on https://github.com/IntersectMBO/cardano-cli/pull/730 by populating the release changelog. See https://github.com/IntersectMBO/cardano-cli/releases/tag/untagged-6a3ce8a442ee33faf470 for an example of a release created by the pipeline of this PR.

This PR works by extracting the changelog from https://github.com/IntersectMBO/cardano-cli/blob/main/cardano-cli/CHANGELOG.md.

How to trust this PR

Run the script extracting the changelog locally, and witness it outputs the correct subset of the changelog. E.g. try:

./scripts/ci/extract-changelog.sh 8.22.0.0

or

./scripts/ci/extract-changelog.sh 8.21.0.0

You can also try a failing call and witness that $? is non-zero:

./scripts/ci/extract-changelog.sh foobar

Try the pipeline on a unreleased tag, for example 8.20.3.0:

gh workflow run "Release Upload" -r $(git branch --show-current) -f target_tag=cardano-cli-8.20.3.0

and look at the draft release that gets added here: https://github.com/IntersectMBO/cardano-cli/releases

Checklist