From 96d611ed7daca42cfedb548dda23e16de5f8269f Mon Sep 17 00:00:00 2001 From: Max Schmitt Date: Tue, 2 Nov 2021 01:29:56 +0100 Subject: [PATCH] devops: publish devrelease:npm to beta on release branches (#9949) Co-authored-by: Andrey Lushnikov --- .github/workflows/publish_canary_npm.yml | 13 ++++++++++--- utils/publish_all_packages.sh | 9 +++++++++ 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish_canary_npm.yml b/.github/workflows/publish_canary_npm.yml index a79d98d810..ed05ad7abf 100644 --- a/.github/workflows/publish_canary_npm.yml +++ b/.github/workflows/publish_canary_npm.yml @@ -23,11 +23,18 @@ jobs: - run: npm ci - run: npm run build - run: npx playwright install-deps - - run: node utils/build/update_canary_version.js --today-date + - name: Publish to NPM (@next) if: contains(github.ref, 'master') && github.event_name != 'workflow_dispatch' - - run: node utils/build/update_canary_version.js --commit-timestamp + run: | + node utils/build/update_canary_version.js --today-date + utils/publish_all_packages.sh --tip-of-tree + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + - name: Publish to NPM (@beta) if: contains(github.ref, 'release') || github.event_name == 'workflow_dispatch' - - run: utils/publish_all_packages.sh --tip-of-tree + run: | + node utils/build/update_canary_version.js --commit-timestamp + utils/publish_all_packages.sh --beta env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/utils/publish_all_packages.sh b/utils/publish_all_packages.sh index 412c2dfb18..cc8fd4f96c 100755 --- a/utils/publish_all_packages.sh +++ b/utils/publish_all_packages.sh @@ -21,6 +21,7 @@ if [[ $1 == "--help" ]]; then echo echo "--release publish @latest version of all packages" echo "--tip-of-tree publish @next version of all packages" + echo "--beta publish @beta version of all packages" exit 1 fi @@ -71,6 +72,14 @@ elif [[ $1 == "--tip-of-tree" ]]; then exit 0 fi NPM_PUBLISH_TAG="next" +elif [[ $1 == "--beta" ]]; then + # Ensure package version contains dash. + if [[ "${VERSION}" != *-* ]]; then + echo "ERROR: cannot publish release version with --beta flag" + exit 1 + fi + + NPM_PUBLISH_TAG="beta" else echo "unknown argument - '$1'" exit 1