Skip to content

Release Proxy Chart

Release Proxy Chart #3

Workflow file for this run

name: Release Proxy Chart
# The version and appVersion are set in charts/temporal-proxy/Chart.yaml via a
# regular PR. Once that PR is merged, run this workflow manually to tag and
# publish whatever version is currently committed. It never mutates the chart.
on:
workflow_dispatch:
inputs:
mark_latest:
description: "Mark this release as the latest"
type: boolean
default: false
jobs:
release:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 0
fetch-tags: true
- name: Configure Git
run: |
git config --local user.name 'Temporal Data'
git config --local user.email 'commander-data@temporal.io'
- name: Read chart version
id: chart-version
working-directory: charts/temporal-proxy
run: |
VERSION="$(grep -m 1 '^version:' Chart.yaml | awk '{print $2}')"
if [ -z "${VERSION}" ]; then
echo "::error::Could not read version from charts/temporal-proxy/Chart.yaml"
exit 1
fi
echo "chart_version=${VERSION}" >> "$GITHUB_OUTPUT"
- name: Tag release
env:
VERSION: ${{ steps.chart-version.outputs.chart_version }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
TAG="temporal-proxy-${VERSION}"
# Fail fast with a clear message if this version is already released,
# rather than dying later with a confusing "tag already exists" error.
if git ls-remote --exit-code --tags origin "refs/tags/${TAG}" >/dev/null 2>&1 \
&& gh release view "${TAG}" >/dev/null 2>&1; then
echo "::error::${TAG} is already released; bump the version in Chart.yaml via PR before releasing."
exit 1
fi
# Idempotent so a re-run after a transient failure reuses the tag.
if git rev-parse -q --verify "refs/tags/${TAG}" >/dev/null; then
echo "Tag ${TAG} already exists; reusing it."
else
git tag -a "${TAG}" -m "Release Chart: ${VERSION}"
fi
git push --atomic origin "refs/tags/${TAG}"
- name: Install Helm
uses: azure/setup-helm@9bc31f4ebc9c6b171d7bfbaa5d006ae7abdb4310 # v5.0.1
with:
version: v4.2.0
# Package only the proxy chart ourselves so chart-releaser releases exactly
# this chart, independent of the temporal chart's release cadence.
- name: Package proxy chart
run: |
mkdir -p .cr-release-packages
helm package charts/temporal-proxy --destination .cr-release-packages
- name: Run chart-releaser
uses: helm/chart-releaser-action@cae68fefc6b5f367a0275617c9f83181ba54714f # v1.7.0
with:
skip_packaging: true
mark_as_latest: "${{ github.event.inputs.mark_latest }}"
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"