diff --git a/.github/workflows/pr_preview.yaml b/.github/workflows/pr_preview.yaml new file mode 100644 index 000000000..b9c82b193 --- /dev/null +++ b/.github/workflows/pr_preview.yaml @@ -0,0 +1,41 @@ +# This workflow publishes a preview build of every pull request to pkg.pr.new, so that +# reviewers can install the CLI from a pull request without a local checkout. + +name: PR preview + +on: + pull_request: + +permissions: {} + +env: + LATEST_NODE_VERSION: 24 + APIFY_CLI_DISABLE_TELEMETRY: 1 + +concurrency: + cancel-in-progress: true + group: pr-preview-${{ github.ref }} + +jobs: + publish: + # No previews from forks, and a dependency bump never needs one. + if: ${{ github.event.pull_request.head.repo.full_name == github.repository && github.event.pull_request.user.type != 'Bot' }} + + name: Publish preview + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + + - name: Use Node.js ${{ env.LATEST_NODE_VERSION }} + uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 + with: + node-version: ${{ env.LATEST_NODE_VERSION }} + + - name: Install pnpm and dependencies + uses: apify/actions/pnpm-install@v1.6.2 + + # `pnpm pack` runs the `prepack` script, which builds the CLI. + - name: Publish to pkg.pr.new + run: pnpm exec pkg-pr-new publish --pnpm --bin --comment=update diff --git a/package.json b/package.json index f2f277140..5457bdad3 100644 --- a/package.json +++ b/package.json @@ -136,6 +136,7 @@ "oxfmt": "0.73.0", "oxlint": "1.89.0", "oxlint-tsgolint": "0.22.1", + "pkg-pr-new": "0.0.91", "rimraf": "~6.1.3", "tsdown": "^0.23.0", "tsx": "^4.23.13", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 85793e2c4..f5ae8ebdd 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -374,6 +374,9 @@ importers: oxlint-tsgolint: specifier: 0.22.1 version: 0.22.1 + pkg-pr-new: + specifier: 0.0.91 + version: 0.0.91 rimraf: specifier: ~6.1.3 version: 6.1.3 @@ -7313,6 +7316,10 @@ packages: resolution: {integrity: sha512-Ie9z/WINcxxLp27BKOCHGde4ITq9UklYKDzVo1nhk5sqGEXU3FpkwP5GM2voTGJkGd9B3Otl+Q4uwSOeSUtOBA==} engines: {node: '>=14.16'} + pkg-pr-new@0.0.91: + resolution: {integrity: sha512-FQPmjspKRKYV4MlHQnun9snJqlYm6Yhmo12x1O3pgE2Akim/y/BZjMOppK//BFdh222WOj6WGqlmeZfrtUtfgQ==} + hasBin: true + pkijs@3.4.1: resolution: {integrity: sha512-Oo/NZcSWccq8KyoG7gLE9fnltgHns+pNCjCAp/WmjsUySi+sX7y4z4Xqu4fVb42CDHzRPl33fjzT15V1wvcyhA==} engines: {node: '>=16.0.0'} @@ -8620,13 +8627,10 @@ packages: resolution: {integrity: sha512-drKKsqvDBxVRn4ySU67iQ5nQBuo/1xyYeBfdhDde112PkqrS3+95KPnpDs5hFRcmrW+q6+gbyywYYYR14oWFtw==} engines: {node: '>= 16'} peerDependencies: - css-to-react-native: '>= 3.2.0' react: '>= 16.8.0' react-dom: '>= 16.8.0' react-native: '>= 0.68.0' peerDependenciesMeta: - css-to-react-native: - optional: true react-dom: optional: true react-native: @@ -14419,8 +14423,8 @@ snapshots: clean-stack: 2.2.0 indent-string: 4.0.0 - ajv-formats@3.0.1: - dependencies: + ajv-formats@3.0.1(ajv@8.20.0): + optionalDependencies: ajv: 8.20.0 ajv-keywords@3.5.2(ajv@6.15.0): @@ -17811,6 +17815,8 @@ snapshots: dependencies: find-up: 6.3.0 + pkg-pr-new@0.0.91: {} + pkijs@3.4.1: dependencies: '@noble/hashes': 1.8.0 @@ -19060,7 +19066,7 @@ snapshots: dependencies: '@types/json-schema': 7.0.15 ajv: 8.20.0 - ajv-formats: 3.0.1 + ajv-formats: 3.0.1(ajv@8.20.0) ajv-keywords: 5.1.0(ajv@8.20.0) optionalDependencies: webpack: 5.112.0(@swc/core@1.16.18)(@swc/html@1.16.18)(clean-css@5.3.3)(cssnano@6.1.2(postcss@8.5.31))(csso@5.0.5)(esbuild@0.28.2)(html-minifier-terser@7.2.0)(lightningcss@1.33.0)(postcss@8.5.31)(svgo@3.3.5)(uglify-js@3.19.3)