mirror of
https://github.com/we-promise/sure.git
synced 2026-04-19 03:54:08 +00:00
Bump Helm chart version in pre-release workflow (#792)
* Update chart version in pre-release bump Keep Helm chart version and appVersion aligned with app releases. * Publish Helm chart with releases Package the Helm chart on tag releases, upload it to GitHub Pages, and attach it to the GitHub Release assets. * Move Helm chart release to helm workflow Publish Helm chart packages from the helm-release workflow on tags and keep publish.yml focused on app release assets. * Derive nightly chart version from latest release Use the most recent v* tag as the base for nightly Helm chart versions.
This commit is contained in:
16
.github/workflows/publish.yml
vendored
16
.github/workflows/publish.yml
vendored
@@ -349,12 +349,19 @@ jobs:
|
||||
- name: Bump pre-release version
|
||||
run: |
|
||||
VERSION_FILE="config/initializers/version.rb"
|
||||
CHART_FILE="charts/sure/Chart.yaml"
|
||||
|
||||
# Ensure version file exists
|
||||
if [ ! -f "$VERSION_FILE" ]; then
|
||||
echo "ERROR: Version file not found: $VERSION_FILE"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Ensure chart file exists
|
||||
if [ ! -f "$CHART_FILE" ]; then
|
||||
echo "ERROR: Chart file not found: $CHART_FILE"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Extract current version
|
||||
CURRENT_VERSION=$(grep -oP '"\K[0-9]+\.[0-9]+\.[0-9]+-(alpha|beta|rc)\.[0-9]+' "$VERSION_FILE")
|
||||
@@ -394,12 +401,21 @@ jobs:
|
||||
echo "Updated version.rb:"
|
||||
grep "semver" "$VERSION_FILE"
|
||||
|
||||
# Update Helm chart version and appVersion
|
||||
sed -i -E "s/^version: .*/version: ${NEW_VERSION}/" "$CHART_FILE"
|
||||
sed -i -E "s/^appVersion: .*/appVersion: \"${NEW_VERSION}\"/" "$CHART_FILE"
|
||||
|
||||
# Verify the change
|
||||
echo "Updated Chart.yaml:"
|
||||
grep -E "^(version|appVersion):" "$CHART_FILE"
|
||||
|
||||
- name: Commit and push version bump
|
||||
run: |
|
||||
git config user.name "github-actions[bot]"
|
||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||
|
||||
git add config/initializers/version.rb
|
||||
git add charts/sure/Chart.yaml
|
||||
|
||||
# Check if there are changes to commit
|
||||
if git diff --cached --quiet; then
|
||||
|
||||
Reference in New Issue
Block a user