From 7f5d4b2f14f6cb83cbe1638a4125162d64fb8d12 Mon Sep 17 00:00:00 2001 From: Andy Bitz Date: Tue, 1 Nov 2022 21:43:03 +0100 Subject: [PATCH 1/5] Ensure `npm run prepublish` gets executed --- .github/workflows/publish.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 877d1cd..3868d90 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -14,6 +14,7 @@ jobs: with: node-version: '16.x' registry-url: 'https://registry.npmjs.org' + - run: npm run prepublish - run: npm publish env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN_ELEVATED }} From c6e92f10fb3fd8cb8a31890281f5fd102eef3ba2 Mon Sep 17 00:00:00 2001 From: Andy Bitz Date: Tue, 1 Nov 2022 21:45:56 +0100 Subject: [PATCH 2/5] Switch to prepublishOnly --- .github/workflows/publish.yaml | 1 - package.json | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 3868d90..877d1cd 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -14,7 +14,6 @@ jobs: with: node-version: '16.x' registry-url: 'https://registry.npmjs.org' - - run: npm run prepublish - run: npm publish env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN_ELEVATED }} diff --git a/package.json b/package.json index 8126c77..e1136f2 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "coverage": "nyc report --reporter=text-lcov > coverage.lcov", "lint-staged": "git diff --diff-filter=ACMRT --cached --name-only '*.js' '*.jsx' | xargs zeit-eslint", "build-views": "dottojs -s ./src -d ./src", - "prepublish": "yarn run build-views" + "prepublishOnly": "yarn run build-views" }, "repository": "zeit/serve-handler", "keywords": [ From 41acf08444b84093d35c5c1d8a46e6c4015b16bd Mon Sep 17 00:00:00 2001 From: Andy Bitz Date: Tue, 1 Nov 2022 21:46:53 +0100 Subject: [PATCH 3/5] Include install in publish script --- .github/workflows/publish.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 877d1cd..b22155e 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -11,9 +11,11 @@ jobs: steps: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 + timeout-minutes: 5 # See https://github.com/actions/cache/issues/810 with: - node-version: '16.x' - registry-url: 'https://registry.npmjs.org' + cache: 'yarn' + + - run: yarn install --network-timeout 1000000 --frozen-lockfile - run: npm publish env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN_ELEVATED }} From 0ed24b58215f2dafc73250a366066cdcbeed16be Mon Sep 17 00:00:00 2001 From: Andy Bitz Date: Tue, 1 Nov 2022 21:52:49 +0100 Subject: [PATCH 4/5] Keep registry and version --- .github/workflows/publish.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index b22155e..5fdefbb 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -14,8 +14,11 @@ jobs: timeout-minutes: 5 # See https://github.com/actions/cache/issues/810 with: cache: 'yarn' + node-version: '16.x' + registry-url: 'https://registry.npmjs.org' - run: yarn install --network-timeout 1000000 --frozen-lockfile + - run: npm run test - run: npm publish env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN_ELEVATED }} From 044590675600fb945dbda088a2bb86b310a75678 Mon Sep 17 00:00:00 2001 From: Andy Bitz Date: Tue, 1 Nov 2022 21:55:21 +0100 Subject: [PATCH 5/5] Run build during tests --- .github/workflows/tests.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 593b75e..e52a109 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -20,6 +20,7 @@ jobs: cache: 'yarn' - run: yarn install --network-timeout 1000000 --frozen-lockfile + - run: yarn run build-views - run: yarn test - run: yarn run coverage