Skip to content

Commit

Permalink
minor workflow fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ukorvl committed Oct 21, 2023
1 parent e8cc9ae commit 6ed7969
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
if: ${{ inputs.should_pack == true }}
run: |
VERSION=$(node -pe 'require("./package.json").version')
echo "::set-output name=version::$VERSION"
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Upload build result
if: ${{ inputs.should_pack == true }}
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,18 @@ jobs:
id: check_version
run: |
NEW_PACKAGE_VERSION=$(node -pe 'require("./package.json").version')
echo "$NEW_PACKAGE_VERSION"
latestTag=$(git describe --tags `git rev-list --tags --max-count=1`)
git checkout $latestTag
OLD_PACKAGE_VERSION=$(node -pe 'require("./package.json").version')
echo "$OLD_PACKAGE_VERSION"
if [ $NEW_PACKAGE_VERSION != $OLD_PACKAGE_VERSION ]; then
echo "::set-output name=version::$NEW_PACKAGE_VERSION"
echo "Version was changed"
echo "version=xxxx" >> $GITHUB_OUTPUT
fi
build:
Expand All @@ -41,7 +44,7 @@ jobs:

publish:
runs-on: ubuntu-latest
needs: [build]
needs: [build, ensure_version_changed]
if: ${{ needs.ensure_version_changed.outputs.version }}
name: Publish to npm
steps:
Expand Down

0 comments on commit 6ed7969

Please sign in to comment.