devops: publish devrelease:npm to beta on release branches (#9949)

Co-authored-by: Andrey Lushnikov <aslushnikov@gmail.com>
This commit is contained in:
Max Schmitt 2021-11-02 01:29:56 +01:00 committed by GitHub
parent 13cc266b37
commit 96d611ed7d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 3 deletions

View file

@ -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 }}

View file

@ -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