Skip to content

Commit 0db162a

Browse files
committed
Release version 24.0.2
1 parent 39ffbcb commit 0db162a

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

.github/workflows/release.yml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ on:
44
push:
55
tags:
66
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
7+
branches:
8+
- main
79
jobs:
810
release:
911
runs-on: ubuntu-latest
@@ -28,10 +30,14 @@ jobs:
2830
echo 'Removes tags <sub> and </sub>'
2931
sed -i 's/<\/\?sub>//g' README.md
3032
cat README.md
31-
- name: Install XML tools
33+
- name: Install tools
3234
run: |
3335
sudo apt update
3436
sudo apt install libxml2-utils xmlstarlet
37+
get_latest_release() {
38+
curl --silent "https://api.github.com/repos/$1/releases/latest" | jq -r .tag_name
39+
}
40+
get_latest_release "ThreeMammals/Ocelot"
3541
- name: Read XML
3642
id: xml
3743
run: |
@@ -41,6 +47,9 @@ jobs:
4147
xml_value=$(xmllint --xpath "string((//Project/ItemGroup)[2]/PackageReference[@Include='Ocelot']/@Version)" ./src/Ocelot.Testing.csproj)
4248
echo "Ocelot Ref Ver: $xml_value"
4349
echo "OcelotRefVer=$xml_value" >> $GITHUB_OUTPUT
50+
oc_latest_release=$(curl "https://api.github.com/repos/ThreeMammals/Ocelot/releases/latest" | jq -r .tag_name)
51+
echo "Ocelot Ver: $oc_latest_release"
52+
echo "OcelotVer=$oc_latest_release" >> $GITHUB_OUTPUT
4453
- name: Replace Version
4554
id: ver
4655
run: |
@@ -83,13 +92,13 @@ jobs:
8392
uses: softprops/action-gh-release@v2
8493
env:
8594
PACKAGE_VERSION: ${{ steps.ver.outputs.PkgVersion }}
86-
OCELOT_VERSION: ${{ steps.xml.outputs.OcelotRefVer }}
95+
OCELOT_VERSION: ${{ steps.xml.outputs.OcelotVer }}
8796
with:
88-
# tag_name: 0.0.5 # Name of a tag. defaults to github.ref_name
97+
tag_name: 24.0.2.1 # Name of a tag. defaults to github.ref_name
8998
body: |
9099
## Version [${{ env.PACKAGE_VERSION }}](https://www.nuget.org/packages/Ocelot.Testing/${{ env.PACKAGE_VERSION }})
91-
- Ocelot dependency package: v[${{ env.OCELOT_VERSION }}](https://www.nuget.org/packages/Ocelot/${{ env.OCELOT_VERSION }})
92-
- For Ocelot release: [${{ env.OCELOT_VERSION }}](https://github.com/ThreeMammals/Ocelot/releases/tag/${{ env.OCELOT_VERSION }})
100+
- Ocelot package: v[${{ env.OCELOT_VERSION }}](https://www.nuget.org/packages/Ocelot/${{ env.OCELOT_VERSION }})
101+
- Ocelot release: [${{ env.OCELOT_VERSION }}](https://github.com/ThreeMammals/Ocelot/releases/tag/${{ env.OCELOT_VERSION }})
93102
files: |
94103
packages/*.*pkg
95104
draft: false

0 commit comments

Comments
 (0)