Skip to content

Commit 7542017

Browse files
authored
Ensure npm run prepublish gets executed (#190)
* Ensure `npm run prepublish` gets executed * Switch to prepublishOnly * Include install in publish script * Keep registry and version * Run build during tests
1 parent a2c28fb commit 7542017

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

.github/workflows/publish.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,14 @@ jobs:
1111
steps:
1212
- uses: actions/checkout@v3
1313
- uses: actions/setup-node@v3
14+
timeout-minutes: 5 # See https://github.com/actions/cache/issues/810
1415
with:
16+
cache: 'yarn'
1517
node-version: '16.x'
1618
registry-url: 'https://registry.npmjs.org'
19+
20+
- run: yarn install --network-timeout 1000000 --frozen-lockfile
21+
- run: npm run test
1722
- run: npm publish
1823
env:
1924
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN_ELEVATED }}

.github/workflows/tests.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ jobs:
2020
cache: 'yarn'
2121

2222
- run: yarn install --network-timeout 1000000 --frozen-lockfile
23+
- run: yarn run build-views
2324
- run: yarn test
2425
- run: yarn run coverage
2526

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"coverage": "nyc report --reporter=text-lcov > coverage.lcov",
1111
"lint-staged": "git diff --diff-filter=ACMRT --cached --name-only '*.js' '*.jsx' | xargs zeit-eslint",
1212
"build-views": "dottojs -s ./src -d ./src",
13-
"prepublish": "yarn run build-views"
13+
"prepublishOnly": "yarn run build-views"
1414
},
1515
"repository": "zeit/serve-handler",
1616
"keywords": [

0 commit comments

Comments
 (0)