Skip to content

Commit

Permalink
Merge pull request #2 from canopas/fix-publish-flow
Browse files Browse the repository at this point in the history
Fix publishing npm package ci
  • Loading branch information
cp-dharti-r committed Jan 11, 2024
2 parents 5fe3d29 + 8af7cb6 commit bbc7ee1
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,21 @@ jobs:
# Check if the vue-file-upload version already exists on npm
- name: Check Version Existence
id: check_version
id: check_vue_version
run: |
if npm show @canopassoftware/[email protected]; then
echo "Version already published. Skipping npm publish."
echo "::set-output name=skip_publish::true"
echo "::set-output name=skip_vue_publish::true"
else
echo "::set-output name=skip_publish::false"
echo "::set-output name=skip_vue_publish::false"
fi
# Publish only if the vue-file-upload version check passed
- name: Publish to npm
if: steps.check_version.outputs.skip_publish != true
run: npm publish --access public
if: steps.check_vue_version.outputs.skip_vue_publish != 'true'
run: |
cd vue
npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

Expand All @@ -52,18 +54,20 @@ jobs:
# Check if the react-file-upload version already exists on npm
- name: Check Version Existence
id: check_version
id: check_react_version
run: |
if npm show @canopassoftware/[email protected]; then
echo "Version already published. Skipping npm publish."
echo "::set-output name=skip_publish::true"
echo "::set-output name=skip_react_publish::true"
else
echo "::set-output name=skip_publish::false"
echo "::set-output name=skip_react_publish::false"
fi
# Publish only if the react-file-upload version check passed
- name: Publish to npm
if: steps.check_version.outputs.skip_publish != true
run: npm publish --access public
if: steps.check_react_version.outputs.skip_react_publish != 'true'
run: |
cd react
npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 comments on commit bbc7ee1

Please sign in to comment.