| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- #!/bin/bash
- # Release Audit Express Self — à lancer dans Git Bash
- # Usage: ./scripts/release.sh [version] ex: ./scripts/release.sh 1.1.0
- set -e
- cd "$(dirname "$0")/.."
- VERSION="${1:-}"
- if [ -z "$VERSION" ]; then
- echo "Usage: ./scripts/release.sh <version>"
- echo "Exemple: ./scripts/release.sh 1.1.0"
- exit 1
- fi
- # Format tag
- TAG="v${VERSION}"
- if [[ "$VERSION" == v* ]]; then
- TAG="$VERSION"
- fi
- echo "=== Release Audit Express Self $TAG ==="
- echo ""
- # 1. Vérifier état propre
- if [ -n "$(git status --porcelain)" ]; then
- echo "⚠️ Des modifications non commitées existent."
- git status --short
- echo ""
- read -p "Continuer quand même ? (y/N) " -n 1 -r
- echo
- if [[ ! $REPLY =~ ^[Yy]$ ]]; then
- exit 1
- fi
- fi
- # 2. Composer (si vendor modifié)
- if [ -f composer.json ] && [ ! -d vendor ] || [ composer.lock -nt vendor 2>/dev/null ]; then
- echo "→ composer install..."
- composer install --no-dev --ignore-platform-req=ext-mbstring
- fi
- # 3. Tag
- echo "→ Création du tag $TAG..."
- git tag -a "$TAG" -m "Release $TAG"
- echo ""
- echo "✅ Tag $TAG créé."
- echo ""
- echo "Prochaines étapes :"
- echo " 1. git push origin master"
- echo " 2. git push origin $TAG"
- echo " 3. Déployer sur le serveur (voir docs/RELEASE.md)"
- echo ""
|