Skip to content

Commit ee07376

Browse files
Create get-cpp-package-info.yml
1 parent 24e16be commit ee07376

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
on:
2+
workflow_call:
3+
outputs:
4+
nuspec_path:
5+
description: "The path of the file with .nuspec extension"
6+
value: ${{ jobs.get_cpp_package_info.outputs.nuspec_path }}
7+
version:
8+
description: "The package version"
9+
value: ${{ jobs.get_cpp_package_info.outputs.version }}
10+
release_notes:
11+
description: "The package release notes"
12+
value: ${{ jobs.get_cpp_package_info.outputs.release_notes }}
13+
14+
env:
15+
REPOSITORY_NAME: basename ${{ github.repository }}
16+
17+
jobs:
18+
get_cpp_package_info:
19+
runs-on: ubuntu-latest
20+
outputs:
21+
nuspec_path: ${{steps.get_package_name.package_name}}
22+
version: ${{steps.get_version.version}}
23+
release_notes: ${{steps.get_release_notes.release_notes}}
24+
steps:
25+
- uses: actions/checkout@v1
26+
with:
27+
submodules: true
28+
- name: Get nuspec path
29+
id: get_nuspec_path
30+
run: |
31+
export nuspec_path="Platform.$REPOSITORY_NAME/Platform.$REPOSITORY_NAME.TemplateLibrary.nuspec"
32+
echo "nuspec_path=${nuspec_path}" >> $GITHUB_OUTPUT
33+
- name: Get version
34+
id: get_version
35+
run: |
36+
version=$(grep -Pzo "<version>[^<>]+</version>" "$CPP_PACKAGE_NUSPEC_PATH" | sed -e 's/<.\?[a-zA-Z]\+>//g' | tr -d '\0')
37+
echo "versino=${version}" >> $GITHUB_OUTPUT
38+
- name: Get version
39+
id: get_version
40+
run: |
41+
release_notes=$(grep -Pzo "<releaseNotes>[^<>]+</releaseNotes>" "$CPP_PACKAGE_NUSPEC_PATH" | sed -e 's/<.\?[a-zA-Z]\+>//g' | tr -d '\0')
42+
echo "release_notes=${release_notes}" >> $GITHUB_OUTPUT

0 commit comments

Comments
 (0)