infra: bump to next version on trunk at a branch point (#4288)

This commit is contained in:
Pavel Feldman 2020-10-29 17:46:07 -07:00 committed by GitHub
parent 18c3efe79e
commit 333916a83d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 10 deletions

View File

@ -2,8 +2,6 @@ Releasing is a 3-step process.
# 1. Create a release branch # 1. Create a release branch
1. Bump a version to the new `-post` version and land a `chore: cut vX.Y.Z-post version` commit
- `./utils/update_version.js vX.Y.Z-post`
1. On your local machine, create a new branch `release-X.Y` based off the "cutting" commit and land a `chore: mark vX.Y.Z` in the local branch: 1. On your local machine, create a new branch `release-X.Y` based off the "cutting" commit and land a `chore: mark vX.Y.Z` in the local branch:
- `git checkout master` - `git checkout master`
- `git checkout -b release-X.Y` - `git checkout -b release-X.Y`
@ -32,3 +30,7 @@ Once release branch is pushed, it's last commit will be picked up by our CI/CD:
Once release is published, the [`publish_release`](../../.github/workflows/publish_release.yml) will kick in and publish package version on NPM. Once release is published, the [`publish_release`](../../.github/workflows/publish_release.yml) will kick in and publish package version on NPM.
# 4. Bump version on trunk to next
1. Bump a version to the new `-next` version and land a `chore: cut vX.Y.Z-post version` commit on trunk
- `./utils/update_version.js vX.Y.Z-next`

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{ {
"name": "playwright-internal", "name": "playwright-internal",
"version": "1.5.0-post", "version": "1.6.0-next",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {

View File

@ -1,7 +1,7 @@
{ {
"name": "playwright-internal", "name": "playwright-internal",
"private": true, "private": true,
"version": "1.5.0-post", "version": "1.6.0-next",
"description": "A high-level API to automate web browsers", "description": "A high-level API to automate web browsers",
"repository": "github:Microsoft/playwright", "repository": "github:Microsoft/playwright",
"homepage": "https://playwright.dev", "homepage": "https://playwright.dev",

View File

@ -28,7 +28,7 @@ const USAGE = `
Examples: Examples:
${SCRIPT_NAME} v1.0.0 ${SCRIPT_NAME} v1.0.0
${SCRIPT_NAME} v1.0.0-post ${SCRIPT_NAME} v1.0.0-next
${SCRIPT_NAME} --next ${SCRIPT_NAME} --next
`; `;
@ -46,13 +46,10 @@ let version = process.argv[2];
if (version === '--next') { if (version === '--next') {
const packageJSON = require('../package.json'); const packageJSON = require('../package.json');
version = packageJSON.version; version = packageJSON.version;
const dashIndex = version.indexOf('-'); version += '.' + Date.now();
if (dashIndex !== -1)
version = version.substring(0, dashIndex);
version += '-next.' + Date.now();
console.log('Setting version to ' + version); console.log('Setting version to ' + version);
} else { } else {
if (!version || !version.match(/^v\d+\.\d+\.\d+(-post)?$/)) { if (!version || !version.match(/^v\d+\.\d+\.\d+(-next)?$/)) {
console.error(`Malformed version "${version}". Use --help for details.`); console.error(`Malformed version "${version}". Use --help for details.`);
process.exit(1); process.exit(1);
} }