centreon-plugins/.github/workflows/get-environment.yml

48 lines
1.3 KiB
YAML
Raw Normal View History

2023-01-10 15:03:40 +01:00
on:
workflow_call:
outputs:
stability:
description: "branch stability (stable, testing, unstable, canary)"
value: ${{ jobs.get-version.outputs.stability }}
version:
description: "version"
value: ${{ jobs.get-version.outputs.version }}
release:
description: "release number"
value: ${{ jobs.get-version.outputs.release }}
jobs:
get-version:
runs-on: ubuntu-22.04
2023-01-10 15:03:40 +01:00
outputs:
stability: ${{ steps.get_environment.outputs.stability }}
version: ${{ steps.get_environment.outputs.version }}
release: ${{ steps.get_environment.outputs.release }}
steps:
- id: get_environment
run: |
case "$BRANCHNAME" in
develop)
STABILITY="unstable"
;;
release* | hotfix*)
STABILITY="testing"
;;
master)
STABILITY="stable"
;;
*)
STABILITY="canary"
;;
esac
echo "stability=$STABILITY" >> $GITHUB_OUTPUT
VERSION=`date '+%Y%m%d'`
echo "version=$(echo $VERSION)" >> $GITHUB_OUTPUT
RELEASE=`date '+%H%M%S'`
echo "release=$(echo $RELEASE)" >> $GITHUB_OUTPUT
shell: bash