@@ -2,18 +2,12 @@ name: Release
22
33on :
44 push :
5- branches :
6- - trunk
7- tags :
8- - ' v*'
5+ branches : [trunk]
6+ tags : ['v*']
97 pull_request :
10- branches :
11- - trunk
12- branches-ignore :
13- - main
8+ branches : [trunk]
149
1510env :
16- # Configuration du versionnement sémantique
1711 MAJOR_LABELS : " breaking"
1812 MINOR_LABELS : " enhancement,feat"
1913 PATCH_LABELS : " bugfix,fix"
2418 release :
2519 runs-on : ubuntu-latest
2620 env :
27- # Configuration du versionnement sémantique
2821 MAJOR_LABELS : " breaking"
2922 MINOR_LABELS : " enhancement,feat"
3023 PATCH_LABELS : " bugfix,fix"
3932 steps :
4033 - uses : actions/checkout@v3
4134 with :
42- fetch-depth : 0 # Pour récupérer l'historique complet
35+ fetch-depth : 0
4336
4437 - name : Set up Go
4538 uses : actions/setup-go@v4
4942 - name : Get Current Version
5043 id : version
5144 run : |
52- # Si le fichier VERSION existe, on utilise sa version
5345 if [ -f ${{ env.VERSION_FILE }} ]; then
5446 echo "CURRENT_VERSION=$(cat ${{ env.VERSION_FILE }})" >> $GITHUB_OUTPUT
5547 else
@@ -77,15 +69,12 @@ jobs:
7769 TAGS=${{ steps.tags.outputs.TAGS }}
7870 LABELS=${{ steps.labels.outputs.LABELS }}
7971
80- # Si on a des tags, on utilise la dernière version
8172 if [ -n "$TAGS" ]; then
8273 CURRENT_VERSION=$TAGS
8374 fi
8475
85- # Par défaut, on fait une version PATCH
8676 TYPE="patch"
8777
88- # Si on a des labels, on détermine le type de version
8978 if [ -n "$LABELS" ]; then
9079 if echo "$LABELS" | grep -qE "(${{ env.MAJOR_LABELS }})"; then
9180 TYPE="major"
@@ -94,12 +83,10 @@ jobs:
9483 fi
9584 fi
9685
97- # Extraire les numéros de version
9886 MAJOR=$(echo $CURRENT_VERSION | cut -d. -f1)
9987 MINOR=$(echo $CURRENT_VERSION | cut -d. -f2)
10088 PATCH=$(echo $CURRENT_VERSION | cut -d. -f3)
10189
102- # Calculer la nouvelle version
10390 case $TYPE in
10491 major)
10592 MAJOR=$((MAJOR + 1))
@@ -124,12 +111,10 @@ jobs:
124111
125112 - name : Create Release
126113 id : create_release
127- uses : actions/create-release@v1
128- env :
129- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
114+ uses : softprops/action-gh-release@v1
130115 with :
131116 tag_name : v${{ steps.next_version.outputs.NEXT_VERSION }}
132- release_name : Release v${{ steps.next_version.outputs.NEXT_VERSION }}
117+ name : Release v${{ steps.next_version.outputs.NEXT_VERSION }}
133118 body : |
134119 ## Changelog
135120
0 commit comments