-
Notifications
You must be signed in to change notification settings - Fork 104
51 lines (44 loc) · 1.37 KB
/
remote-version.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
name: 'Composition Repo - Determine latest published version'
on:
workflow_call:
inputs:
repository_url:
description: "Composition repository URL, e.g. https//github.com/hitobito/ose_composition_sjas.git"
required: true
type: string
stage:
description: "Stage of release to be prepared"
required: true
type: string
outputs:
version:
value: ${{ jobs.version.outputs.version }}
jobs:
version:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.determine.outputs.version }}
steps:
- name: 'Set up Ruby'
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.0.6
- name: 'Install dependencies'
run: |
gem install cmdparse
- name: 'Install helper-script'
env:
VERSION_SOURCE: "https://raw.githubusercontent.com/hitobito/hitobito/master/bin/version"
run: |
mkdir -p bin
curl --silent -k "$VERSION_SOURCE" > bin/version
chmod a+x bin/version
- name: 'Determine current version'
id: determine
env:
STAGE: ${{ inputs.stage }}
REPO: ${{ inputs.repository_url }}
run: |
next_version=$(bin/version remote "$STAGE" "$REPO")
echo "next version: ${next_version}"
echo "version=${next_version}" >> "$GITHUB_OUTPUT"