release.sh 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #!/bin/bash
  2. # Release Audit Express Self — à lancer dans Git Bash
  3. # Usage: ./scripts/release.sh [version] ex: ./scripts/release.sh 1.1.0
  4. set -e
  5. cd "$(dirname "$0")/.."
  6. VERSION="${1:-}"
  7. if [ -z "$VERSION" ]; then
  8. echo "Usage: ./scripts/release.sh <version>"
  9. echo "Exemple: ./scripts/release.sh 1.1.0"
  10. exit 1
  11. fi
  12. # Format tag
  13. TAG="v${VERSION}"
  14. if [[ "$VERSION" == v* ]]; then
  15. TAG="$VERSION"
  16. fi
  17. echo "=== Release Audit Express Self $TAG ==="
  18. echo ""
  19. # 1. Vérifier état propre
  20. if [ -n "$(git status --porcelain)" ]; then
  21. echo "⚠️ Des modifications non commitées existent."
  22. git status --short
  23. echo ""
  24. read -p "Continuer quand même ? (y/N) " -n 1 -r
  25. echo
  26. if [[ ! $REPLY =~ ^[Yy]$ ]]; then
  27. exit 1
  28. fi
  29. fi
  30. # 2. Composer (si vendor modifié)
  31. if [ -f composer.json ] && [ ! -d vendor ] || [ composer.lock -nt vendor 2>/dev/null ]; then
  32. echo "→ composer install..."
  33. composer install --no-dev --ignore-platform-req=ext-mbstring
  34. fi
  35. # 3. Tag
  36. echo "→ Création du tag $TAG..."
  37. git tag -a "$TAG" -m "Release $TAG"
  38. echo ""
  39. echo "✅ Tag $TAG créé."
  40. echo ""
  41. echo "Prochaines étapes :"
  42. echo " 1. git push origin master"
  43. echo " 2. git push origin $TAG"
  44. echo " 3. Déployer sur le serveur (voir docs/RELEASE.md)"
  45. echo ""