Ajout des actions dockerLogin et versionBumper
This commit is contained in:
commit
77fbd68ff1
2 changed files with 77 additions and 0 deletions
26
dockerLogin/action.yaml
Normal file
26
dockerLogin/action.yaml
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
name: 'Docker login to registry'
|
||||
author: 'HR'
|
||||
description: |
|
||||
Une action permettant de se connecter au registry de pixao en utilisant les secrets de forgejo
|
||||
|
||||
inputs:
|
||||
REGISTRY_URL:
|
||||
description: "Address du registry (identique à l'URL forgejo car on utilise le registry intégré à ce dernier)"
|
||||
default: '192.168.20.225'
|
||||
REGISTRY_USER:
|
||||
description: "Utilisateur pour se connecter au registry"
|
||||
required: true
|
||||
REGISTRY_PASSWORD:
|
||||
description: "Password de l'utilisateur"
|
||||
required: true
|
||||
|
||||
runs:
|
||||
using: 'composite'
|
||||
steps:
|
||||
- name: docker login
|
||||
env:
|
||||
REGISTRY_URL: ${{ inputs.REGISTRY_URL }}
|
||||
REGISTRY_USER: ${{ inputs.REGISTRY_USER }}
|
||||
REGISTRY_PASSWORD: ${{ inputs.REGISTRY_PASSWORD }}
|
||||
run: echo "$REGISTRY_PASSWORD" | docker login "$REGISTRY_URL" --username "$REGISTRY_USER" --password-stdin
|
||||
|
||||
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