Release Charts #18
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: 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 push origin | |
- name: Install Helm | |
uses: azure/setup-helm@v3 | |
- name: Run chart-releaser | |
uses: helm/[email protected] | |
env: | |
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" |