Skip to content

Commit 461645c

Browse files
authored
Add check npm view before uploading node.js pkg (#137)
In case the release workflow fails for something else (e,g. releasing python package), with this change the upload process doesn't fail if the npm package has been already uploaded.
1 parent 7bd84e7 commit 461645c

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

.github/workflows/release-workflow.yaml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,14 @@ jobs:
9696

9797
- name: Publish JS package
9898
working-directory: npm_publish
99-
run: npm publish
99+
run: |
100+
PACKAGE_VERSION=$(jq -r .version package.json)
101+
if npm view @qdrant/qdrant-cloud-public-api@"$PACKAGE_VERSION"; then
102+
echo
103+
echo "Package $PACKAGE_VERSION already exists, skipping publish."
104+
exit 0
105+
fi
106+
npm publish
100107
finalize-release:
101108
name: Finalize Release
102109
runs-on: ubuntu-latest
@@ -129,4 +136,4 @@ jobs:
129136
tag: ${{ env.RELEASE_VERSION }}
130137
publish: true
131138
env:
132-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
139+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)