53 lines
1.4 KiB
YAML
53 lines
1.4 KiB
YAML
|
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: [self-hosted, common]
|
||
|
outputs:
|
||
|
stability: ${{ steps.get_environment.outputs.stability }}
|
||
|
version: ${{ steps.get_environment.outputs.version }}
|
||
|
release: ${{ steps.get_environment.outputs.release }}
|
||
|
|
||
|
steps:
|
||
|
#- uses: actions/checkout@v3
|
||
|
|
||
|
- id: get_environment
|
||
|
run: |
|
||
|
case "$BRANCHNAME" in
|
||
|
develop)
|
||
|
STABILITY="unstable"
|
||
|
;;
|
||
|
release* | hotfix*)
|
||
|
STABILITY="testing"
|
||
|
;;
|
||
|
master)
|
||
|
STABILITY="stable"
|
||
|
;;
|
||
|
*)
|
||
|
STABILITY="canary"
|
||
|
;;
|
||
|
esac
|
||
|
|
||
|
# @todo remove next line
|
||
|
STABILITY="unstable"
|
||
|
|
||
|
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
|