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

Fix check version publish workflow #923

Merged
merged 2 commits into from
Dec 21, 2023
Merged
Changes from all commits
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
8 changes: 4 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# get the next version number from the package.json
NEXT=$(npm pkg get version)
NEXT=$(npm pkg get version | tr -d '"')

# get the current version number from the current state of main branch
CURRENT=$(gh release list --limit 1 | awk '{print $2}')
Expand Down Expand Up @@ -57,13 +57,13 @@ jobs:
CURRENT_MINOR=$(echo $CURRENT | cut -d. -f2)
CURRENT_PATCH=$(echo $CURRENT | cut -d. -f3)

if [[ "$NEXT_MAJOR" > "$CURRENT_MAJOR" ]]; then
if [[ "$NEXT_MAJOR" -gt "$CURRENT_MAJOR" ]]; then
echo "major version bump detected"
echo "bump=true" >> $GITHUB_OUTPUT
elif [[ "$NEXT_MINOR" > "$CURRENT_MINOR" ]]; then
elif [[ "$NEXT_MINOR" -gt "$CURRENT_MINOR" ]]; then
echo "minor version bump detected"
echo "bump=true" >> $GITHUB_OUTPUT
elif [[ "$NEXT_PATCH" > "$CURRENT_PATCH" ]]; then
elif [[ "$NEXT_PATCH" -gt "$CURRENT_PATCH" ]]; then
echo "patch version bump detected"
echo "bump=true" >> $GITHUB_OUTPUT
else
Expand Down
Loading