Skip to content

Commit 777b1c6

Browse files
committed
Step: Read XML Version
1 parent 6873c57 commit 777b1c6

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

.github/workflows/release.yml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,23 @@ jobs:
2424
- name: .NET Info
2525
run: dotnet --info
2626

27-
- name: Read XML with PowerShell
28-
id: getxml
27+
- name: Install libxml2
2928
run: |
30-
[xml]$xml = Get-Content ./src/Ocelot.Testing.csproj
31-
$value_Version = $xml.SelectSingleNode("//Project/PropertyGroup/Version").InnerText
32-
echo "::set-output name=Version::$value_Version"
33-
29+
sudo apt update
30+
sudo apt install libxml2-utils
31+
- name: Read XML
32+
id: xml
33+
run: |
34+
xml_value=$(xmllint --xpath "string(//Project/PropertyGroup/Version)" ./src/Ocelot.Testing.csproj)
35+
echo "Version: $xml_value"
36+
echo "Version=$xml_value" >> $GITHUB_OUTPUT
37+
xml_value=$(xmllint --xpath "string((//Project/ItemGroup)[2]/PackageReference[@Include='Ocelot']/@Version)" ./src/Ocelot.Testing.csproj)
38+
echo "Ocelot Ref Ver: $xml_value"
39+
echo "OcelotRefVer=$xml_value" >> $GITHUB_OUTPUT
3440
- name: Use extracted value
3541
run: |
36-
echo "Extracted value: ${{ steps.getxml.outputs.Version }}"
42+
echo "Version: ${{ steps.xml.outputs.Version }}"
43+
echo "Ocelot Ref Ver: ${{ steps.xml.outputs.OcelotRefVer }}"
3744
3845
# - name: Create GitHub Release
3946
# uses: actions/create-release@v1

0 commit comments

Comments
 (0)