Skip to content

Commit

Permalink
Merge pull request #93 from Hau-Hau/7-release-workflow
Browse files Browse the repository at this point in the history
fix version check
  • Loading branch information
Hau-Hau authored Sep 22, 2024
2 parents f540fc4 + 90c451b commit f9a22fa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ jobs:
version=$(sed -n 's:.*<version>\(.*\)</version>.*:\1:p' ./${{ inputs.project }}/${{ inputs.project }}.nuspec)
version_of_last_release=$(git tag -l "${{ inputs.project }}/*" | sort -V | tail -n 1 | sed 's/${{ inputs.project }}\///')
if [ "$version" = "$version_of_last_release" ]; then
if [[ "$version" == "$version_of_last_release" ]]; then
echo "Version in ${{ inputs.project }}.nuspec is same as version of last release. Please update the nuspec file before proceeding with the release."
echo "result=false" >> $GITHUB_OUTPUT
exit 0
fi
if [ "$(printf '%s\n' "$version_of_last_release" "$version" | sort -V | head -n 1)" = "$version_of_last_release" ]; then
if [[ "$(printf '%s\n' "$version" "$version_of_last_release" | sort -V | tail -n 1 | xargs)" != "$version" ]]; then
echo "Version in ${{ inputs.project }}.nuspec is lower than or equal to the version of the last release. Please update the nuspec file with a higher version."
echo "result=false" >> $GITHUB_OUTPUT
exit 0
Expand Down

0 comments on commit f9a22fa

Please sign in to comment.