Skip to content

Commit

Permalink
Create new workflow for Platform Chart
Browse files Browse the repository at this point in the history
  • Loading branch information
afalhambra-hivemq committed Mar 23, 2024
1 parent f95837b commit 01f42fe
Showing 1 changed file with 38 additions and 43 deletions.
81 changes: 38 additions & 43 deletions .github/workflows/release-changelog-builder-action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,46 +10,10 @@ env:
PLATFORM_CHART_PATH: charts/hivemq-platform

jobs:
generate-release-notes:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.2
with:
fetch-depth: 0

- name: Fetch latest and previous tags
id: fetch-latest-previous-tags
run: |
set -x
# Fetch latest and previous tag
tags=($(git tag --list "hivemq-platform-[0-9]*.[0-9]*.[0-9]*" | sort -r | head -n 2))
echo "latest_tag=${tags[0]}" >> "$GITHUB_OUTPUT"
echo "previous_tag=${tags[1]}" >> "$GITHUB_OUTPUT"
- name: Generate release notes for the released charts
id: generate-release-notes
uses: mikepenz/[email protected]
with:
ignorePreReleases: true
fromTag: ${{ steps.fetch-latest-previous-tags.outputs.latest_tag }}
path: ${{ env.PLATFORM_CHART_PATH }}
outputFile: RELEASE_NOTES.md
env:
GH_TOKEN: ${{ github.token }}

- name: Stash generated release notes
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: charts-generated-release-notes
path: |
${{ env.PLATFORM_CHART_PATH }}/RELEASE_NOTES.md
release-charts:
permissions:
contents: write # to push chart release and create a release (helm/chart-releaser-action)
runs-on: ubuntu-latest
needs: generate-release-notes
steps:
- name: Checkout Code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
Expand All @@ -62,12 +26,6 @@ jobs:
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: Unstash generated release notes
uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4
with:
name: charts-generated-release-notes
path: ${{ env.PLATFORM_CHART_PATH }}

- name: Set up Helm
uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # v3.5
with:
Expand All @@ -84,4 +42,41 @@ jobs:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
with:
mark_as_latest: false
release-notes-file: RELEASE-NOTES.md

generate-release-notes:
runs-on: ubuntu-latest
needs: release-charts
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.2
with:
fetch-depth: 0

- name: Fetch latest and previous tags
id: fetch-latest-previous-tags
run: |
set -x
# Fetch latest and previous tag
tags=($(git tag --list "hivemq-platform-[0-9]*.[0-9]*.[0-9]*" | sort -r | head -n 2))
echo "latest_tag=${tags[0]}" >> "$GITHUB_OUTPUT"
echo "previous_tag=${tags[1]}" >> "$GITHUB_OUTPUT"
- name: Generate release notes
id: generate-release-notes
uses: mikepenz/[email protected]
with:
ignorePreReleases: true
fromTag: ${{ steps.fetch-latest-previous-tags.outputs.latest_tag }}
path: ${{ env.PLATFORM_CHART_PATH }}
outputFile: RELEASE_NOTES.md
env:
GH_TOKEN: ${{ github.token }}

- name: Update release notes
env:
GH_TOKEN: ${{ github.token }}
run: |
set -x
latest_tag="${{ steps.fetch-latest-previous-tags.outputs.latest_tag }}"
gh release edit ${latest_tag} --notes-file ${{ env.PLATFORM_CHART_PATH }}/RELEASE_NOTES.md

0 comments on commit 01f42fe

Please sign in to comment.