Skip to content

Commit 0e216bc

Browse files
aslushnikovdgozman
andauthored
cherry-pick(release-1.8): update publish script to work for @next (#5075)
Cherry-pick 0d0a6e8 Co-authored-by: Dmitry Gozman <dgozman@gmail.com>
1 parent 320e8ce commit 0e216bc

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

.github/workflows/publish_canary_npm.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- uses: microsoft/playwright-github-action@v1
2121
- run: npm ci
2222
- run: npm run build
23-
- run: node utils/build/update_canary_version.js
23+
# publish_all_packages.sh updates the version automatically
2424
- run: utils/publish_all_packages.sh --tip-of-tree
2525
env:
2626
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

utils/publish_all_packages.sh

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,18 @@ fi
4141

4242
cd ..
4343

44-
NPM_PUBLISH_TAG="next"
45-
VERSION=$(node -e 'console.log(require("./package.json").version)')
46-
4744
if [[ -n $(git status -s) ]]; then
4845
echo "ERROR: git status is dirty; some uncommitted changes or untracked files"
4946
exit 1
5047
fi
5148

49+
NPM_PUBLISH_TAG="next"
50+
51+
if [[ $1 == "--tip-of-tree" ]]; then
52+
node utils/build/update_canary_version.js
53+
fi
54+
VERSION=$(node -e 'console.log(require("./package.json").version)')
55+
5256
if [[ $1 == "--release" ]]; then
5357
# Ensure package version does not contain dash.
5458
if [[ "${VERSION}" == *-* ]]; then
@@ -76,6 +80,8 @@ else
7680
exit 1
7781
fi
7882

83+
echo "==================== Building version ${VERSION} ================"
84+
7985
PLAYWRIGHT_TGZ="$PWD/playwright.tgz"
8086
PLAYWRIGHT_CORE_TGZ="$PWD/playwright-core.tgz"
8187
PLAYWRIGHT_WEBKIT_TGZ="$PWD/playwright-webkit.tgz"
@@ -87,6 +93,8 @@ node ./packages/build_package.js playwright-webkit "${PLAYWRIGHT_WEBKIT_TGZ}"
8793
node ./packages/build_package.js playwright-firefox "${PLAYWRIGHT_FIREFOX_TGZ}"
8894
node ./packages/build_package.js playwright-chromium "${PLAYWRIGHT_CHROMIUM_TGZ}"
8995

96+
echo "==================== Publishing version ${VERSION} ================"
97+
9098
npm publish ${PLAYWRIGHT_TGZ} --tag="${NPM_PUBLISH_TAG}"
9199
npm publish ${PLAYWRIGHT_CORE_TGZ} --tag="${NPM_PUBLISH_TAG}"
92100
npm publish ${PLAYWRIGHT_WEBKIT_TGZ} --tag="${NPM_PUBLISH_TAG}"

0 commit comments

Comments
 (0)