diff --git a/Makefile b/Makefile index 2683c542..fa9d4ecf 100644 --- a/Makefile +++ b/Makefile @@ -48,5 +48,77 @@ docker-build: docker-run: docker run -d -p 5000:5000 --name yavsc yavsc +# Crée une branche release/ depuis main, met à jour les +# `` des .csproj via dotnet-gitversion, et la +# pousse sur origin. +# +# Usage : make release V=1.0.7-rc1 +# +# Pré-requis : être sur main, working tree clean. La cible +# vérifie les deux et refuse sinon — elle ne fait JAMAIS +# de checkout automatique, c'est à l'opérateur de s'être +# positionné sur la bonne branche au préalable (sinon le +# bump pourrait partir sur une branche tierce par accident). +# +# Notes : +# - Le nom de branche vient de l'argument V (ex: 1.0.7-rc1 +# donne release/1.0.7-rc1). C'est une étiquette d'intention, +# pas la version assembly. +# - La version dans les .csproj vient de GitVersion qui la +# calcule depuis l'historique git (tag le plus proche + +# nombre de commits). C'est la version assembly réelle. +# - L'ordre (fetch → branche → bump → push) garantit qu'on +# part d'un main synchro et qu'on ne pollue pas main avec +# le bump (qui vit sur la branche release). +# - Fail-fast si la branche existe déjà en local ou sur origin. +release: + @if [ -z "$(V)" ]; then \ + echo "Usage: make release V="; \ + echo " V : version semver (ex. 1.0.7-rc1) — sert à nommer la branche."; \ + exit 1; \ + fi + @CURRENT=$$(git branch --show-current); \ + if [ "$$CURRENT" != "main" ]; then \ + echo "Refus : la cible doit être lancée depuis main."; \ + echo " Branche courante : $$CURRENT"; \ + echo " Fais : git checkout main && git pull --ff-only origin main"; \ + exit 1; \ + fi + @if [ -n "$$(git status --porcelain)" ]; then \ + echo "Working tree sale, refus de créer une branche release."; \ + git status --short; \ + exit 1; \ + fi + @BRANCH="release/$(V)"; \ + if git show-ref --verify --quiet "refs/heads/$$BRANCH"; then \ + echo "La branche $$BRANCH existe déjà en local."; \ + echo " Pour la supprimer : git branch -D $$BRANCH"; \ + exit 1; \ + fi; \ + if git ls-remote --exit-code --heads origin "$$BRANCH" >/dev/null 2>&1; then \ + echo "La branche $$BRANCH existe déjà sur origin."; \ + exit 1; \ + fi; \ + echo "==> Fetch + vérification synchro main"; \ + git fetch origin main; \ + if ! git merge-base --is-ancestor origin/main HEAD; then \ + echo "main a avancé plus loin que HEAD. Fais :"; \ + echo " git pull --ff-only origin main"; \ + exit 1; \ + fi; \ + echo "==> Création de $$BRANCH depuis main"; \ + git checkout -b "$$BRANCH"; \ + echo "==> dotnet-gitversion /updateprojectfiles"; \ + dotnet-gitversion /updateprojectfiles; \ + echo "==> Commit du bump"; \ + git add .; \ + if git diff --cached --quiet; then \ + echo "Pas de changements à committer (gitversion n'a produit aucune diff)."; \ + else \ + git commit -m "chore(release): bump version via gitversion for $(V)"; \ + fi; \ + echo "==> Push de $$BRANCH sur origin"; \ + git push -u origin "$$BRANCH"; \ + echo "==> Terminé. Branche $$BRANCH live sur origin." -.PHONY: test +.PHONY: test release diff --git a/src/PostIt.Tests/PostIt.Tests.csproj b/src/PostIt.Tests/PostIt.Tests.csproj index 3d35d827..54c40e8c 100644 --- a/src/PostIt.Tests/PostIt.Tests.csproj +++ b/src/PostIt.Tests/PostIt.Tests.csproj @@ -6,10 +6,10 @@ false PostIt.Tests true - 1.0.1.0 - 1.0.1.0 - 1.0.1-5+Branch.main.Sha.0617fc6bda7151c70559d87177e2dcfb1b60995f - 1.0.1-5 + 1.1.0.0 + 1.1.0.0 + 1.1.0-beta.1+2.Branch.release-1.0.7-rc1.Sha.6e50967702ba9d310017c86a2d7ee636a9e94ada + 1.1.0-beta.1 diff --git a/src/PostIt/PostIt.Android/PostIt.Android.csproj b/src/PostIt/PostIt.Android/PostIt.Android.csproj index 3820bf49..de4e3801 100644 --- a/src/PostIt/PostIt.Android/PostIt.Android.csproj +++ b/src/PostIt/PostIt.Android/PostIt.Android.csproj @@ -12,10 +12,10 @@ apk false android-arm;android-arm64;android-x86;android-x64 - 1.0.1.0 - 1.0.1.0 - 1.0.1-5+Branch.main.Sha.0617fc6bda7151c70559d87177e2dcfb1b60995f - 1.0.1-5 + 1.1.0.0 + 1.1.0.0 + 1.1.0-beta.1+2.Branch.release-1.0.7-rc1.Sha.6e50967702ba9d310017c86a2d7ee636a9e94ada + 1.1.0-beta.1 diff --git a/src/PostIt/PostIt.Browser/PostIt.Browser.csproj b/src/PostIt/PostIt.Browser/PostIt.Browser.csproj index a339b9f0..7a0a9ba3 100644 --- a/src/PostIt/PostIt.Browser/PostIt.Browser.csproj +++ b/src/PostIt/PostIt.Browser/PostIt.Browser.csproj @@ -4,10 +4,10 @@ Exe true enable - 1.0.1.0 - 1.0.1.0 - 1.0.1-5+Branch.main.Sha.0617fc6bda7151c70559d87177e2dcfb1b60995f - 1.0.1-5 + 1.1.0.0 + 1.1.0.0 + 1.1.0-beta.1+2.Branch.release-1.0.7-rc1.Sha.6e50967702ba9d310017c86a2d7ee636a9e94ada + 1.1.0-beta.1 diff --git a/src/PostIt/PostIt.Desktop/PostIt.Desktop.csproj b/src/PostIt/PostIt.Desktop/PostIt.Desktop.csproj index c543c550..6ab6fdac 100644 --- a/src/PostIt/PostIt.Desktop/PostIt.Desktop.csproj +++ b/src/PostIt/PostIt.Desktop/PostIt.Desktop.csproj @@ -5,10 +5,10 @@ See https://docs.avaloniaui.net/docs/guides/platforms/platform-specific-code/dotnet for more details.--> net10.0 enable - 1.0.1.0 - 1.0.1.0 - 1.0.1-5+Branch.main.Sha.0617fc6bda7151c70559d87177e2dcfb1b60995f - 1.0.1-5 + 1.1.0.0 + 1.1.0.0 + 1.1.0-beta.1+2.Branch.release-1.0.7-rc1.Sha.6e50967702ba9d310017c86a2d7ee636a9e94ada + 1.1.0-beta.1 app.manifest diff --git a/src/PostIt/PostIt/PostIt.csproj b/src/PostIt/PostIt/PostIt.csproj index d9cf96d3..c1e3c3fa 100644 --- a/src/PostIt/PostIt/PostIt.csproj +++ b/src/PostIt/PostIt/PostIt.csproj @@ -4,10 +4,10 @@ enable latest true - 1.0.1.0 - 1.0.1.0 - 1.0.1-5+Branch.main.Sha.0617fc6bda7151c70559d87177e2dcfb1b60995f - 1.0.1-5 + 1.1.0.0 + 1.1.0.0 + 1.1.0-beta.1+2.Branch.release-1.0.7-rc1.Sha.6e50967702ba9d310017c86a2d7ee636a9e94ada + 1.1.0-beta.1 diff --git a/src/Yavsc.Abstract/Yavsc.Abstract.csproj b/src/Yavsc.Abstract/Yavsc.Abstract.csproj index 06174cf8..2b6d261a 100644 --- a/src/Yavsc.Abstract/Yavsc.Abstract.csproj +++ b/src/Yavsc.Abstract/Yavsc.Abstract.csproj @@ -9,10 +9,10 @@ true true latest - 1.0.1.0 - 1.0.1.0 - 1.0.1-5+Branch.main.Sha.0617fc6bda7151c70559d87177e2dcfb1b60995f - 1.0.1-5 + 1.1.0.0 + 1.1.0.0 + 1.1.0-beta.1+2.Branch.release-1.0.7-rc1.Sha.6e50967702ba9d310017c86a2d7ee636a9e94ada + 1.1.0-beta.1 diff --git a/src/Yavsc.Api/Yavsc.Api.csproj b/src/Yavsc.Api/Yavsc.Api.csproj index d6cceba5..63019232 100644 --- a/src/Yavsc.Api/Yavsc.Api.csproj +++ b/src/Yavsc.Api/Yavsc.Api.csproj @@ -5,10 +5,10 @@ 1c73094f-959f-4211-b1a1-6a69b236c283 Yavsc.Api true - 1.0.1.0 - 1.0.1.0 - 1.0.1-5+Branch.main.Sha.0617fc6bda7151c70559d87177e2dcfb1b60995f - 1.0.1-5 + 1.1.0.0 + 1.1.0.0 + 1.1.0-beta.1+2.Branch.release-1.0.7-rc1.Sha.6e50967702ba9d310017c86a2d7ee636a9e94ada + 1.1.0-beta.1 diff --git a/src/Yavsc.Blogs.Tests/Yavsc.Blogs.Tests.csproj b/src/Yavsc.Blogs.Tests/Yavsc.Blogs.Tests.csproj index ec1f7f0a..393a520c 100644 --- a/src/Yavsc.Blogs.Tests/Yavsc.Blogs.Tests.csproj +++ b/src/Yavsc.Blogs.Tests/Yavsc.Blogs.Tests.csproj @@ -7,10 +7,10 @@ Yavsc.Blogs.Tests b1a9d0d6-3f5e-4a07-9f0a-7e4d5b6c1a82 true - 1.0.1.0 - 1.0.1.0 - 1.0.1-5+Branch.main.Sha.0617fc6bda7151c70559d87177e2dcfb1b60995f - 1.0.1-5 + 1.1.0.0 + 1.1.0.0 + 1.1.0-beta.1+2.Branch.release-1.0.7-rc1.Sha.6e50967702ba9d310017c86a2d7ee636a9e94ada + 1.1.0-beta.1 diff --git a/src/Yavsc.Blogs/Yavsc.Blogs.csproj b/src/Yavsc.Blogs/Yavsc.Blogs.csproj index 3c4bdc68..a7f4bea9 100644 --- a/src/Yavsc.Blogs/Yavsc.Blogs.csproj +++ b/src/Yavsc.Blogs/Yavsc.Blogs.csproj @@ -6,10 +6,10 @@ Yavsc.Blogs https://github.com/pazof/yavsc true - 1.0.1.0 - 1.0.1.0 - 1.0.1-5+Branch.main.Sha.0617fc6bda7151c70559d87177e2dcfb1b60995f - 1.0.1-5 + 1.1.0.0 + 1.1.0.0 + 1.1.0-beta.1+2.Branch.release-1.0.7-rc1.Sha.6e50967702ba9d310017c86a2d7ee636a9e94ada + 1.1.0-beta.1 diff --git a/src/Yavsc.Org.Tests/Yavsc.Org.Tests.csproj b/src/Yavsc.Org.Tests/Yavsc.Org.Tests.csproj index 79a6bae1..8943e869 100644 --- a/src/Yavsc.Org.Tests/Yavsc.Org.Tests.csproj +++ b/src/Yavsc.Org.Tests/Yavsc.Org.Tests.csproj @@ -9,10 +9,10 @@ true exe $(MSBuildProjectDirectory)\test.runsettings - 1.0.1.0 - 1.0.1.0 - 1.0.1-5+Branch.main.Sha.0617fc6bda7151c70559d87177e2dcfb1b60995f - 1.0.1-5 + 1.1.0.0 + 1.1.0.0 + 1.1.0-beta.1+2.Branch.release-1.0.7-rc1.Sha.6e50967702ba9d310017c86a2d7ee636a9e94ada + 1.1.0-beta.1 diff --git a/src/Yavsc.Org/Yavsc.Org.csproj b/src/Yavsc.Org/Yavsc.Org.csproj index adb21103..80caabbb 100644 --- a/src/Yavsc.Org/Yavsc.Org.csproj +++ b/src/Yavsc.Org/Yavsc.Org.csproj @@ -7,10 +7,10 @@ Yavsc true https://github.com/pazof/yavsc - 1.0.1.0 - 1.0.1.0 - 1.0.1-5+Branch.main.Sha.0617fc6bda7151c70559d87177e2dcfb1b60995f - 1.0.1-5 + 1.1.0.0 + 1.1.0.0 + 1.1.0-beta.1+2.Branch.release-1.0.7-rc1.Sha.6e50967702ba9d310017c86a2d7ee636a9e94ada + 1.1.0-beta.1 diff --git a/src/Yavsc.Server/Yavsc.Server.csproj b/src/Yavsc.Server/Yavsc.Server.csproj index c12210a6..d8f0a683 100644 --- a/src/Yavsc.Server/Yavsc.Server.csproj +++ b/src/Yavsc.Server/Yavsc.Server.csproj @@ -7,10 +7,10 @@ true https://github.com/pazof/yavsc true - 1.0.1.0 - 1.0.1.0 - 1.0.1-5+Branch.main.Sha.0617fc6bda7151c70559d87177e2dcfb1b60995f - 1.0.1-5 + 1.1.0.0 + 1.1.0.0 + 1.1.0-beta.1+2.Branch.release-1.0.7-rc1.Sha.6e50967702ba9d310017c86a2d7ee636a9e94ada + 1.1.0-beta.1 diff --git a/src/Yavsc.Tests.Shared/Yavsc.Tests.Shared.csproj b/src/Yavsc.Tests.Shared/Yavsc.Tests.Shared.csproj index b8fa9e64..81404c20 100644 --- a/src/Yavsc.Tests.Shared/Yavsc.Tests.Shared.csproj +++ b/src/Yavsc.Tests.Shared/Yavsc.Tests.Shared.csproj @@ -12,6 +12,10 @@ TestSdk. The consumer projects own the test execution and inherit from the shared base classes. --> + 1.1.0.0 + 1.1.0.0 + 1.1.0-beta.1+2.Branch.release-1.0.7-rc1.Sha.6e50967702ba9d310017c86a2d7ee636a9e94ada + 1.1.0-beta.1 diff --git a/src/cli/cli.csproj b/src/cli/cli.csproj index fe627d9d..305ec0af 100644 --- a/src/cli/cli.csproj +++ b/src/cli/cli.csproj @@ -5,10 +5,10 @@ enable Yavsc.cli true - 1.0.1.0 - 1.0.1.0 - 1.0.1-5+Branch.main.Sha.0617fc6bda7151c70559d87177e2dcfb1b60995f - 1.0.1-5 + 1.1.0.0 + 1.1.0.0 + 1.1.0-beta.1+2.Branch.release-1.0.7-rc1.Sha.6e50967702ba9d310017c86a2d7ee636a9e94ada + 1.1.0-beta.1