Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not fail version check if development version is set #197

Merged
merged 6 commits into from
Nov 16, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 17 additions & 7 deletions .github/workflows/version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,26 @@ jobs:
- name: NEWS.md and DESCRIPTION Version check 🏁
run: |
DESC_VERSION=$(awk -F: '/Version:/{gsub(/[ ]+/,"") ; print $2}' DESCRIPTION)
NEWS_VERSION=$(awk '/^#+ /{print $3; exit}' NEWS.md)
NEWS_VERSION=$(awk '/^#+ /{print $3,$4; exit}' NEWS.md)
DESC_DEV_VERSION=$(echo $DESC_VERSION | awk -F '.' '{print $NF}')
echo "NEWS.md version: $NEWS_VERSION"
echo "DESCRIPTION version: $DESC_VERSION"
if (test $DESC_VERSION = $NEWS_VERSION ); then
echo "NEWS.md and DESCRIPTION have the same version"
else
echo "🙈 NEWS.md and DESCRIPTION have different versions!"
echo "🙏 Please fix this."
exit 1
if [[ "$DESC_VERSION" == "$NEWS_VERSION" ]]
then {
echo "NEWS.md and DESCRIPTION have the same version 🎉"
exit 0
}
fi
if [[ $DESC_DEV_VERSION -gt 9000 && "$NEWS_VERSION" == "(development version)" ]]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure but if 9000 is a valid development version (right after release), then maybe -gt should be changed to -ge?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes.

cicdguy marked this conversation as resolved.
Show resolved Hide resolved
then {
echo "NEWS.md and DESCRIPTION file versions are okay as package is in development mode."
echo "All is okay 🆗"
exit 0
}
fi
echo "🙈 NEWS.md and DESCRIPTION have different versions!"
echo "🙏 Please fix this."
exit 1
shell: bash
working-directory: ${{ inputs.package-subdirectory }}

Expand Down
Loading