Skip to content

Release script - automatically publish release on github #342

Description

@adangel

Currently, a release is created in draft status, although it should have been automatically published:

request="$(jq -n \
--arg body "$RELEASE_CHANGELOG" \
--arg name "Release $RELEASE_TAG" \
--arg tag_name "$RELEASE_TAG" \
--arg target_commitish "$RELEASE_BRANCH" \
'{
body: $body,
name: $name,
tag_name: $tag_name,
target_commitish: $target_commitish,
draft: false,
prerelease: false
}')"

draft: false, but the release was only a draft. The API didn't change here: https://docs.github.com/en/rest/releases/releases?apiVersion=2022-11-28#create-a-release

For 2.1.0, this was handy, because I closed #341 - which caused github_changelog_generator to generate a changelog for 2.1.0...HEAD - which only contained #341 and not the 2.1.0 changes, see the first entry in CHANGELOG.md:

## [Unreleased](https://github.com/m2e-code-quality/m2e-code-quality/tree/HEAD)
[Full Changelog](https://github.com/m2e-code-quality/m2e-code-quality/compare/2.1.0...HEAD)
**Closed issues:**
- Proper releases instead of just snapshots? [\#341](https://github.com/m2e-code-quality/m2e-code-quality/issues/341)
## [2.1.0](https://github.com/m2e-code-quality/m2e-code-quality/tree/2.1.0) (2023-12-08)

So, two questions/issues:

  1. why was the release not published automatically?
  2. how can we prevent that the wrong changelog entry ends up in the release notes?

For 2., currently we extract the release notes from CHANGELOG.md, and we take the beginning until the second version entry (in that case "Unreleased" but not "2.1.0"):

END_LINE=$(grep -n "^## " CHANGELOG.md|head -2|tail -1|cut -d ":" -f 1)
END_LINE=$((END_LINE - 1))
RELEASE_CHANGELOG="$(head -$END_LINE CHANGELOG.md)"

This needs to be improved.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions