Skip to content

Commit 45f22d4

Browse files
committed
ci: use prepublishOnly hook to build before publish
1 parent 15967c3 commit 45f22d4

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,7 @@ jobs:
4242
run: yarn validate
4343

4444
- name: Upload Coverage / Release
45-
run: |
46-
yarn build
47-
yarn ci-after-success
45+
run: yarn ci-after-success
4846
env:
4947
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
5048
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

package.json

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,20 @@
1111
"hover-scripts": "dist/index.js"
1212
},
1313
"scripts": {
14-
"test": "node src test",
15-
"test:update": "node src test --updateSnapshot",
1614
"build": "run-p build:*",
1715
"build:source": "babel --source-maps --out-dir dist --ignore '**/__tests__/**','**/__mocks__/**' --copy-files --no-copy-ignored src",
1816
"build:types": "tsc -p src/",
19-
"lint": "node src lint",
20-
"format": "node src format",
21-
"validate": "node src validate",
22-
"commit": "node src commit",
2317
"ci-after-success": "node src ci-after-success",
18+
"commit": "node src commit",
19+
"format": "node src format",
20+
"lint": "node src lint",
21+
"prepublishOnly": "yarn build",
2422
"start": "run-p start:*",
2523
"start:source": "yarn build:source --watch",
26-
"start:types": "tsc -b -w --preserveWatchOutput src/"
24+
"start:types": "tsc -b -w --preserveWatchOutput src/",
25+
"test": "node src test",
26+
"test:update": "node src test --updateSnapshot",
27+
"validate": "node src validate"
2728
},
2829
"husky": {
2930
"hooks": {

0 commit comments

Comments
 (0)