Skip to content

Commit 7976f71

Browse files
committed
fix release
1 parent a351dfe commit 7976f71

File tree

1 file changed

+4
-17
lines changed

1 file changed

+4
-17
lines changed

.github/workflows/release.yml

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,12 @@ name: Release
22

33
on:
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

1510
env:
16-
# Configuration du versionnement sémantique
1711
MAJOR_LABELS: "breaking"
1812
MINOR_LABELS: "enhancement,feat"
1913
PATCH_LABELS: "bugfix,fix"
@@ -24,7 +18,6 @@ jobs:
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"
@@ -39,7 +32,7 @@ jobs:
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
@@ -49,7 +42,6 @@ jobs:
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))

0 commit comments

Comments
 (0)