Skip to content

Commit a4a494d

Browse files
authored
ci: update release action (#37)
1 parent f75f768 commit a4a494d

1 file changed

Lines changed: 16 additions & 3 deletions

File tree

.github/workflows/release.yml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)