Skip to content

Commit 27a461b

Browse files
authored
Fix NPM publishing once and for all (#3811)
1 parent 3d83dad commit 27a461b

File tree

16 files changed

+43
-10
lines changed

16 files changed

+43
-10
lines changed

.github/workflows/publish.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ jobs:
2929
with:
3030
node-version: 22
3131
registry-url: 'https://registry.npmjs.org'
32+
# Ensure npm 11.5.1 or later is installed
33+
- name: Update npm
34+
run: npm install -g npm@latest
3235
- name: Setup Bun
3336
uses: ./.github/composite/setup-bun
3437
- name: Install dependencies
@@ -39,13 +42,10 @@ jobs:
3942
id: changesets
4043
uses: changesets/action@v1
4144
with:
45+
publish: bun run publish-all-packages
4246
version: bun run changeset-version
4347
env:
4448
# Using a PAT instead of GITHUB_TOKEN because we need to run workflows when releases are created
4549
# https://github.com/orgs/community/discussions/26875#discussioncomment-3253761
4650
GITHUB_TOKEN: ${{ secrets.GH_PERSONAL_TOKEN }}
4751

48-
# We use a dedicated step to publish to npm because it needs the top level GITHUB_TOKEN and not the GH_PERSONAL_TOKEN one
49-
- name: Publish to NPM
50-
if: steps.changesets.outputs.hasChangesets == 'false'
51-
run: bun run publish-all-packages

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"e2e-customers": "turbo run e2e-customers",
3333
"changeset": "changeset",
3434
"changeset-version": "changeset version && bun run format && bun update",
35-
"publish-all-packages": "turbo run publish-to-npm",
35+
"publish-all-packages": "turbo run publish-to-npm --continue=dependencies-successful",
3636
"download:env": "op read op://gitbook-x-dev/gitbook-open/.env.local >> .env.local",
3737
"clean": "turbo run clean"
3838
},

packages/browser-types/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,8 @@
2929
"publishConfig": {
3030
"access": "public",
3131
"registry": "https://registry.npmjs.org/"
32+
},
33+
"repository": {
34+
"url": "https://github.com/GitbookIO/gitbook"
3235
}
3336
}

packages/cache-tags/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,8 @@
2828
"publishConfig": {
2929
"access": "public",
3030
"registry": "https://registry.npmjs.org/"
31+
},
32+
"repository": {
33+
"url": "https://github.com/GitbookIO/gitbook"
3134
}
3235
}

packages/colors/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,8 @@
2424
"publishConfig": {
2525
"access": "public",
2626
"registry": "https://registry.npmjs.org/"
27+
},
28+
"repository": {
29+
"url": "https://github.com/GitbookIO/gitbook"
2730
}
2831
}

packages/embed/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,8 @@
4141
"publishConfig": {
4242
"access": "public",
4343
"registry": "https://registry.npmjs.org/"
44+
},
45+
"repository": {
46+
"url": "https://github.com/GitbookIO/gitbook"
4447
}
4548
}

packages/expr/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,8 @@
4040
"publishConfig": {
4141
"access": "public",
4242
"registry": "https://registry.npmjs.org/"
43+
},
44+
"repository": {
45+
"url": "https://github.com/GitbookIO/gitbook"
4346
}
4447
}

packages/fonts/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,8 @@
3434
"publishConfig": {
3535
"access": "public",
3636
"registry": "https://registry.npmjs.org/"
37+
},
38+
"repository": {
39+
"url": "https://github.com/GitbookIO/gitbook"
3740
}
3841
}

packages/gitbook/turbo.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
},
1212
"typecheck": {
1313
"dependsOn": ["^typecheck", "generate"]
14+
},
15+
"publish-to-npm": {
16+
"dependsOn": []
1417
}
1518
}
1619
}

packages/icons/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,5 +52,8 @@
5252
"publishConfig": {
5353
"access": "public",
5454
"registry": "https://registry.npmjs.org/"
55+
},
56+
"repository": {
57+
"url": "https://github.com/GitbookIO/gitbook"
5558
}
5659
}

0 commit comments

Comments
 (0)