Trigger release on new Helm version #1582
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: Trigger release on new Helm version | |
on: | |
schedule: | |
- cron: '0 0 * * *' | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
check_for_new_helm_version: | |
name: Update on new release | |
runs-on: ubuntu-20.04 | |
steps: | |
- | |
run: sudo apt-get install -y jq | |
- | |
uses: actions/checkout@v3 | |
- | |
name: Compare releases | |
id: compare_releases | |
run: | | |
eval $(scripts/checkHelmVersion.sh) | |
echo "triggerNewRelease=${triggerNewRelease}" | tee -a $GITHUB_OUTPUT | |
echo "helmRelease=${helmRelease}" | tee -a $GITHUB_OUTPUT | |
- | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
if: steps.compare_releases.outputs.triggerNewRelease == 'true' | |
with: | |
commit_message: Updated to latest Helm version v${{ steps.compare_releases.outputs.helmRelease }} | |
- | |
name: Create release on new Helm version | |
if: steps.compare_releases.outputs.triggerNewRelease == 'true' | |
uses: "actions/create-release@v1" | |
env: | |
# here we are using the CR_PAT token because the generated GITHUB_TOKEN did not trigger | |
# the publishImage workflow on a new release (https://github.community/t/triggering-a-new-workflow-from-another-workflow/16250) | |
GITHUB_TOKEN: ${{ secrets.CR_PAT }} | |
with: | |
tag_name: "${{ steps.compare_releases.outputs.helmRelease }}-1" | |
release_name: "${{ steps.compare_releases.outputs.helmRelease }}-1" | |
body: | | |
The following versions are bundled with this release: | |
- [Helm](https://www.helm.sh):${{ steps.compare_releases.outputs.helmRelease }} | |
- [Helm-kubeval](https://github.com/instrumenta/helm-kubeval):0.13.0 | |
- [Helm-values](https://github.com/shihyuho/helm-values):1.2.0 | |
The image can be pulled with `$ docker pull ghcr.io/cloudogu/helm:${{ steps.compare_releases.outputs.helmRelease }}-1` | |
draft: false | |
prerelease: false |