-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (34 loc) · 1.02 KB
/
_parse_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
---
name: "(chunk) Parse version"
on:
workflow_call:
inputs:
github_sha:
type: string
required: false
default: master
outputs:
LIBRARY_VERSION:
description: "Version of the library"
value: ${{ jobs.get_library_version.outputs.LIBRARY_VERSION }}
jobs:
get_library_version:
runs-on: ubuntu-latest
outputs:
LIBRARY_VERSION: ${{ steps.tag_name.outputs.LIBRARY_VERSION }}
steps:
- name: Checkout master
uses: actions/checkout@v2
with:
ref: ${{ inputs.github_sha }}
- name: Get version from CMakeLists.txt
id: tag_name
run: |
LIBRARY_VERSION=$(sed -ne 's/^.*[^0-9]VERSION \([0-9]*\.[0-9]*\.[0-9]*\).*$/\1/p' CMakeLists.txt)
echo "Found version '${LIBRARY_VERSION}'"
echo ::set-output name=LIBRARY_VERSION::${LIBRARY_VERSION}
- name: Check the tag
env:
LIBRARY_VERSION: ${{ steps.tag_name.outputs.LIBRARY_VERSION }}
run: |
echo $LIBRARY_VERSION