diff --git a/.gitea/workflows/build-push.yaml b/.gitea/workflows/build-push.yaml index 340fb686..cee2ff8b 100644 --- a/.gitea/workflows/build-push.yaml +++ b/.gitea/workflows/build-push.yaml @@ -3,8 +3,7 @@ name: Build and Push Docker Image on: push: branches: - - main # Changez cela si votre branche principale a un autre nom - + - main # Changez cela si votre branche principale a un autre nom jobs: build: @@ -15,7 +14,13 @@ jobs: uses: actions/cache@v3 with: path: ~/.npm - key: dont-cache-${{ github.run_id }} + key: dont-cache-${{ github.run_id }} + + - name: Extract version from Cargo.toml + run: | + grep '^version = ' PMOMusic/Cargo.toml | head -n 1 | sed 's/version = "\(.*\)"/\1/' > version.txt + echo "Version extracted: $(cat version.txt)" + - name: Build and push image uses: https://gargoton.petite-maison-orange.fr/pmo-actions/build-push-image@main with: @@ -24,6 +29,3 @@ jobs: no_cache: true version_file: version.txt check_uuid: 82a30d23-b3bd-4199-9237-776965831d20 - - - \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index 363d1caf..54552d0d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,7 +4,7 @@ version = 4 [[package]] name = "PMOMusic" -version = "0.1.0" +version = "0.3.1" dependencies = [ "axum 0.8.7", "console-subscriber", diff --git a/Makefile b/Makefile index ef3912cb..d264446c 100644 --- a/Makefile +++ b/Makefile @@ -13,6 +13,7 @@ BINARY_NAME = PMOMusic # Couleurs pour l'affichage GREEN = \033[0;32m YELLOW = \033[1;33m +BLUE = \033[1;34m RED = \033[0;31m NC = \033[0m # No Color @@ -193,6 +194,21 @@ update: cd $(WEBAPP_DIR) && $(NPM) update @echo "$(GREEN)✓ Dépendances mises à jour$(NC)" +## bump-version: Incrémente le numéro de version patch (x.y.z -> x.y.z+1) +bump-version: + @echo "$(YELLOW)→ Incrémentation de la version...$(NC)" + @current=$$(grep '^version = ' PMOMusic/Cargo.toml | head -n 1 | sed 's/version = "\(.*\)"/\1/'); \ + echo " Version actuelle: $$current"; \ + major=$$(echo $$current | cut -d. -f1); \ + minor=$$(echo $$current | cut -d. -f2); \ + patch=$$(echo $$current | cut -d. -f3); \ + new_patch=$$((patch + 1)); \ + new_version="$$major.$$minor.$$new_patch"; \ + echo " Nouvelle version: $$new_version"; \ + sed -i.bak "s/^version = \"$$current\"/version = \"$$new_version\"/" PMOMusic/Cargo.toml && \ + rm PMOMusic/Cargo.toml.bak + @echo "$(GREEN)✓ Version mise à jour dans PMOMusic/Cargo.toml$(NC)" + ## bench: Exécute les benchmarks bench: @echo "$(YELLOW)→ Exécution des benchmarks...$(NC)" @@ -203,4 +219,23 @@ coverage: @echo "$(YELLOW)→ Génération du rapport de couverture...$(NC)" $(CARGO) tarpaulin --out Html --output-dir target/coverage @echo "$(GREEN)✓ Rapport disponible dans target/coverage/index.html$(NC)" - + +jjnew: + @echo "$(YELLOW)→ Création d'un nouveau commit...$(NC)" + @echo "$(BLUE)→ Documentation du commit courrant...$(NC)" + @jj auto-describe + @echo "$(BLUE)→ C'est fait.$(NC)" + @jj new + @echo "$(GREEN)✓ nouveau commit créé$(NC)" + +jjpush: bump-version + @echo "$(YELLOW)→ Push du commit sur le dépôt...$(NC)" + @jj auto-describe + @jj git push --change @ + @echo "$(GREEN)✓ Commit pushé sur le dépôt$(NC)" + +jjfetch: + @echo "$(YELLOW)→ Pull des derniers commits...$(NC)" + @jj git fetch + @jj new main@origin + @echo "$(GREEN)✓ Derniers commits pullés$(NC)" diff --git a/PMOMusic/Cargo.toml b/PMOMusic/Cargo.toml index 2955dd5c..3853aa5c 100644 --- a/PMOMusic/Cargo.toml +++ b/PMOMusic/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "PMOMusic" -version = "0.1.0" +version = "0.3.1" edition = "2024" [dependencies] diff --git a/version.txt b/version.txt deleted file mode 100644 index 0d91a54c..00000000 --- a/version.txt +++ /dev/null @@ -1 +0,0 @@ -0.3.0