Ajout des actions dockerLogin et versionBumper
This commit is contained in:
commit
77fbd68ff1
2 changed files with 77 additions and 0 deletions
51
versionBumper/action.yaml
Normal file
51
versionBumper/action.yaml
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
name: 'Version Bumper'
|
||||
author: 'HR'
|
||||
description: |
|
||||
Une action permettant de récupérer et de bump la version du ficher .version
|
||||
|
||||
inputs:
|
||||
bumpType:
|
||||
description: "Définie le type de bump de version : MAJOR, MINOR, PATCH"
|
||||
required: false
|
||||
default: 'PATCH'
|
||||
|
||||
|
||||
runs:
|
||||
using: 'composite'
|
||||
steps:
|
||||
- name: git config
|
||||
run: |
|
||||
git config --global user.name "Forgejo Version Bumper"
|
||||
git config --global user.email "bot@forgejo.pixao"
|
||||
|
||||
- name: bump MAJOR version
|
||||
if: (inputs.bumpType == 'MAJOR')
|
||||
run: |
|
||||
VERSION=$(cat .version)
|
||||
# Incrémente la version majeure
|
||||
NEW_VERSION=$(echo $VERSION | awk -F. '{print $1+1".0.0"}')
|
||||
echo $NEW_VERSION > .version
|
||||
git add .version
|
||||
|
||||
- name: bump MINOR version
|
||||
if: (inputs.bumpType == 'MINOR')
|
||||
run: |
|
||||
VERSION=$(cat .version)
|
||||
# Incrémente la version mineure
|
||||
NEW_VERSION=$(echo $VERSION | awk -F. '{print $1"."$2+1".0"}')
|
||||
echo $NEW_VERSION > .version
|
||||
git add .version
|
||||
|
||||
- name: bump PATCH version
|
||||
if: (inputs.bumpType == 'PATCH')
|
||||
run: |
|
||||
VERSION=$(cat .version)
|
||||
# Incrémente la version patch
|
||||
NEW_VERSION=$(echo $VERSION | awk -F. '{print $1"."$2"."$3+1}')
|
||||
echo $NEW_VERSION > .version
|
||||
git add .version
|
||||
|
||||
- name: Commit & push
|
||||
run: |
|
||||
git commit -m "Bump version [skip ci]"
|
||||
git push
|
||||
Loading…
Add table
Add a link
Reference in a new issue