Skip to content

Commit a230af0

Browse files
committed
build project before publishing
1 parent 09b97c6 commit a230af0

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

.github/workflows/deploy.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,20 @@ jobs:
2222
- name: Install dependencies
2323
run: npm install
2424

25-
- name: Run tests
26-
run: npm test
25+
- name: Build project
26+
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
2736
2837
- name: Publish to npm
38+
if: steps.check-version.outputs.exists == 'false'
2939
run: npm publish
3040
env:
3141
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)