Skip to content

Commit 930b2ef

Browse files
B4nanclaude
andauthored
chore: migrate to pnpm and enable minimum release age (#3581)
## Summary Port the pnpm migration from master (#3568) to the v4 branch. Same goals: - Yarn 4 → pnpm 10.24.0 - `minimumReleaseAge: 1440` supply-chain guard at both pnpm and Renovate layers - Internal `@apify/*`, `@crawlee/*`, `apify-client`, `apify`, `crawlee`, `got-scraping` whitelisted - `only-allow pnpm` preinstall hook blocks npm/yarn usage - Shared `apify/workflows/pnpm-install@main` action in all CI workflows ### v4-specific adaptations - Node matrix `[22, 24]` (v4 already dropped 18, 20) - oxlint/oxfmt (not eslint/biome) - publish dist-tag `v4` instead of `next` - No eslint-config pin needed - Internal deps: `workspace:*` for regular deps, `workspace:^` for peerDeps ### Incidentally fixed Four packages were missing explicit `@crawlee/*` deps that yarn's hoisting masked: - `@crawlee/http` → `@crawlee/core` - `@crawlee/linkedom` → `@crawlee/utils` - `@crawlee/playwright` → `@crawlee/basic` - `@crawlee/puppeteer` → `@crawlee/core` 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent bec112a commit 930b2ef

41 files changed

Lines changed: 27643 additions & 34660 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/docs.yml

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,35 +25,26 @@ jobs:
2525
node-version: 24
2626
package-manager-cache: false
2727

28-
- name: Enable corepack
29-
run: |
30-
corepack enable
31-
corepack prepare yarn@stable --activate
28+
- uses: apify/workflows/pnpm-install@main
3229

3330
- name: Build & deploy docs
3431
run: |
35-
# install project deps
36-
yarn
37-
# go to website dir
3832
cd website
39-
# install website deps
40-
yarn
41-
# build the docs
42-
yarn build
33+
pnpm build
4334
env:
4435
APIFY_SIGNING_TOKEN: ${{ secrets.APIFY_SIGNING_TOKEN }}
4536
SEGMENT_TOKEN: ${{ secrets.SEGMENT_TOKEN }}
4637

4738
- name: Set up GitHub Pages
48-
uses: actions/configure-pages@v5
39+
uses: actions/configure-pages@v6
4940

5041
- name: Upload GitHub Pages artifact
5142
uses: actions/upload-pages-artifact@v4
5243
with:
5344
path: ./website/build
5445

5546
- name: Deploy artifact to GitHub Pages
56-
uses: actions/deploy-pages@v4
47+
uses: actions/deploy-pages@v5
5748

5849
- name: Invalidate CloudFront cache
5950
run: |

.github/workflows/publish-to-npm.yml

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,6 @@ jobs:
4949
node-version: 24
5050
package-manager-cache: false
5151

52-
- name: Enable corepack
53-
run: |
54-
corepack enable
55-
corepack prepare yarn@stable --activate
56-
57-
- name: Activate cache for Node.js 24
58-
uses: actions/setup-node@v6
59-
with:
60-
cache: 'yarn'
61-
6252
- name: Turbo cache
6353
id: turbo-cache
6454
uses: actions/cache@v5
@@ -68,20 +58,19 @@ jobs:
6858
restore-keys: |
6959
turbo-${{ github.job }}-${{ github.ref_name }}-
7060
71-
- name: Install dependencies
72-
run: yarn
61+
- uses: apify/workflows/pnpm-install@main
7362

7463
- name: Build packages
75-
run: yarn ci:build
64+
run: pnpm ci:build
7665

7766
- name: Bump canary versions
7867
if: inputs.dist-tag == 'next'
7968
run: |
80-
yarn turbo copy --force -- --canary=major --preid=beta
69+
pnpm turbo copy --force -- --canary=major --preid=beta
8170
8271
- name: Commit changes
8372
if: inputs.dist-tag == 'next'
84-
uses: EndBug/add-and-commit@v9
73+
uses: EndBug/add-and-commit@v10
8574
id: commit
8675
with:
8776
author_name: Apify Release Bot
@@ -91,22 +80,22 @@ jobs:
9180

9281
- name: Publish to NPM (@latest)
9382
if: inputs.dist-tag == 'prod'
94-
uses: nick-fields/retry@v3
83+
uses: nick-fields/retry@v4
9584
with:
9685
timeout_minutes: 10
9786
max_attempts: 5
9887
retry_wait_seconds: 30
99-
command: git checkout . && yarn publish:prod --yes
88+
command: git checkout . && pnpm publish:prod -- --yes
10089
env:
10190
GH_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
10291

10392
- name: Publish to NPM (@next)
10493
if: inputs.dist-tag == 'next'
105-
uses: nick-fields/retry@v3
94+
uses: nick-fields/retry@v4
10695
with:
10796
timeout_minutes: 10
10897
max_attempts: 5
10998
retry_wait_seconds: 30
110-
command: git checkout . && yarn publish:next --yes
99+
command: git checkout . && pnpm publish:next -- --yes
111100
env:
112101
GH_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}

.github/workflows/release.yml

Lines changed: 17 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
name: Release @latest
22

33
env:
4-
YARN_IGNORE_NODE: 1
54
RETRY_TESTS: 1
65

76
on:
@@ -52,16 +51,6 @@ jobs:
5251
node-version: ${{ matrix.node-version }}
5352
package-manager-cache: false
5453

55-
- name: Enable corepack
56-
run: |
57-
corepack enable
58-
corepack prepare yarn@stable --activate
59-
60-
- name: Activate cache for Node.js ${{ matrix.node-version }}
61-
uses: actions/setup-node@v6
62-
with:
63-
cache: 'yarn'
64-
6554
- name: Turbo cache
6655
id: turbo-cache
6756
uses: actions/cache@v5
@@ -71,16 +60,16 @@ jobs:
7160
restore-keys: |
7261
turbo-${{ github.job }}-${{ github.ref_name }}-
7362
74-
- name: Install Dependencies
75-
run: |
76-
yarn
77-
yarn playwright install --with-deps
63+
- uses: apify/workflows/pnpm-install@main
64+
65+
- name: Install Playwright browsers
66+
run: pnpm exec playwright install --with-deps
7867

7968
- name: Build
80-
run: yarn ci:build
69+
run: pnpm ci:build
8170

8271
- name: Tests
83-
run: yarn test
72+
run: pnpm test
8473

8574
release:
8675
name: "Bump Crawlee: ${{ inputs.version }} version (${{ inputs.custom_version || 'n/a' }} custom version)"
@@ -101,16 +90,6 @@ jobs:
10190
node-version: 24
10291
package-manager-cache: false
10392

104-
- name: Enable corepack
105-
run: |
106-
corepack enable
107-
corepack prepare yarn@stable --activate
108-
109-
- name: Activate cache for Node.js 24
110-
uses: actions/setup-node@v6
111-
with:
112-
cache: 'yarn'
113-
11493
- name: Turbo cache
11594
id: turbo-cache
11695
uses: actions/cache@v5
@@ -120,15 +99,14 @@ jobs:
12099
restore-keys: |
121100
turbo-${{ github.job }}-${{ github.ref_name }}-
122101
123-
- name: Install Dependencies
124-
run: yarn
102+
- uses: apify/workflows/pnpm-install@main
125103

126104
- name: Build
127-
run: yarn ci:build
105+
run: pnpm ci:build
128106

129107
- name: Bump version to custom version
130108
if: ${{ github.event.inputs.version == 'custom' && github.event.inputs.custom_version != '' }}
131-
run: yarn lerna version ${{ github.event.inputs.custom_version }} --force-publish --yes
109+
run: pnpm exec lerna version ${{ github.event.inputs.custom_version }} --force-publish --yes
132110
env:
133111
GH_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
134112
GIT_AUTHOR_NAME: Apify Release Bot
@@ -138,7 +116,7 @@ jobs:
138116

139117
- name: Bump version to ${{ github.event.inputs.version }} version
140118
if: ${{ github.event.inputs.version != 'custom' }}
141-
run: yarn lerna version ${{ github.event.inputs.version }} --force-publish --yes
119+
run: pnpm exec lerna version ${{ github.event.inputs.version }} --force-publish --yes
142120
env:
143121
GH_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
144122
GIT_AUTHOR_NAME: Apify Release Bot
@@ -148,16 +126,17 @@ jobs:
148126

149127
- name: Pin versions in internal dependencies and update lockfile
150128
run: |
151-
yarn release:pin-versions
152-
yarn install --no-immutable
129+
pnpm release:pin-versions
130+
pnpm install --no-frozen-lockfile
153131
154132
- name: Commit changes
155133
id: commit
156-
uses: EndBug/add-and-commit@v9
134+
uses: EndBug/add-and-commit@v10
157135
with:
158136
author_name: Apify Release Bot
159137
author_email: noreply@apify.com
160138
message: 'chore(release): update internal dependencies [skip ci]'
139+
pull: '--rebase --autostash'
161140

162141
- name: Publish packages
163142
uses: apify/workflows/execute-workflow@main
@@ -198,23 +177,7 @@ jobs:
198177
- name: Install jq
199178
run: sudo apt-get install jq
200179

201-
- name: Enable corepack
202-
run: |
203-
corepack enable
204-
corepack prepare yarn@stable --activate
205-
206-
- name: Activate cache for Node.js 24
207-
uses: actions/setup-node@v6
208-
with:
209-
cache: 'yarn'
210-
211-
- name: Install dependencies
212-
run: |
213-
# install project deps
214-
yarn
215-
# install website deps
216-
cd website
217-
yarn
180+
- uses: apify/workflows/pnpm-install@main
218181

219182
- name: Snapshot the current version
220183
run: |
@@ -225,8 +188,8 @@ jobs:
225188
exit 1
226189
fi
227190
MAJOR_MINOR=$(echo $VERSION | cut -d. -f1,2)
228-
yarn docusaurus docs:version $MAJOR_MINOR
229-
yarn docusaurus api:version $MAJOR_MINOR
191+
pnpm docusaurus docs:version $MAJOR_MINOR
192+
pnpm docusaurus api:version $MAJOR_MINOR
230193
231194
- name: Commit and push the version snapshot
232195
run: |

0 commit comments

Comments
 (0)