-
Notifications
You must be signed in to change notification settings - Fork 104
86 lines (76 loc) · 2.68 KB
/
stage-settings.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: "Composition Repo - Determine Settings"
on:
workflow_call:
inputs:
repository:
description: "Composition repository, e.g. hitobito/ose_composition_sjas"
required: true
type: string
stage:
description: "Stage of release to be prepared, e.g. integration"
required: true
type: string
release_type:
description: "Type of Release: regular, patch or custom"
required: false
type: string
default: "regular"
dry_run:
description: "Do not execute the commands"
required: false
type: boolean
default: false
outputs:
project:
value: ${{ jobs.settings.outputs.project }}
repo_name:
value: ${{ jobs.settings.outputs.repo_name }}
repo_url:
value: ${{ jobs.settings.outputs.repo_url }}
composition_branch:
value: ${{ jobs.settings.outputs.composition_branch }}
release_stage:
value: ${{ jobs.settings.outputs.release_stage }}
release_type:
value: ${{ jobs.settings.outputs.release_type }}
dry_run:
value: ${{ jobs.settings.outputs.dry_run }}
jobs:
settings:
runs-on: ubuntu-latest
outputs:
project: ${{ steps.determine.outputs.project }}
repo_name: ${{ steps.determine.outputs.repo_name }}
repo_url: ${{ steps.determine.outputs.repo_url }}
composition_branch: ${{ steps.determine.outputs.branch }}
release_stage: ${{ steps.determine.outputs.stage }}
release_type: ${{ steps.determine.outputs.release_type }}
dry_run: ${{ steps.determine.outputs.dry_run }}
steps:
- name: Infer project-name and stage-settings
id: determine
env:
STAGE: ${{ inputs.stage }}
REPO: ${{ inputs.repository }}
RELEASE_TYPE: ${{ inputs.release_type }}
DRY_RUN: ${{ inputs.dry_run }}
run: |
echo "stage=${STAGE}" >> "$GITHUB_OUTPUT"
echo "repo_name=${REPO}" >> "$GITHUB_OUTPUT"
echo "repo_url=https://github.com/${REPO}.git" >> "$GITHUB_OUTPUT"
echo "project=${REPO##hitobito/ose_composition_}" >> "$GITHUB_OUTPUT"
if [[ "${DRY_RUN}" = 'true' ]]; then
echo 'dry_run=-n' >> "$GITHUB_OUTPUT"
else
echo 'dry_run=' >> "$GITHUB_OUTPUT"
fi
case $STAGE in
production)
echo "branch=production" >> "$GITHUB_OUTPUT"
echo "release_type=${RELEASE_TYPE}" >> "$GITHUB_OUTPUT"
;;
integration)
echo "branch=devel" >> "$GITHUB_OUTPUT"
echo "release_type=integration" >> "$GITHUB_OUTPUT"
;;
esac;