Skip to content

Commit

Permalink
cherry-pick(release-1.8): update publish script to work for @next (#5075
Browse files Browse the repository at this point in the history
)

Cherry-pick 0d0a6e8

Co-authored-by: Dmitry Gozman <[email protected]>
  • Loading branch information
aslushnikov and dgozman authored Jan 20, 2021
1 parent 320e8ce commit 0e216bc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish_canary_npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- uses: microsoft/playwright-github-action@v1
- run: npm ci
- run: npm run build
- run: node utils/build/update_canary_version.js
# publish_all_packages.sh updates the version automatically
- run: utils/publish_all_packages.sh --tip-of-tree
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
Expand Down
14 changes: 11 additions & 3 deletions utils/publish_all_packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,18 @@ fi

cd ..

NPM_PUBLISH_TAG="next"
VERSION=$(node -e 'console.log(require("./package.json").version)')

if [[ -n $(git status -s) ]]; then
echo "ERROR: git status is dirty; some uncommitted changes or untracked files"
exit 1
fi

NPM_PUBLISH_TAG="next"

if [[ $1 == "--tip-of-tree" ]]; then
node utils/build/update_canary_version.js
fi
VERSION=$(node -e 'console.log(require("./package.json").version)')

if [[ $1 == "--release" ]]; then
# Ensure package version does not contain dash.
if [[ "${VERSION}" == *-* ]]; then
Expand Down Expand Up @@ -76,6 +80,8 @@ else
exit 1
fi

echo "==================== Building version ${VERSION} ================"

PLAYWRIGHT_TGZ="$PWD/playwright.tgz"
PLAYWRIGHT_CORE_TGZ="$PWD/playwright-core.tgz"
PLAYWRIGHT_WEBKIT_TGZ="$PWD/playwright-webkit.tgz"
Expand All @@ -87,6 +93,8 @@ node ./packages/build_package.js playwright-webkit "${PLAYWRIGHT_WEBKIT_TGZ}"
node ./packages/build_package.js playwright-firefox "${PLAYWRIGHT_FIREFOX_TGZ}"
node ./packages/build_package.js playwright-chromium "${PLAYWRIGHT_CHROMIUM_TGZ}"

echo "==================== Publishing version ${VERSION} ================"

npm publish ${PLAYWRIGHT_TGZ} --tag="${NPM_PUBLISH_TAG}"
npm publish ${PLAYWRIGHT_CORE_TGZ} --tag="${NPM_PUBLISH_TAG}"
npm publish ${PLAYWRIGHT_WEBKIT_TGZ} --tag="${NPM_PUBLISH_TAG}"
Expand Down

0 comments on commit 0e216bc

Please sign in to comment.