Skip to content

Prepare Release documentation #2

Prepare Release documentation

Prepare Release documentation #2

Workflow file for this run

name: Release IRS
on:
workflow_dispatch:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Calculate Helm release version from CHANGELOG
run: echo HELM_VERSION=$(cat charts/irs-helm/CHANGELOG.md | sed -n 's/.*\[\([0-9]\+\.[0-9]\+\.[0-9]\+\)\].*/\1/p' | head -n 1) >> $GITHUB_ENV
- name: Update Chart.yaml appVersion
uses: mikefarah/yq@v4.33.3
with:
cmd: yq -i eval '.appVersion = "${{ github.ref_name }}"' charts/irs-helm/Chart.yaml
- name: Update Chart.yaml version
uses: mikefarah/yq@v4.33.3
with:
cmd: yq -i eval '.version = "${{ env.HELM_VERSION }}"' charts/irs-helm/Chart.yaml
- name: Prepare Helm release
uses: peter-evans/create-pull-request@v5
with:
commit-message: "chore(release): Prepare release for Helm version ${{ env.HELM_VERSION }}"
branch: chore/prepare-helm-release-${{ env.HELM_VERSION }}
base: main
delete-branch: true
title: Prepare Helm release for next version
body: |
This PR prepares the Helm chart release for version ${{ env.HELM_VERSION }}.
Please check whether the Chart was updated correctly and that the CHANGELOG contains the relevant information
for this release. Also, make sure that the values.yaml is correct before merging this PR.
- name: Get previous version
run: echo PREVIOUS_VERSION=$(git tag | grep -E ^[0-9]+\\.[0-9]+\\.[0-9]+ | tail -2 | head -n +1) >> $GITHUB_ENV
- name: Extract changelog text
# See: https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#multiline-strings
run: |
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
echo "CHANGELOG<<$EOF" >> $GITHUB_ENV
sed -n -e '/## \[${{ github.ref_name }}\]/,/## \[/ p' CHANGELOG.md | head -n -1 | tail -n +2 >> $GITHUB_ENV
echo **Full Changelog**: ${{ github.server_url }}/${{ github.repository }}/compare/${{ env.PREVIOUS_VERSION }}...${{ github.ref_name }} >> $GITHUB_ENV
echo "$EOF" >> "$GITHUB_ENV"
- name: Create IRS release
uses: softprops/action-gh-release@v1
with:
body: ${{ env.CHANGELOG }}
trigger-jira:
needs:
- release
uses: ./.github/workflows/jira-publish-release.yaml
with:
version: ${{ github.ref_name }}
secrets: inherit