Skip to content

Update the ChangeLog for 4.5.2 #42

Update the ChangeLog for 4.5.2

Update the ChangeLog for 4.5.2 #42

on:
push:
# Sequence of patterns matched against refs/tags
tags:
- '*'
name: Draft Tag Release
jobs:
create_draft_release:
if: startsWith(github.ref, 'refs/tags/') # sanity-check
name: Create Draft Release
permissions:
contents: write # Needed to create draft release
runs-on: ubuntu-latest
steps:
- name: Checkout Repo (to obtain template files)
uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 1
lfs: false
- name: Get Tag Version
id: tag_version
run: |
# Take the github.ref and parse it for just the tag
SOURCE_TAG="${GITHUB_REF#refs/tags/}"
# Verify tag format (three-component version + optional trailing qualifier like "-beta1" or "-rc1")
regex="^([0-9][0-9]*\\.[0-9][0-9]*\\.[0-9][0-9]*)([\-][A-Za-z0-9]+)?$";
if [[ ! "${SOURCE_TAG}" =~ $regex ]]; then
echo "Invalid tag version format: \"${SOURCE_TAG}\""
exit 1
fi
SOURCE_TAG_VERSION="${BASH_REMATCH[1]}"
SOURCE_TAG_QUALIFIER="${BASH_REMATCH[2]:1}"
echo "SOURCE_TAG_VERSION=\"${SOURCE_TAG_VERSION}\""
echo "SOURCE_TAG_QUALIFIER=\"${SOURCE_TAG_QUALIFIER}\""
if [ ! -z "${SOURCE_TAG_QUALIFIER}" ]; then
SOURCE_TAG_IS_PRERELEASE="true"
else
SOURCE_TAG_IS_PRERELEASE="false"
fi
echo "SOURCE_TAG=${SOURCE_TAG}" >> $GITHUB_OUTPUT
echo "SOURCE_TAG_IS_PRERELEASE=${SOURCE_TAG_IS_PRERELEASE}" >> $GITHUB_OUTPUT
- name: Create Draft Release
run: |
ADDITIONAL_GH_OPTIONS=""
if [ "${{ steps.tag_version.outputs.SOURCE_TAG_IS_PRERELEASE }}" = "true" ]; then
ADDITIONAL_GH_OPTIONS="--prerelease"
fi
gh release create "${{ steps.tag_version.outputs.SOURCE_TAG }}" -F ".github/wz/templates/draft_release_body_template.md" -t "${{ steps.tag_version.outputs.SOURCE_TAG }}" --draft ${ADDITIONAL_GH_OPTIONS}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}