Release Charts #28
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 | |
force_version: | |
description: "Force a chart version (ignore Chart bump level)" | |
mark_latest: | |
description: "Mark this release as the latest" | |
type: boolean | |
default: true | |
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]+)' | |
NEW_VERSION="${{ github.event.inputs.force_version }}" | |
if [ -z "${NEW_VERSION}" ]; then | |
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" | |
fi | |
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] | |
with: | |
mark_as_latest: "${{ github.event.inputs.mark_latest }}" | |
env: | |
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" |