Skip to content

Commit

Permalink
chore: Update release action to work for both latest and preview
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-paliychuk committed May 8, 2024
1 parent 76181fa commit 78d66fb
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,19 @@ jobs:
run: |
# grep will return a non-zero exit code if the version does not match the release pattern
if echo "$PACKAGE_VERSION" | grep -E '^[0-9]+\.[0-9]+\.[0-9]+$' > /dev/null; then
echo "Version must be a prerelease version"
exit 1
echo "is_next=false" >> $GITHUB_ENV
else
echo "Packaging a prerelease version $PACKAGE_VERSION"
echo "is_next=true" >> $GITHUB_ENV
fi
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Publish package
run: yarn publish --tag preview
run: |
if [ "$is_next" = "true" ]; then
yarn publish --tag preview
else
yarn publish
fi
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 comments on commit 78d66fb

Please sign in to comment.