Skip to content

Commit

Permalink
Use exclude_tags_regex for "PREVIOUS_VERSION"
Browse files Browse the repository at this point in the history
Fixes #17
  • Loading branch information
CasperWA committed Jul 6, 2022
1 parent dc5add9 commit b48b4cd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
12 changes: 1 addition & 11 deletions .github/workflows/cd_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,6 @@ jobs:
git -C ${MAIN_DIR} tag -af -F "${TAG_MSG_FILE}" ${REF}
if [ "${REMOVE_TAG_MSG_FILE}" == "true" ]; then rm -f "${TAG_MSG_FILE}"; fi
if [ $(git -C ${MAIN_DIR} tag -l | grep -E "^v[0-9]+(\.[0-9]+){2}" | wc -l) -eq 1 ]; then
echo "FIRST_RELEASE=true" >> $GITHUB_ENV
else
echo "FIRST_RELEASE=false" >> $GITHUB_ENV
fi
working-directory: ./ci-cd

- name: Build source distribution
Expand All @@ -192,12 +187,7 @@ jobs:
path: main

- name: Get tagged versions
run: |
if [ "${{ env.FIRST_RELEASE }}" == "false" ]; then
echo "PREVIOUS_VERSION=$(git tag -l --sort -version:refname | sed -n 2p)" >> $GITHUB_ENV
else
echo "PREVIOUS_VERSION=" >> $GITHUB_ENV
fi
run: echo "PREVIOUS_VERSION=$(git tag -l --sort -version:refname | grep -v -E "${{ inputs.changelog_exclude_tags_regex }}" | sed -n 2p)" >> $GITHUB_ENV
working-directory: ./main

- name: Create release-specific changelog
Expand Down
3 changes: 3 additions & 0 deletions docs/workflows/cd_release.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ For more information about the specific changelog inputs, see the related [chang
The default value is given here as a help:
`'duplicate,question,invalid,wontfix'`

The `changelog_exclude_tags_regex` is also used to remove tags in a list of tags to consider when evaluating the "previous version".
This is specifically for adding a changelog to the GitHub release body.

## Expectations

This workflow should _only_ be used for releasing a single modern Python package.
Expand Down

0 comments on commit b48b4cd

Please sign in to comment.