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:
|
||||
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
|
||||
|
||||
|
||||
|
||||
2
Cargo.lock
generated
2
Cargo.lock
generated
@@ -4,7 +4,7 @@ version = 4
|
||||
|
||||
[[package]]
|
||||
name = "PMOMusic"
|
||||
version = "0.1.0"
|
||||
version = "0.3.1"
|
||||
dependencies = [
|
||||
"axum 0.8.7",
|
||||
"console-subscriber",
|
||||
|
||||
37
Makefile
37
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)"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "PMOMusic"
|
||||
version = "0.1.0"
|
||||
version = "0.3.1"
|
||||
edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
0.3.0
|
||||
Reference in New Issue
Block a user