Mise à jour de la version et améliorations du workflow

Mise à jour de la version de PMOMusic de 0.1.0 à 0.3.1

- Correction de l'indentation dans le fichier de workflow
- Ajout d'une étape pour extraire la version depuis Cargo.toml
- Ajout d'une cible Makefile pour incrémenter automatiquement le numéro de version patch
- Ajout de cibles Makefile pour gérer les commits avec jj (jeff) : bump-version, jjnew, jjpush, jjfetch
- Suppression du fichier version.txt inutile
This commit is contained in:
2026-01-11 15:53:37 +01:00
parent 7d2cb75e58
commit 646633af6b
5 changed files with 46 additions and 10 deletions

View File

@@ -5,7 +5,6 @@ on:
branches:
- main # Changez cela si votre branche principale a un autre nom
jobs:
build:
runs-on: ubuntu-latest
@@ -16,6 +15,12 @@ jobs:
with:
path: ~/.npm
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

2
Cargo.lock generated
View File

@@ -4,7 +4,7 @@ version = 4
[[package]]
name = "PMOMusic"
version = "0.1.0"
version = "0.3.1"
dependencies = [
"axum 0.8.7",
"console-subscriber",

View File

@@ -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)"
@@ -204,3 +220,22 @@ coverage:
$(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)"

View File

@@ -1,6 +1,6 @@
[package]
name = "PMOMusic"
version = "0.1.0"
version = "0.3.1"
edition = "2024"
[dependencies]

View File

@@ -1 +0,0 @@
0.3.0