Skip to content

Commit 11ae529

Browse files
committed
Merge branch 'docs/release-process' into minor
# Conflicts: # Makefile # docs/website/src/content/docs/en/guides/release.md # sync-version-with-tag.sh
2 parents cac3dc3 + 03b724d commit 11ae529

3 files changed

Lines changed: 12 additions & 8 deletions

File tree

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,12 +258,12 @@ all: clean build check ## Run full CI pipeline (clean, build, check)
258258
quick: format build-fast ## Quick development cycle (format + build without tests)
259259
@echo "✨ Quick build completed!"
260260

261-
sync-version: ## Sincroniza VERSION en gradle.properties con el último tag git (vX.Y.Z)
261+
sync-version: ## Sync VERSION in gradle.properties with the latest git tag (vX.Y.Z)
262262
@bash ./sync-version-with-tag.sh
263263

264264
.PHONY: help check-tools setup wrapper build build-fast clean clean-all run dev \
265265
run-java run-kotlin run-spring test test-app test-coverage test-verbose \
266266
format check-format lint-kotlin lint-java lint check docs docs-serve \
267267
docs-web-build docs-web-check docs-web-format docs-web-dev \
268268
deps deps-app deps-analysis deps-update tasks info version ci-build \
269-
ci-test ci-check all quick
269+
ci-test ci-check all quick sync-version

docs/website/src/content/docs/en/guides/release.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ git push origin main
6767
git push origin v0.1.1
6868
```
6969

70-
1) If you created the tag first (what caused the CI failure you saw), sync the code to the tag locally and commit the change
70+
2) If you created the tag first (what caused the CI failure you saw), sync the code to the tag locally and commit the change
7171

7272
```bash
7373
# Ensure tag exists locally (or fetch it)

sync-version-with-tag.sh

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
set -euo pipefail
66

7-
# Get the latest tag matching vX.Y.Z
8-
tag=$(git describe --tags --abbrev=0 | grep -Eo '^v[0-9]+\.[0-9]+\.[0-9]+$' || true)
7+
# Get the globally latest semantic version tag matching vX.Y.Z
8+
tag=$(git tag --sort=-v:refname | grep -Em1 '^v[0-9]+\.[0-9]+\.[0-9]+$' || true)
99
if [[ -z "$tag" ]]; then
1010
echo "ERROR: No tag matching vX.Y.Z was found."
1111
exit 1
@@ -20,9 +20,13 @@ if [[ ! -f $prop_file ]]; then
2020
exit 1
2121
fi
2222

23-
# Replace the VERSION=... line
24-
sed -i.bak -E "s/^VERSION=.*/VERSION=$version/" "$prop_file"
25-
rm -f "$prop_file.bak"
23+
# Update the VERSION= line or append if missing
24+
if grep -q '^VERSION=' "$prop_file"; then
25+
sed -i.bak -E "s/^VERSION=.*/VERSION=$version/" "$prop_file"
26+
rm -f "$prop_file.bak"
27+
else
28+
echo "VERSION=$version" >> "$prop_file"
29+
fi
2630

2731
echo "OK: gradle.properties updated to VERSION=$version"
2832

0 commit comments

Comments
 (0)