Bump version #5
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
push: | |
tags: | |
- 'v[0-9]+.[0-9]+.[0-9]+*' | |
jobs: | |
lint-template: | |
uses: ./.github/workflows/lint-template.yml | |
upload-template: | |
permissions: | |
contents: read | |
id-token: write | |
needs: [lint-template] | |
uses: ./.github/workflows/upload-template.yml | |
with: | |
tag: ${{ github.ref_name }} | |
secrets: inherit | |
release: | |
needs: [lint-template, upload-template] | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Prepare notes | |
id: prepare-notes | |
run: | | |
# Extract changelog entries between this and previous version headers | |
escaped_version=$(echo ${GITHUB_REF_NAME#v} | sed -e 's/[]\/$*.^[]/\\&/g') | |
awk "BEGIN{inrelease=0} /## \[${escaped_version}\]/{inrelease=1;next} /## \[[0-9]+\.[0-9]+\.[0-9]+.*\]/{inrelease=0;exit} {if (inrelease) print}" CHANGELOG.md \ | |
> RELEASE_NOTES.txt | |
echo "" >> RELEASE_NOTES.txt | |
echo "[![](assets/launch-stack.svg)](https://console.aws.amazon.com/cloudformation/home#/stacks/new?stackName=imgproxy&templateURL=https://imgproxy-cf.s3.amazonaws.com/sam/${{ github.ref_name }}/template.yml)" >> RELEASE_NOTES.txt | |
# Write prerelease="true" env if tag name has any suffix after vMAJOR.MINOR.PATCH | |
if [[ ${GITHUB_REF_NAME} =~ ^v[0-9]+\.[0-9]+\.[0-9]+.+ ]]; then | |
echo 'prerelease="true"' >> $GITHUB_OUTPUT | |
else | |
echo 'prerelease="false"' >> $GITHUB_OUTPUT | |
fi | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
body_path: RELEASE_NOTES.txt | |
prerelease: ${{ fromJSON(steps.prepare-notes.outputs.prerelease) }} |