ajout du changement de version
This commit is contained in:
@@ -6,10 +6,50 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
if: github.actor != 'github-actions[bot]'
|
||||||
runs-on: self-hosted
|
runs-on: self-hosted
|
||||||
container:
|
container:
|
||||||
image: alpine:latest
|
image: alpine:latest
|
||||||
steps:
|
steps:
|
||||||
|
- name: Increment version
|
||||||
|
id: increment_version
|
||||||
|
run: |
|
||||||
|
# Lire le fichier VERSION
|
||||||
|
version=$(cat VERSION)
|
||||||
|
echo "Current version: $version"
|
||||||
|
|
||||||
|
# Extraire les parties majeure, mineure et patch
|
||||||
|
IFS='.' read -r -a parts <<< "$version"
|
||||||
|
major=${parts[0]}
|
||||||
|
minor=${parts[1]}
|
||||||
|
patch=${parts[2]}
|
||||||
|
|
||||||
|
# Incrémenter la version patch
|
||||||
|
patch=$((patch + 1))
|
||||||
|
|
||||||
|
# Créer la nouvelle version
|
||||||
|
new_version="$major.$minor.$patch"
|
||||||
|
echo "New version: $new_version"
|
||||||
|
|
||||||
|
# Écrire la nouvelle version dans le fichier VERSION
|
||||||
|
echo $new_version > VERSION
|
||||||
|
|
||||||
|
# Exporter la nouvelle version comme variable de sortie
|
||||||
|
echo "::set-output name=new_version::$new_version"
|
||||||
|
|
||||||
|
- name: Commit and push new version
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
run: |
|
||||||
|
git config --global user.name "github-actions[bot]"
|
||||||
|
git config --global user.email "bot@resk-u.ch"
|
||||||
|
|
||||||
|
# Ajouter et commit le fichier VERSION
|
||||||
|
git add VERSION
|
||||||
|
git commit -m "Increment version to ${{ steps.increment_version.outputs.new_version }}"
|
||||||
|
|
||||||
|
# Push les modifications
|
||||||
|
git push origin main
|
||||||
- name: Set up and Install Dependencies
|
- name: Set up and Install Dependencies
|
||||||
run: |
|
run: |
|
||||||
apk update && apk add --no-cache mariadb-connector-c-dev && apk add --no-cache gcc musl-dev nodejs npm git docker libffi-dev libffi
|
apk update && apk add --no-cache mariadb-connector-c-dev && apk add --no-cache gcc musl-dev nodejs npm git docker libffi-dev libffi
|
||||||
|
|||||||
Reference in New Issue
Block a user