Visitar URL original
devops: restore npm publishing from GitHub Actions (#42550) · microsoft/playwright@52900a1 · GitHub
Skip to content

Commit 52900a1

Browse files
authored
devops: restore npm publishing from GitHub Actions (#42550)
1 parent 8c47f59 commit 52900a1

2 files changed

Lines changed: 43 additions & 23 deletions

File tree

‎.azure-pipelines/publish.yml‎

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,13 @@
1-
# Publishes all npm packages via ESRP:
2-
# - @next (alpha with today's date) from main, daily on schedule
3-
# - @next (alpha with commit timestamp) from main, on manual trigger
4-
# - @beta (beta with commit timestamp) from release-* branches, on push
5-
# - @latest from v* release tags (pushed when a GitHub release is published)
6-
trigger:
7-
branches:
8-
include:
9-
- release-*
10-
tags:
11-
include:
12-
- v*
1+
# Publishes npm packages via ESRP. Manual trigger only, regular publishing
2+
# is done from GitHub Actions, see .github/workflows/publish_release.yml.
3+
# Depending on the selected ref, a manual run publishes:
4+
# - @next (alpha with commit timestamp) from main
5+
# - @beta (beta with commit timestamp) from release-* branches
6+
# - @latest from v* release tags
7+
trigger: none
138

149
pr: none
1510

16-
schedules:
17-
- cron: '10 5 * * *'
18-
displayName: "Daily @next publish"
19-
branches:
20-
include:
21-
- main
22-
always: true
23-
2411
resources:
2512
repositories:
2613
- repository: 1esPipelines

‎.github/workflows/publish_release.yml‎

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
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"
42

53
on:
64
workflow_dispatch:
@@ -13,6 +11,41 @@ on:
1311
types: [published]
1412

1513
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+
1649
publish-trace-viewer:
1750
name: "publish Trace Viewer to trace.playwright.dev"
1851
runs-on: ubuntu-24.04

0 commit comments

Comments
 (0)