1
0
mirror of https://github.com/imgproxy/imgproxy.git synced 2025-12-23 22:11:10 +02:00
Files
imgproxy/.github/workflows/release.yml
2025-05-16 19:59:51 +03:00

63 lines
1.7 KiB
YAML

name: Release
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+*'
jobs:
ci:
uses: ./.github/workflows/ci.yml
secrets: inherit
build:
needs: [ci]
uses: ./.github/workflows/build.yml
permissions:
contents: read
packages: write
secrets: inherit
release:
needs: [build]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Prepare notes
id: 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
# 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.notes.outputs.prerelease) }}
update-helm-chart:
needs: [build]
runs-on: ubuntu-latest
steps:
- name: Repository Dispatch
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.WORKFLOW_DISPATCH_TOKEN }}
repository: imgproxy/imgproxy-helm
event-type: imgproxy-version-updated
client-payload: '{"tag": "${{ github.ref_name }}"}'