|
1 | | -# npm publishing (@next, @beta and @latest) is done by the ESRP pipeline, |
2 | | -# see .azure-pipelines/publish.yml |
3 | | -name: "publish release - trace viewer" |
| 1 | +name: "publish release - npm, trace viewer" |
4 | 2 |
|
5 | 3 | on: |
6 | 4 | workflow_dispatch: |
|
13 | 11 | types: [published] |
14 | 12 |
|
15 | 13 | jobs: |
| 14 | + publish-npm: |
| 15 | + name: "publish NPM" |
| 16 | + runs-on: ubuntu-24.04 |
| 17 | + if: github.repository == 'microsoft/playwright' |
| 18 | + permissions: |
| 19 | + id-token: write # This is required for OIDC login (NPM publish) to succeed |
| 20 | + contents: read # This is required for actions/checkout to succeed |
| 21 | + steps: |
| 22 | + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
| 23 | + - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 |
| 24 | + with: |
| 25 | + node-version: lts/* |
| 26 | + registry-url: 'https://registry.npmjs.org' |
| 27 | + - run: npm ci |
| 28 | + - run: npm run build |
| 29 | + |
| 30 | + - name: "@next: publish with commit timestamp (triggered manually)" |
| 31 | + if: contains(github.ref, 'main') && github.event_name == 'workflow_dispatch' |
| 32 | + run: | |
| 33 | + node utils/build/update_canary_version.js --alpha --commit-timestamp |
| 34 | + utils/publish_all_packages.sh --alpha |
| 35 | + - name: "@next: publish with today's date (triggered automatically)" |
| 36 | + if: contains(github.ref, 'main') && github.event.schedule |
| 37 | + run: | |
| 38 | + node utils/build/update_canary_version.js --alpha --today-date |
| 39 | + utils/publish_all_packages.sh --alpha |
| 40 | + - name: "@beta: publish with commit timestamp (triggered automatically)" |
| 41 | + if: contains(github.ref, 'release') && github.event_name == 'push' |
| 42 | + run: | |
| 43 | + node utils/build/update_canary_version.js --beta --commit-timestamp |
| 44 | + utils/publish_all_packages.sh --beta |
| 45 | + - name: "publish release to NPM" |
| 46 | + if: github.event_name == 'release' && github.event.action == 'published' |
| 47 | + run: utils/publish_all_packages.sh --release |
| 48 | + |
16 | 49 | publish-trace-viewer: |
17 | 50 | name: "publish Trace Viewer to trace.playwright.dev" |
18 | 51 | runs-on: ubuntu-24.04 |
|
0 commit comments