Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,30 @@ on:
branches:
- main

concurrency:
group: release
cancel-in-progress: false

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
uses: actions/checkout@v5

- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"

- name: Install Helm
uses: azure/setup-helm@v3
uses: azure/setup-helm@v4

- name: Add Helm repo
run: helm repo add bitnami https://charts.bitnami.com/bitnami

- name: Run chart-releaser
uses: helm/chart-releaser-action@v1.5.0
uses: helm/chart-releaser-action@v1.7.0
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
with:
Expand Down
76 changes: 76 additions & 0 deletions .github/workflows/update-charts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: Update Charts

on:
workflow_dispatch:
inputs:
version:
description: "Hatchet version to build (e.g., v0.72.0)"
required: true
type: string

concurrency:
group: update-charts
cancel-in-progress: false

jobs:
update-charts:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v5

- name: Setup Helm
uses: azure/setup-helm@v4

- name: Update chart values with new release tag
run: |
RAW_TAG="${{ inputs.version }}"
if ! echo "$RAW_TAG" | grep -qE '^v[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9\-\.]+)?$'; then
echo "Invalid release tag format: $RAW_TAG" >&2
exit 1
fi
RELEASE_TAG="$RAW_TAG"
VERSION_NUMBER="${RELEASE_TAG#v}"

echo "Updating charts to use release tag: $RELEASE_TAG (version: $VERSION_NUMBER)"

find . -name "values.yaml" -type f | while read -r file; do
echo "Processing values file: $file"
sed -i "s/tag: \"v[^\"]*\"/tag: \"$RELEASE_TAG\"/" "$file"
sed -i "s/tag: v[^[:space:]]*/tag: $RELEASE_TAG/" "$file"
done

find . -name "Chart.yaml" -type f | while read -r file; do
echo "Processing Chart file: $file"
sed -i "s/^version: .*/version: $VERSION_NUMBER/" "$file"
sed -i '/name: "hatchet-api"/,/version:/ s/version: "[^"]*"/version: "'"$VERSION_NUMBER"'"/' "$file"
sed -i '/name: "hatchet-frontend"/,/version:/ s/version: "[^"]*"/version: "'"$VERSION_NUMBER"'"/' "$file"
done

find . -name "Chart.lock" -type f | while read -r file; do
echo "Removing Chart.lock file: $file"
rm "$file"
done

find . -name "Chart.yaml" -type f | while read -r file; do
chart_dir=$(dirname "$file")
if grep -q "dependencies:" "$file"; then
echo "Running helm dependency update in: $chart_dir"
(cd "$chart_dir" && helm dependency update)
fi
done

echo "Chart version updates and dependency updates complete."

- name: Commit and push changes
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"

if git diff --quiet; then
echo "No changes to commit"
else
git add .
git commit -m "Update charts to use $RELEASE_TAG"
git push
fi