Files
sure/.github/workflows/chart-ci.yml
Juan José Mata d96e551c01 Move versioning from Rails initializer to .sure-version file (#1587)
* Extract version to .sure-version file and add Sentry release tracking

Move the hardcoded version string to a `.sure-version` file at the repo
root so it can be read by both the Rails version initializer and other
tooling. Configure `config.release` in the Sentry initializer to tag
errors with the app version.

https://claude.ai/code/session_01KfUgF42B3exoU2vpErqJyW

* Use .sure-version as single source of truth in Helm CI workflows

Update chart-ci, chart-release, and publish workflows to read the app
version from .sure-version instead of regex-parsing version.rb. The
pre-release bump job now writes directly to .sure-version and stages it
for commit.

https://claude.ai/code/session_01KfUgF42B3exoU2vpErqJyW

* Guard empty .sure-version fallback

* fix: sync Helm chart version with .sure-version

* Moving on to `v0.7.1-alpha.*` with this

* Defensive rescue

* Getting fancy with versions now

---------

Signed-off-by: Juan José Mata <juanjo.mata@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: SureBot <sure-bot@we-promise.com>
Co-authored-by: sure-admin <sure-admin@splashblot.com>
2026-04-29 11:36:04 +02:00

86 lines
2.5 KiB
YAML

name: Chart CI
on:
pull_request:
paths:
- 'charts/**'
- '.sure-version'
- '.github/workflows/chart-ci.yml'
push:
branches:
- main
paths:
- 'charts/**'
- '.sure-version'
- '.github/workflows/chart-ci.yml'
jobs:
version-sync:
name: Verify Helm ↔ Rails version sync
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Check version alignment
shell: bash
run: |
set -euo pipefail
RAILS_VERSION=$(cat .sure-version | tr -d '[:space:]')
if [ -z "$RAILS_VERSION" ]; then
echo "::error::Could not read version from .sure-version"
exit 1
fi
CHART_VERSION=$(sed -n 's/^version: //p' charts/sure/Chart.yaml | head -n 1)
APP_VERSION=$(sed -n 's/^appVersion: "\{0,1\}\([^"]*\)"\{0,1\}/\1/p' charts/sure/Chart.yaml | head -n 1)
echo "App version (.sure-version): $RAILS_VERSION"
echo "Helm chart version (Chart.yaml): $CHART_VERSION"
echo "Helm appVersion (Chart.yaml): $APP_VERSION"
ERRORS=0
if [ "$RAILS_VERSION" != "$CHART_VERSION" ]; then
echo "::error::Chart version ($CHART_VERSION) does not match Rails version ($RAILS_VERSION)"
ERRORS=$((ERRORS + 1))
fi
if [ "$RAILS_VERSION" != "$APP_VERSION" ]; then
echo "::error::Chart appVersion ($APP_VERSION) does not match Rails version ($RAILS_VERSION)"
ERRORS=$((ERRORS + 1))
fi
if [ "$ERRORS" -gt 0 ]; then
echo ""
echo "To fix: ensure version in .sure-version matches"
echo "both 'version' and 'appVersion' in charts/sure/Chart.yaml"
exit 1
fi
echo "All versions are in sync."
helm-checks:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Helm
uses: azure/setup-helm@v4.3.1
- name: Add chart dependencies repositories
run: |
helm repo add cloudnative-pg https://cloudnative-pg.github.io/charts
helm repo add ot-helm https://ot-container-kit.github.io/helm-charts
helm repo update
- name: Build chart dependencies
run: helm dependency build charts/sure
- name: Lint chart
run: helm lint charts/sure
- name: Render templates
run: helm template sure charts/sure --kube-version 1.25.0 >/tmp/sure-chart-rendered.yaml