Skip to content

Crawlee—A web scraping and browser automation library for Node.js to build reliable crawlers. In JavaScript and TypeScript. Extract data for AI, LLMs, RAG, or GPTs. Download HTML, PDF, JPG, PNG, and other files from websites. Works with Puppeteer, Playwright, Cheerio, JSDOM, and raw HTTP. Both headful and headless mode. With proxy rotation.

chore: support RC releases in the publish workflow (#4009)

Martin Adámekbb2f26743f2c
diff --git a/.github/workflows/publish-to-npm.yml b/.github/workflows/publish-to-npm.yml
index ed51d8e01..25fd98f3e 100644
--- a/.github/workflows/publish-to-npm.yml
+++ b/.github/workflows/publish-to-npm.yml
@@ -8,7 +8,7 @@ on:
required: true
type: string
dist-tag:
- description: NPM dist-tag (prod or next)
+ description: NPM dist-tag (prod, next or rc)
required: false
type: string
default: 'prod'
@@ -19,7 +19,7 @@ on:
required: true
type: string
dist-tag:
- description: NPM dist-tag (prod or next)
+ description: NPM dist-tag (prod, next or rc)
required: false
type: string
default: 'prod'
@@ -66,7 +66,7 @@ jobs:
- name: Bump canary versions
if: inputs.dist-tag != 'prod'
run: |
- pnpm turbo copy --force -- --canary=major --preid=beta
+ pnpm turbo copy --force -- --canary=major --preid=${{ inputs.dist-tag == 'rc' && 'rc' || 'beta' }}
- name: Commit changes
if: inputs.dist-tag != 'prod'
@@ -75,7 +75,7 @@ jobs:
with:
author_name: Apify Release Bot
author_email: [email protected]
- message: 'chore: bump canary versions [skip ci]'
+ message: "chore: bump ${{ inputs.dist-tag == 'rc' && 'RC' || 'canary' }} versions [skip ci]"
push: false
- name: Publish to NPM (@latest)
@@ -90,7 +90,7 @@ jobs:
GH_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
- name: Publish to NPM (@next)
- if: inputs.dist-tag != 'prod'
+ if: inputs.dist-tag != 'prod' && inputs.dist-tag != 'rc'
uses: nick-fields/retry@v4
with:
timeout_minutes: 10
@@ -99,3 +99,24 @@ jobs:
command: git checkout . && pnpm publish:next
env:
GH_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
+
+ - name: Publish to NPM (@rc)
+ if: inputs.dist-tag == 'rc'
+ uses: nick-fields/retry@v4
+ with:
+ timeout_minutes: 10
+ max_attempts: 5
+ retry_wait_seconds: 30
+ command: git checkout . && pnpm publish:rc
+ env:
+ GH_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
+
+ # RC releases produce no changelog and no commit on the branch, only a git tag
+ # pointing at the released commit (the version bump lives only on npm).
+ - name: Create git tag
+ if: inputs.dist-tag == 'rc'
+ run: |
+ VERSION=$(node -p "require('./packages/core/dist/package.json').version")
+ git reset --hard HEAD~1
+ git tag "v$VERSION"
+ git push origin "refs/tags/v$VERSION"
diff --git a/package.json b/package.json
index 7f2f36ace..9990f5f5a 100644
--- a/package.json
+++ b/package.json
@@ -45,6 +45,7 @@
"coverage": "vitest --coverage",
"publish:next": "lerna publish from-package --contents dist --dist-tag v4 --force-publish --yes",
"release:next": "pnpm build && pnpm publish:next",
+ "publish:rc": "lerna publish from-package --contents dist --dist-tag rc --force-publish --yes",
"publish:prod": "lerna publish from-package --contents dist --force-publish --yes",
"release:prod": "pnpm build && pnpm publish:prod",
"release:pin-versions": "turbo run copy -- -- --pin-versions",