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:
@@ -3,8 +3,7 @@ name: Build and Push Docker Image
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main # Changez cela si votre branche principale a un autre nom
|
- main # Changez cela si votre branche principale a un autre nom
|
||||||
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
@@ -15,7 +14,13 @@ jobs:
|
|||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: ~/.npm
|
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
|
- name: Build and push image
|
||||||
uses: https://gargoton.petite-maison-orange.fr/pmo-actions/build-push-image@main
|
uses: https://gargoton.petite-maison-orange.fr/pmo-actions/build-push-image@main
|
||||||
with:
|
with:
|
||||||
@@ -24,6 +29,3 @@ jobs:
|
|||||||
no_cache: true
|
no_cache: true
|
||||||
version_file: version.txt
|
version_file: version.txt
|
||||||
check_uuid: 82a30d23-b3bd-4199-9237-776965831d20
|
check_uuid: 82a30d23-b3bd-4199-9237-776965831d20
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
2
Cargo.lock
generated
2
Cargo.lock
generated
@@ -4,7 +4,7 @@ version = 4
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "PMOMusic"
|
name = "PMOMusic"
|
||||||
version = "0.1.0"
|
version = "0.3.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"axum 0.8.7",
|
"axum 0.8.7",
|
||||||
"console-subscriber",
|
"console-subscriber",
|
||||||
|
|||||||
37
Makefile
37
Makefile
@@ -13,6 +13,7 @@ BINARY_NAME = PMOMusic
|
|||||||
# Couleurs pour l'affichage
|
# Couleurs pour l'affichage
|
||||||
GREEN = \033[0;32m
|
GREEN = \033[0;32m
|
||||||
YELLOW = \033[1;33m
|
YELLOW = \033[1;33m
|
||||||
|
BLUE = \033[1;34m
|
||||||
RED = \033[0;31m
|
RED = \033[0;31m
|
||||||
NC = \033[0m # No Color
|
NC = \033[0m # No Color
|
||||||
|
|
||||||
@@ -193,6 +194,21 @@ update:
|
|||||||
cd $(WEBAPP_DIR) && $(NPM) update
|
cd $(WEBAPP_DIR) && $(NPM) update
|
||||||
@echo "$(GREEN)✓ Dépendances mises à jour$(NC)"
|
@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: Exécute les benchmarks
|
||||||
bench:
|
bench:
|
||||||
@echo "$(YELLOW)→ Exécution des benchmarks...$(NC)"
|
@echo "$(YELLOW)→ Exécution des benchmarks...$(NC)"
|
||||||
@@ -203,4 +219,23 @@ coverage:
|
|||||||
@echo "$(YELLOW)→ Génération du rapport de couverture...$(NC)"
|
@echo "$(YELLOW)→ Génération du rapport de couverture...$(NC)"
|
||||||
$(CARGO) tarpaulin --out Html --output-dir target/coverage
|
$(CARGO) tarpaulin --out Html --output-dir target/coverage
|
||||||
@echo "$(GREEN)✓ Rapport disponible dans target/coverage/index.html$(NC)"
|
@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)"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "PMOMusic"
|
name = "PMOMusic"
|
||||||
version = "0.1.0"
|
version = "0.3.1"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
0.3.0
|
|
||||||
Reference in New Issue
Block a user