feat(release): 10.0.0 #4
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: "[BE][FE] Release" | |
on: | |
workflow_dispatch: | |
push: | |
tags: | |
- '[0-9]+.[0-9]+.[0-9]+' | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Calculate Helm release version from CHANGELOG | |
run: echo HELM_VERSION=$(cat charts/traceability-foss/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/[email protected] | |
with: | |
cmd: yq -i eval '.appVersion = "${{ github.ref_name }}"' charts/traceability-foss/Chart.yaml | |
- name: Update Chart.yaml version | |
uses: mikefarah/[email protected] | |
with: | |
cmd: yq -i eval '.version = "${{ env.HELM_VERSION }}"' charts/traceability-foss/Chart.yaml | |
- name: Update frontend dependency version in Chart.yaml | |
uses: mikefarah/[email protected] | |
with: | |
cmd: yq -i eval '.dependencies[0].version = "${{ env.HELM_VERSION }}"' charts/traceability-foss/Chart.yaml | |
- name: Update backend dependency version in Chart.yaml | |
uses: mikefarah/[email protected] | |
with: | |
cmd: yq -i eval '.dependencies[1].version = "${{ env.HELM_VERSION }}"' charts/traceability-foss/Chart.yaml | |
- name: Update frontend version in frontend/Chart.yaml | |
uses: mikefarah/[email protected] | |
with: | |
cmd: yq -i eval '.version = "${{ env.HELM_VERSION }}"' charts/traceability-foss/charts/frontend/Chart.yaml | |
- name: Update frontend appVersion in frontend/Chart.yaml | |
uses: mikefarah/[email protected] | |
with: | |
cmd: yq -i eval '.appVersion = "${{ github.ref_name }}"' charts/traceability-foss/charts/frontend/Chart.yaml | |
- name: Update backend version in backend/Chart.yaml | |
uses: mikefarah/[email protected] | |
with: | |
cmd: yq -i eval '.version = "${{ env.HELM_VERSION }}"' charts/traceability-foss/charts/backend/Chart.yaml | |
- name: Update backend appVersion in frontend/Chart.yaml | |
uses: mikefarah/[email protected] | |
with: | |
cmd: yq -i eval '.appVersion = "${{ github.ref_name }}"' charts/traceability-foss/charts/backend/Chart.yaml | |
- name: Update the frontend package.json appVersion | |
run: | | |
npm install -g json | |
json -I -f frontend/package.json -e "this.version='${{ github.ref_name }}'" | |
- 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 Trace-X 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 |