Skip to content

Commit e423b36

Browse files
committed
try new auth system
1 parent 93ee08c commit e423b36

File tree

1 file changed

+22
-18
lines changed

1 file changed

+22
-18
lines changed

.github/workflows/hub-publish.yml

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -23,27 +23,30 @@ defaults:
2323
run:
2424
working-directory: packages/hub
2525

26+
permissions:
27+
contents: write
28+
id-token: write
29+
packages: write
30+
2631
jobs:
2732
version_and_release:
2833
runs-on: ubuntu-latest
2934
steps:
30-
- uses: actions/checkout@v3
31-
with:
32-
# Needed to push the tag and the commit on the main branch, otherwise we get:
33-
# > Run git push --follow-tags
34-
# remote: error: GH006: Protected branch update failed for refs/heads/main.
35-
# remote: error: Changes must be made through a pull request. Required status check "lint" is expected.
36-
token: ${{ secrets.BOT_ACCESS_TOKEN }}
35+
- uses: actions/checkout@v4
3736
- run: npm install -g corepack@latest && corepack enable
38-
- uses: actions/setup-node@v3
37+
- uses: actions/setup-node@v4
3938
with:
40-
node-version: "20"
39+
node-version: "24"
4140
cache: "pnpm"
4241
cache-dependency-path: |
4342
packages/hub/pnpm-lock.yaml
4443
packages/doc-internal/pnpm-lock.yaml
4544
# setting a registry enables the NODE_AUTH_TOKEN env variable where we can set an npm token. REQUIRED
46-
registry-url: "https://registry.npmjs.org"
45+
# Needed to push the tag and the commit on the main branch, otherwise we get:
46+
# > Run git push --follow-tags
47+
# remote: error: GH006: Protected branch update failed for refs/heads/main.
48+
# remote: error: Changes must be made through a pull request. Required status check "lint" is expected.
49+
token: ${{ secrets.BOT_ACCESS_TOKEN }}
4750
- run: pnpm install
4851
- run: git config --global user.name machineuser
4952
- run: git config --global user.email [email protected]
@@ -61,19 +64,20 @@ jobs:
6164
name: "Check Deps are published before publishing this package"
6265
run: pnpm -w check-deps tasks
6366

64-
- run: pnpm publish --no-git-checks .
65-
env:
66-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
6767
- run: (git pull --rebase && git push --follow-tags) || (git pull --rebase && git push --follow-tags)
68+
69+
- run: pnpm publish --no-git-checks .
70+
6871
# hack - reuse actions/setup-node@v3 just to set a new registry
69-
- uses: actions/setup-node@v3
72+
- uses: actions/setup-node@v4
7073
with:
71-
node-version: "20"
74+
node-version: "24"
7275
registry-url: "https://npm.pkg.github.com"
76+
7377
# Disable for now, until github supports PATs for writing github packages (https://github.com/github/roadmap/issues/558)
74-
# - run: pnpm publish --no-git-checks .
75-
# env:
76-
# NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
78+
- run: pnpm publish --no-git-checks .
79+
env:
80+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7781
- name: "Update Doc"
7882
uses: peter-evans/repository-dispatch@v2
7983
with:

0 commit comments

Comments
 (0)