Skip to content

Commit

Permalink
Tentative Modif create Release
Browse files Browse the repository at this point in the history
  • Loading branch information
SamuelQuetin committed Jul 30, 2024
1 parent 1ef447e commit 30d6fbd
Showing 1 changed file with 21 additions and 6 deletions.
27 changes: 21 additions & 6 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,28 @@ on:
description: 'Version de la release (semver)'
required: true
default: 'x.x.x'
snapshotVersion:
description: 'Version de la Snapshot (semver)'
required: true
default: 'x.x.x-SNAPSHOT'

jobs:
calculate_versions:
runs-on: ubuntu-latest
outputs:
snapshot_version: ${{ steps.calculate.outputs.version }}
steps:
- name: Calculate versions
id: calculate
run: |
releaseVersion=${{ inputs.releaseVersion }}
# Séparer les parties de la version
major=$(echo "${releaseVersion}" | cut -d. -f1)
minor=$(echo "${releaseVersion}" | cut -d. -f2)
patch=$(echo "${releaseVersion}" | cut -d. -f3)
# Incrémenter la partie patch
patch=$((patch + 1))
# Reconstituer la version snapshot
snapshotVersion="${major}.${minor}.${patch}-SNAPSHOT"
echo "::set-output name=version::${snapshotVersion}"
create-release:
needs: calculate_versions
runs-on: ubuntu-latest

steps:
Expand All @@ -33,7 +48,7 @@ jobs:
- name: 'Verify version is semver formatted (X.X.X)'
env:
NEW_TAG: ${{ github.event.inputs.releaseVersion }}
NEW_TAG_SNAPSHOT: ${{ github.event.inputs.snapshotVersion }}
NEW_TAG_SNAPSHOT: ${{ outputs.snapshot_version }}
run: |
echo $NEW_TAG | grep -E '^[0-9]+\.[0-9]+\.[0-9]+$'
echo $NEW_TAG_SNAPSHOT | grep -E '^[0-9]+\.[0-9]+\.[0-9]+-SNAPSHOT$'
Expand All @@ -46,7 +61,7 @@ jobs:
- name: 'Generate the new version (patch few files + git tag)'
env:
NEW_TAG: ${{ github.event.inputs.releaseVersion }}
NEW_TAG_SNAPSHOT: ${{ github.event.inputs.snapshotVersion }}
NEW_TAG_SNAPSHOT: ${{ outputs.snapshot_version }}
GITHUB_TOKEN: ${{ secrets.TOKEN_GITHUB_FOR_GITHUB_ACTION }}
run: |
# préparation de la release qui va :
Expand Down

0 comments on commit 30d6fbd

Please sign in to comment.