Files
sentinel/scripts/bump-version.sh
Burak Yigit KayaandGitHub 9b9f7c440c fix(release): restore version bumping for releases (#4191)
- Add `preReleaseCommand` to `.craft.yml` so Craft runs the custom
  bump script instead of silently skipping version bumping (the auto-bump
  path introduced with minVersion 2.21.0+ only works for npm/pypi/etc.
  targets, not the `github` target used here)
- Switch `bump-version.sh` to read `CRAFT_OLD_VERSION`/`CRAFT_NEW_VERSION`
  env vars (Craft's preferred interface), falling back to positional args
  so `post-release.sh` continues to work unchanged
- Fix the README `sed` pattern which stopped matching after the README
  was rewritten in Sep 2024 (removed erroneous backslash before `#`,
  and relaxed trailing match to allow zero characters after "Sentry")
- Remove the invalid `calver: true` input from the Craft action call in
  `release.yml` (not a recognised input; calver is configured in
  `.craft.yml` via `versioning.policy`)
2026-02-25 21:25:50 +00:00

14 lines
601 B
Bash
Executable File

#!/usr/bin/env bash
set -eu
# Craft passes versions via env vars (preferred) with positional args as fallback
# for manual invocation (e.g. post-release.sh calls this with positional args).
OLD_VERSION="${CRAFT_OLD_VERSION:-${1:-}}"
NEW_VERSION="${CRAFT_NEW_VERSION:-${2:-}}"
sed -i -e "s/^\(SENTRY\|SNUBA\|RELAY\|SYMBOLICATOR\|TASKBROKER\|VROOM\|UPTIME_CHECKER\)_IMAGE=\([^:]\+\):.\+\$/\1_IMAGE=\2:$NEW_VERSION/" .env
sed -i -e "s/^# Self-Hosted Sentry.*/# Self-Hosted Sentry $NEW_VERSION/" README.md
[ -z "$OLD_VERSION" ] || echo "Previous version: $OLD_VERSION"
echo "New version: $NEW_VERSION"