Skip to content

Commit 7bc9102

Browse files
committed
chore: improve nightly script
1 parent 61d67fe commit 7bc9102

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

.github/workflows/release-nightly.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,25 @@ jobs:
2727
VERSION=0.0.0-nightly.$SHORT_SHA
2828
npm version $VERSION --no-git-tag-version
2929
echo "version=$VERSION" >> $GITHUB_ENV
30+
echo "version=$VERSION" >> $GITHUB_OUTPUT
31+
32+
- name: Publish nightly
33+
run: npm publish --tag nightly
34+
env:
35+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
3036

3137
- name: Check if version already exists
38+
id: check-version
3239
run: |
33-
if npm view react-native-css@$version > /dev/null 2>&1; then
34-
echo "Version $version already exists. Skipping publish."
35-
exit 0
40+
if npm view react-native-css@${{ steps.set-version.outputs.version }} > /dev/null 2>&1; then
41+
echo "Version ${{ steps.set-version.outputs.version }} already exists. Skipping publish."
42+
echo "exists=true" >> $GITHUB_OUTPUT
43+
else
44+
echo "exists=false" >> $GITHUB_OUTPUT
3645
fi
3746
3847
- name: Publish nightly
48+
if: steps.check-version.outputs.exists == 'false'
3949
run: npm publish --tag nightly
4050
env:
41-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
51+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)