Skip to content

Commit bdc0533

Browse files
authored
build: Fix publish CI for publishing docs (#108)
Update publish step to auto-deploy new TypeDoc docs.
1 parent 4e1516a commit bdc0533

File tree

5 files changed

+98
-28
lines changed

5 files changed

+98
-28
lines changed

.github/workflows/ci.yml

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- name: Setup node
2525
uses: actions/setup-node@v3
2626
with:
27-
node-version: 18
27+
node-version: 20
2828

2929
- name: Install pnpm
3030
uses: pnpm/action-setup@v2
@@ -64,7 +64,7 @@ jobs:
6464
- name: Setup node
6565
uses: actions/setup-node@v3
6666
with:
67-
node-version: 18
67+
node-version: 20
6868

6969
- name: Install pnpm
7070
uses: pnpm/action-setup@v2
@@ -110,7 +110,7 @@ jobs:
110110
- name: Setup node
111111
uses: actions/setup-node@v3
112112
with:
113-
node-version: 18
113+
node-version: 20
114114

115115
- name: Install pnpm
116116
uses: pnpm/action-setup@v2
@@ -156,7 +156,7 @@ jobs:
156156
- name: Setup node
157157
uses: actions/setup-node@v3
158158
with:
159-
node-version: 18
159+
node-version: 20
160160

161161
- name: Install pnpm
162162
uses: pnpm/action-setup@v2
@@ -272,8 +272,8 @@ jobs:
272272
- name: Run e2e tests
273273
run: pnpm run test:e2e
274274

275-
upload-example-build-stats-production:
276-
name: Build and upload ${{ matrix.example }} example stats data to production
275+
upload-example-stats-production:
276+
name: "Production: upload ${{ matrix.example }} stats"
277277
runs-on: ubuntu-latest
278278
needs: [install, unit-test, integration-test]
279279
strategy:
@@ -289,7 +289,7 @@ jobs:
289289
- name: Setup node
290290
uses: actions/setup-node@v3
291291
with:
292-
node-version: 18
292+
node-version: 20
293293

294294
- name: Install pnpm
295295
uses: pnpm/action-setup@v2
@@ -335,8 +335,8 @@ jobs:
335335
WEBPACK_API_URL: ${{ secrets.CODECOV_API_URL }}
336336
run: pnpm run build
337337

338-
upload-example-build-stats-staging:
339-
name: Build and upload ${{ matrix.example }} example stats data to staging
338+
upload-example-stats-staging:
339+
name: "Staging: upload ${{ matrix.example }} stats"
340340
runs-on: ubuntu-latest
341341
needs: [install, unit-test, integration-test]
342342
strategy:
@@ -352,7 +352,7 @@ jobs:
352352
- name: Setup node
353353
uses: actions/setup-node@v3
354354
with:
355-
node-version: 18
355+
node-version: 20
356356

357357
- name: Install pnpm
358358
uses: pnpm/action-setup@v2
@@ -399,7 +399,7 @@ jobs:
399399
run: pnpm run build
400400

401401
upldate-plugin-stats-production:
402-
name: Build and upload ${{ matrix.package }} stats data to production
402+
name: "Production: upload ${{ matrix.package }} stats"
403403
runs-on: ubuntu-latest
404404
needs: [install, unit-test, integration-test]
405405
strategy:
@@ -421,7 +421,7 @@ jobs:
421421
- name: Setup node
422422
uses: actions/setup-node@v3
423423
with:
424-
node-version: 18
424+
node-version: 20
425425

426426
- name: Install pnpm
427427
uses: pnpm/action-setup@v2
@@ -461,9 +461,8 @@ jobs:
461461
PLUGIN_CODECOV_API_URL: ${{ secrets.CODECOV_API_URL }}
462462
run: pnpm run build
463463

464-
465464
upldate-plugin-stats-staging:
466-
name: Build and upload ${{ matrix.package }} stats data to staging
465+
name: "Staging: upload ${{ matrix.package }} stats"
467466
runs-on: ubuntu-latest
468467
needs: [install, unit-test, integration-test]
469468
strategy:
@@ -485,7 +484,7 @@ jobs:
485484
- name: Setup node
486485
uses: actions/setup-node@v3
487486
with:
488-
node-version: 18
487+
node-version: 20
489488

490489
- name: Install pnpm
491490
uses: pnpm/action-setup@v2
@@ -511,10 +510,10 @@ jobs:
511510
512511
- name: Install dependencies
513512
run: pnpm install
514-
513+
515514
- name: Build plugins
516515
run: pnpm run build
517-
516+
518517
- name: Install plugins
519518
run: pnpm install
520519

.github/workflows/publish.yml

Lines changed: 79 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,30 @@ jobs:
2727
with:
2828
node-version-file: "package.json"
2929

30-
- name: Setup pnpm & install dependencies
30+
- name: Setup pnpm
3131
uses: pnpm/action-setup@v2
3232
with:
3333
version: 8
34-
run_install: true
34+
run_install: false
35+
36+
- name: Get pnpm store directory
37+
shell: bash
38+
run: |
39+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
40+
41+
- name: Cache node_modules
42+
id: cache-node-modules
43+
uses: actions/cache@v3
44+
env:
45+
cache-name: cache-codecov-js-bundle-plugin-node-modules
46+
with:
47+
path: ${{ env.STORE_PATH }}
48+
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }}
49+
restore-keys: |
50+
${{ runner.os }}-${{ env.cache-name }}-
51+
52+
- name: Install dependencies
53+
run: pnpm install
3554

3655
- name: Publish to NPM
3756
uses: changesets/action@v1
@@ -42,5 +61,63 @@ jobs:
4261
publish: pnpm changeset:publish
4362
createGithubReleases: true
4463

64+
publish_docs:
65+
name: Publish Docs
66+
needs: publish
67+
runs-on: ubuntu-latest
68+
# For whatever reason, yaml does not like the full "meta(changelog): Update package versions" string
69+
# So we check this in two parts
70+
if: |
71+
contains(github.event.head_commit.message, 'meta(changelog)')
72+
&& contains(github.event.head_commit.message, 'Update package versions')
73+
steps:
74+
- name: Checkout Repo
75+
uses: actions/checkout@v4
76+
77+
- name: Import GPG key
78+
id: import-gpg
79+
uses: crazy-max/ghaction-import-gpg@v6
80+
with:
81+
gpg_private_key: ${{ secrets.RELEASER_GPG_PRIVATE_KEY }}
82+
git_user_signingkey: true
83+
git_commit_gpgsign: true
84+
git_config_global: true
85+
86+
- name: Setup Git
87+
run: |
88+
echo "machine github.com login x password ${{ secrets.GITHUB_TOKEN }}" > ~/.netrc
89+
git config --global url."https://github.com/".insteadOf "git://github.com/"
90+
git config --global advice.detachedHead false
91+
92+
- name: Set up Node
93+
uses: actions/setup-node@v4
94+
with:
95+
node-version-file: "package.json"
96+
97+
- name: Setup pnpm
98+
uses: pnpm/action-setup@v2
99+
with:
100+
version: 8
101+
run_install: false
102+
103+
- name: Get pnpm store directory
104+
shell: bash
105+
run: |
106+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
107+
108+
- name: Cache node_modules
109+
id: cache-node-modules
110+
uses: actions/cache@v3
111+
env:
112+
cache-name: cache-codecov-js-bundle-plugin-node-modules
113+
with:
114+
path: ${{ env.STORE_PATH }}
115+
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }}
116+
restore-keys: |
117+
${{ runner.os }}-${{ env.cache-name }}-
118+
119+
- name: Install dependencies
120+
run: pnpm install
121+
45122
- name: Publish new docs
46123
run: node scripts/publish-docs.js

.github/workflows/test-api-ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ jobs:
1616
uses: codecov/gha-workflows/.github/workflows/[email protected]
1717
secrets: inherit
1818
with:
19-
push: false
20-
image_name: codecov-javascript-bundler-plugins-test-api
21-
docker_path: integration-tests/test-api
19+
push: false
20+
image_name: codecov-javascript-bundler-plugins-test-api
21+
docker_path: integration-tests/test-api

codecov.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,6 @@ ai_pr_review:
55
enabled: true
66

77
component_management:
8-
default_rules:
9-
statuses:
10-
- type: patch
11-
target: auto
12-
branches:
13-
- "!main"
148
individual_components:
159
- component_id: package_core
1610
name: Plugin core

0 commit comments

Comments
 (0)