mirror of
https://github.com/microsoft/playwright.git
synced 2026-09-14 14:08:10 +08:00
9a77d56f58
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
84 lines
3.1 KiB
YAML
84 lines
3.1 KiB
YAML
name: "publish release - npm, trace viewer"
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
schedule:
|
|
- cron: "10 5 * * *"
|
|
push:
|
|
branches:
|
|
- release-*
|
|
release:
|
|
types: [published]
|
|
|
|
jobs:
|
|
publish-npm:
|
|
name: "publish NPM"
|
|
runs-on: ubuntu-24.04
|
|
if: github.repository == 'microsoft/playwright'
|
|
permissions:
|
|
id-token: write # This is required for OIDC login (NPM publish) to succeed
|
|
contents: read # This is required for actions/checkout to succeed
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- uses: actions/setup-node@v6
|
|
with:
|
|
node-version: lts/*
|
|
registry-url: 'https://registry.npmjs.org'
|
|
- run: npm ci
|
|
- run: npm run build
|
|
|
|
- name: "@next: publish with commit timestamp (triggered manually)"
|
|
if: contains(github.ref, 'main') && github.event_name == 'workflow_dispatch'
|
|
run: |
|
|
node utils/build/update_canary_version.js --alpha --commit-timestamp
|
|
utils/publish_all_packages.sh --alpha
|
|
- name: "@next: publish with today's date (triggered automatically)"
|
|
if: contains(github.ref, 'main') && github.event.schedule
|
|
run: |
|
|
node utils/build/update_canary_version.js --alpha --today-date
|
|
utils/publish_all_packages.sh --alpha
|
|
- name: "@beta: publish with commit timestamp (triggered automatically)"
|
|
if: contains(github.ref, 'release') && github.event_name == 'push'
|
|
run: |
|
|
node utils/build/update_canary_version.js --beta --commit-timestamp
|
|
utils/publish_all_packages.sh --beta
|
|
- name: "publish release to NPM"
|
|
if: github.event_name == 'release' && github.event.action == 'published'
|
|
run: utils/publish_all_packages.sh --release
|
|
|
|
publish-trace-viewer:
|
|
name: "publish Trace Viewer to trace.playwright.dev"
|
|
runs-on: ubuntu-24.04
|
|
if: github.repository == 'microsoft/playwright'
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- uses: actions/setup-node@v6
|
|
with:
|
|
node-version: lts/*
|
|
- uses: actions/create-github-app-token@v3
|
|
id: app-token
|
|
with:
|
|
client-id: ${{ vars.PLAYWRIGHT_APP_CLIENT_ID }}
|
|
private-key: ${{ secrets.PLAYWRIGHT_PRIVATE_KEY }}
|
|
repositories: trace.playwright.dev
|
|
- name: Deploy Canary
|
|
if: contains(github.ref, 'main') && github.event.schedule
|
|
run: bash utils/build/deploy-trace-viewer.sh --canary
|
|
env:
|
|
GH_SERVICE_ACCOUNT_TOKEN: ${{ steps.app-token.outputs.token }}
|
|
- name: Deploy Beta
|
|
if: contains(github.ref, 'release') && github.event_name == 'push'
|
|
run: bash utils/build/deploy-trace-viewer.sh --beta
|
|
env:
|
|
GH_SERVICE_ACCOUNT_TOKEN: ${{ steps.app-token.outputs.token }}
|
|
- name: Deploy Stable
|
|
if: github.event_name == 'release' && github.event.action == 'published'
|
|
run: bash utils/build/deploy-trace-viewer.sh --stable
|
|
env:
|
|
GH_SERVICE_ACCOUNT_TOKEN: ${{ steps.app-token.outputs.token }}
|
|
- name: Deploy Stable (manually)
|
|
if: contains(github.ref, 'release') && github.event_name == 'workflow_dispatch'
|
|
run: bash utils/build/deploy-trace-viewer.sh --stable
|
|
env:
|
|
GH_SERVICE_ACCOUNT_TOKEN: ${{ steps.app-token.outputs.token }}
|