We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 09b97c6 commit a230af0Copy full SHA for a230af0
.github/workflows/deploy.yml
@@ -22,10 +22,20 @@ jobs:
22
- name: Install dependencies
23
run: npm install
24
25
- - name: Run tests
26
- run: npm test
+ - name: Build project
+ run: npm run build
27
+
28
+ - name: Check if version exists
29
+ id: check-version
30
+ run: |
31
+ if npm view $(node -p "require('./package.json').name")@$(node -p "require('./package.json').version") > /dev/null 2>&1; then
32
+ echo "::set-output name=exists::true"
33
+ else
34
+ echo "::set-output name=exists::false"
35
+ fi
36
37
- name: Publish to npm
38
+ if: steps.check-version.outputs.exists == 'false'
39
run: npm publish
40
env:
41
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
0 commit comments