Skip to content

Prepare chart release 0.0.7 (#26) #11

Prepare chart release 0.0.7 (#26)

Prepare chart release 0.0.7 (#26) #11

Workflow file for this run

name: Release Charts
on:
workflow_dispatch:
push:
branches:
- main
# Release only if the 'version' field in Chart.yaml was updated
paths:
- charts/**/Chart.yaml
jobs:
release:
if: github.repository == 'splunk/synthetics-helm-charts'
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: Validate Chart.yaml Update
id: check_update_chart
run: |
LATEST_VERSION=$(curl -s https://api.github.com/repos/splunk/synthetics-helm-charts/releases/latest | grep tag_name | cut -d - -f 4 | cut -d \" -f 1)
CURRENT_VERSION=$(cat charts/splunk-synthetics-runner/Chart.yaml | grep -E "^version:" | cut -d " " -f 2)
if [ "$LATEST_VERSION" != "$CURRENT_VERSION" ]; then
echo "New release needed, creating..."
echo "VALID_UPDATE=1" >> $GITHUB_OUTPUT
else
echo "No new release needed"
echo "VALID_UPDATE=0" >> $GITHUB_OUTPUT
fi
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
if: ${{ steps.check_update_chart.outputs.VALID_UPDATE == 1 }}
- name: Install Helm
uses: azure/setup-helm@fe7b79cd5ee1e45176fcad797de68ecaf3ca4814 # v4.2.0
if: ${{ steps.check_update_chart.outputs.VALID_UPDATE == 1 }}
- name: Run chart-releaser
uses: helm/chart-releaser-action@a917fd15b20e8b64b94d9158ad54cd6345335584 # v1.6.0
with:
config: cr.yaml
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
if: ${{ steps.check_update_chart.outputs.VALID_UPDATE == 1 }}