2 Commits

Author SHA1 Message Date
Mathis HERRIOT
2450977e61 chore(versioning): bump package versions to 0.1.0 across all modules
Some checks failed
CI/CD Pipeline / Valider backend (push) Failing after 1m12s
CI/CD Pipeline / Valider documentation (push) Successful in 1m41s
CI/CD Pipeline / Valider frontend (push) Successful in 1m43s
CI/CD Pipeline / Déploiement en Production (push) Has been skipped
2026-01-20 12:00:35 +01:00
Mathis HERRIOT
afc18b555a chore(versioning): improve version script with enhanced validation and refactored command handling 2026-01-20 11:57:24 +01:00
5 changed files with 43 additions and 38 deletions

View File

@@ -1,6 +1,6 @@
{ {
"name": "@memegoat/backend", "name": "@memegoat/backend",
"version": "0.0.1", "version": "0.1.0",
"description": "", "description": "",
"author": "", "author": "",
"private": true, "private": true,

View File

@@ -1,6 +1,6 @@
{ {
"name": "@memegoat/documentation", "name": "@memegoat/documentation",
"version": "0.0.1", "version": "0.1.0",
"private": true, "private": true,
"scripts": { "scripts": {
"build": "next build", "build": "next build",

View File

@@ -1,6 +1,6 @@
{ {
"name": "@memegoat/frontend", "name": "@memegoat/frontend",
"version": "0.0.1", "version": "0.1.0",
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "next dev", "dev": "next dev",

View File

@@ -1,6 +1,6 @@
{ {
"name": "@memegoat/source", "name": "@memegoat/source",
"version": "0.0.1", "version": "0.1.0",
"description": "", "description": "",
"scripts": { "scripts": {
"version:get": "cmake -P version.cmake GET", "version:get": "cmake -P version.cmake GET",

View File

@@ -17,10 +17,13 @@ endfunction()
# Fonction pour incrémenter la version SemVer # Fonction pour incrémenter la version SemVer
function(increment_version CURRENT_VERSION TYPE OUT_VAR) function(increment_version CURRENT_VERSION TYPE OUT_VAR)
string(REPLACE "." ";" VERSION_LIST ${CURRENT_VERSION}) if(CURRENT_VERSION MATCHES "^([0-9]+)\\.([0-9]+)\\.([0-9]+)")
list(GET VERSION_LIST 0 MAJOR) set(MAJOR ${CMAKE_MATCH_1})
list(GET VERSION_LIST 1 MINOR) set(MINOR ${CMAKE_MATCH_2})
list(GET VERSION_LIST 2 PATCH) set(PATCH ${CMAKE_MATCH_3})
else()
message(FATAL_ERROR "Format de version invalide: ${CURRENT_VERSION}. Attendu: X.Y.Z")
endif()
if("${TYPE}" STREQUAL "MAJOR") if("${TYPE}" STREQUAL "MAJOR")
math(EXPR MAJOR "${MAJOR} + 1") math(EXPR MAJOR "${MAJOR} + 1")
@@ -70,11 +73,12 @@ function(set_new_version NEW_VERSION)
endif() endif()
endforeach() endforeach()
# Demander à l'utilisateur s'il veut tagger (ou le faire par défaut si spécifié) # Créer le tag git
create_git_tag(${NEW_VERSION}) create_git_tag(${NEW_VERSION})
endfunction() endfunction()
# Logique principale # Logique principale
if(CMAKE_SCRIPT_MODE_FILE STREQUAL CMAKE_CURRENT_LIST_FILE)
set(ARG_OFFSET 0) set(ARG_OFFSET 0)
while(ARG_OFFSET LESS CMAKE_ARGC) while(ARG_OFFSET LESS CMAKE_ARGC)
if("${CMAKE_ARGV${ARG_OFFSET}}" STREQUAL "-P") if("${CMAKE_ARGV${ARG_OFFSET}}" STREQUAL "-P")
@@ -107,3 +111,4 @@ elseif("${COMMAND}" MATCHES "^(PATCH|MINOR|MAJOR)$")
else() else()
message(FATAL_ERROR "Commande inconnue: ${COMMAND}. Utilisez GET, SET, PATCH, MINOR ou MAJOR.") message(FATAL_ERROR "Commande inconnue: ${COMMAND}. Utilisez GET, SET, PATCH, MINOR ou MAJOR.")
endif() endif()
endif()