Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Oct 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions docs/development/releasing.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ Releasing is a 3-step process.

# 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:
- `git checkout master`
- `git checkout -b release-X.Y`
Expand Down Expand Up @@ -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.

# 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 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "playwright-internal",
"private": true,
"version": "1.5.0-post",
"version": "1.6.0-next",
"description": "A high-level API to automate web browsers",
"repository": "github:Microsoft/playwright",
"homepage": "https://playwright.dev",
Expand Down
9 changes: 3 additions & 6 deletions utils/update_version.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const USAGE = `

Examples:
${SCRIPT_NAME} v1.0.0
${SCRIPT_NAME} v1.0.0-post
${SCRIPT_NAME} v1.0.0-next
${SCRIPT_NAME} --next
`;

Expand All @@ -46,13 +46,10 @@ let version = process.argv[2];
if (version === '--next') {
const packageJSON = require('../package.json');
version = packageJSON.version;
const dashIndex = version.indexOf('-');
if (dashIndex !== -1)
version = version.substring(0, dashIndex);
version += '-next.' + Date.now();
version += '.' + Date.now();
console.log('Setting version to ' + version);
} 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.`);
process.exit(1);
}
Expand Down