File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -57,13 +57,26 @@ jobs:
5757 ${{ steps.changelog.outputs.compareurl }}
5858 ${{ steps.changelog.outputs.changelog }}
5959
60+ - name : Get package version
61+ id : pkg_version
62+ run : echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
63+
64+ - name : Check if version exists on npm
65+ id : npm_check
66+ run : |
67+ if npm view react-native-file-viewer-turbo@${{ steps.pkg_version.outputs.version }} version 2>/dev/null; then
68+ echo "exists=true" >> $GITHUB_OUTPUT
69+ else
70+ echo "exists=false" >> $GITHUB_OUTPUT
71+ fi
72+
6073 - name : Setup Node.js for npm publish
61- if : steps.create_tag .outputs.successful == 'true '
74+ if : steps.npm_check .outputs.exists == 'false '
6275 uses : actions/setup-node@v4
6376 with :
64- node-version-file : .nvmrc
77+ node-version : ' 24 '
6578 registry-url : ' https://registry.npmjs.org'
6679
6780 - name : Publish to npm
68- if : steps.create_tag .outputs.successful == 'true '
81+ if : steps.npm_check .outputs.exists == 'false '
6982 run : npm publish --access public
You can’t perform that action at this time.
0 commit comments