Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 49 additions & 11 deletions .github/workflows/hotfix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ on:
jobs:
hotfix:
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'hotfix/')
if: >
github.event.pull_request.merged == true &&
startsWith(github.event.pull_request.head.ref, 'hotfix/')

steps:
- name: 'Checkout code'
Expand All @@ -30,7 +32,9 @@ jobs:
id: semver
run: |
set -e

LATEST_TAG=$(git tag --sort=-v:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | head -n 1)

if [[ -z "$LATEST_TAG" ]]; then
VERSION="0.0.1"
else
Expand All @@ -41,27 +45,61 @@ jobs:
PATCH=$((PATCH + 1))
VERSION="$MAJOR.$MINOR.$PATCH"
fi

TAG="v$VERSION"

if git rev-parse "$TAG" >/dev/null 2>&1; then
echo "skip=true" >> $GITHUB_OUTPUT
else
echo "skip=false" >> $GITHUB_OUTPUT
echo "❌ Le tag $TAG existe déjà"
exit 1
fi

echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "tag=$TAG" >> $GITHUB_OUTPUT

- name: 'Créer le tag et la release si sur main'
if: steps.semver.outputs.skip != 'true' && github.event.pull_request.base.ref == 'main'
- name: 'Vérifier le CHANGELOG'
id: changelog
if: github.event.pull_request.base.ref == 'main'
run: |
echo "Extraction du changelog pour ${{ steps.semver.outputs.tag }}"
if [[ -f CHANGELOG.md ]]; then
sed -n "/^## \[${{ steps.semver.outputs.tag }}\]/,/^## /p" CHANGELOG.md > release_notes.txt
else
echo "${{ steps.semver.outputs.version }}" > release_notes.txt
set -e
VERSION="${{ steps.semver.outputs.version }}"

if [[ ! -f CHANGELOG.md ]]; then
echo "❌ CHANGELOG.md est manquant"
exit 1
fi

SECTION=$(sed -n "/## \[$VERSION\]/,/^## /p" CHANGELOG.md)

if [[ -z "$SECTION" ]]; then
echo "❌ Aucune entrée de changelog pour la version $VERSION"
exit 1
fi

CONTENT=$(echo "$SECTION" | grep -Ev '^(## |\s*$|### )')

if [[ -z "$CONTENT" ]]; then
echo "❌ Le changelog pour la version $VERSION est vide"
exit 1
fi

echo "release_notes<<EOF" >> $GITHUB_OUTPUT
echo "$SECTION" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT

- name: 'Créer le tag'
if: github.event.pull_request.base.ref == 'main'
run: |
git tag "${{ steps.semver.outputs.tag }}"
git push origin "${{ steps.semver.outputs.tag }}"

- name: 'Créer la GitHub Release'
if: github.event.pull_request.base.ref == 'main'
uses: ncipollo/release-action@v1
with:
tag: '${{ steps.semver.outputs.tag }}'
name: '${{ steps.semver.outputs.tag }}'
body: '${{ steps.changelog.outputs.release_notes }}'

- name: 'PR mergée sur dev'
if: github.event.pull_request.base.ref == 'dev'
run: echo "PR mergée sur dev, aucune release ni tag créé."
51 changes: 33 additions & 18 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'Release workflow'
name: 'Release Automatisation'

permissions:
contents: write
Expand Down Expand Up @@ -33,7 +33,6 @@ jobs:
run: |
set -e

# Récupérer le dernier tag vX.Y.Z
LATEST_TAG=$(git tag --sort=-v:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | head -n 1)

if [[ -z "$LATEST_TAG" ]]; then
Expand All @@ -51,7 +50,6 @@ jobs:
TAG="v$VERSION"
echo "Nouvelle release : $TAG"

# Vérifier si le tag existe déjà
if git rev-parse "$TAG" >/dev/null 2>&1; then
echo "❌ Le tag $TAG existe déjà"
exit 1
Expand All @@ -60,30 +58,47 @@ jobs:
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "tag=$TAG" >> $GITHUB_OUTPUT

- name: 'Créer le tag'
run: |
git tag "${{ steps.semver.outputs.tag }}"
git push origin "${{ steps.semver.outputs.tag }}"

- name: 'Extraire le changelog'
id: changelog
- name: 'Vérifier le CHANGELOG'
id: changelog_check
run: |
set -e
VERSION="${{ steps.semver.outputs.version }}"
if [[ -f CHANGELOG.md ]]; then
# Extraire la section du changelog correspondant à cette version
sed -n "/## \[$VERSION\]/,/^## /p" CHANGELOG.md > release_notes.txt
else
echo "Release $VERSION" > release_notes.txt

if [[ ! -f CHANGELOG.md ]]; then
echo "❌ CHANGELOG.md est manquant"
exit 1
fi

# Préparer la sortie pour GitHub Actions
# Extraire la section de la version
SECTION=$(sed -n "/## \[$VERSION\]/,/^## /p" CHANGELOG.md)

if [[ -z "$SECTION" ]]; then
echo "❌ Aucune entrée de changelog pour la version $VERSION"
exit 1
fi

# Vérifier que la section contient du contenu réel
CONTENT=$(echo "$SECTION" | grep -Ev '^(## |\s*$|### )')

if [[ -z "$CONTENT" ]]; then
echo "❌ Le changelog pour la version $VERSION est vide"
exit 1
fi

echo "✅ Changelog valide pour la version $VERSION"

echo "release_notes<<EOF" >> $GITHUB_OUTPUT
cat release_notes.txt >> $GITHUB_OUTPUT
echo "$SECTION" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT

- name: 'Créer le tag'
run: |
git tag "${{ steps.semver.outputs.tag }}"
git push origin "${{ steps.semver.outputs.tag }}"

- name: 'Créer la GitHub Release'
uses: ncipollo/release-action@v1
with:
tag: '${{ steps.semver.outputs.tag }}'
name: '${{ steps.semver.outputs.tag }}'
body: '${{ steps.changelog.outputs.release_notes }}'
body: '${{ steps.changelog_check.outputs.release_notes }}'
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

---

## [0.0.4] - 2026-01-21

### Ajouté

- Documentation
- UML

### Changement

- workflow
- release
- hotfix
- README.md

---

## [0.0.3] - 2026-01-18

### Ajouté
Expand Down
1 change: 1 addition & 0 deletions docs/cahier-des-charges/cahier-des-charges.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Cahier des Charges

## Projet Numérique du Club de Volley de Saint-Barthélemy-d’Anjou

---
Expand Down
Binary file added docs/uml/images/utilisationAutre.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/uml/images/utilisationClub.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/uml/images/utilisationContenus.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/uml/images/utilisationVisiteur.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading