Skip to content

Release Charts

Release Charts #24

Workflow file for this run

name: Release Charts
on:
workflow_dispatch:
inputs:
version:
description: "Temporal version to use for release (for example 1.22.4)"
required: true
bump:
description: "Chart version bump level"
required: true
type: choice
default: minor
options:
- minor
- patch
jobs:
release:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Generate token
id: generate_token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.TEMPORAL_CICD_APP_ID }}
private-key: ${{ secrets.TEMPORAL_CICD_PRIVATE_KEY }}
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: true
token: ${{ steps.generate_token.outputs.token }}
fetch-depth: 0
fetch-tags: true
- name: Configure Git
run: |
git config --local user.name 'Temporal Data'
git config --local user.email '[email protected]'
- name: Update Temporal chart version
working-directory: charts/temporal
run: |
RE='([0-9]+)\.([0-9]+)\.([0-9]+)'
current="$(grep -m 1 '^version:' Chart.yaml | awk '{print $2}')"
MAJOR=`echo $current | sed -E "s#$RE#\1#"`
MINOR=`echo $current | sed -E "s#$RE#\2#"`
PATCH=`echo $current | sed -E "s#$RE#\3#"`
if [ "${{ github.event.inputs.bump }}" == "minor" ]; then
MINOR=$((MINOR+1))
PATCH=0
else
PATCH=$((PATCH+1))
fi
NEW_VERSION="$MAJOR.$MINOR.$PATCH"
sed -i -e "s/^version: .*/version: $NEW_VERSION/" Chart.yaml
sed -i -e "s/^appVersion: .*/appVersion: ${{ github.event.inputs.version }}/" Chart.yaml
git commit -m "Update Chart to $NEW_VERSION, Temporal v${{ github.event.inputs.version }}" Chart.yaml
git tag -a "temporal-${NEW_VERSION}" -m "Release Chart: $NEW_VERSION. Temporal ${{ github.event.inputs.version }}"
git push --tags origin master
- name: Install Helm
uses: azure/setup-helm@v3
- name: Run chart-releaser
uses: helm/[email protected]
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"