chore: update release guide and helper script (#1521)
This commit is contained in:
parent
ef9e04d399
commit
6ee7852f0f
|
|
@ -4,9 +4,9 @@
|
||||||
1. Version starts with "v", e.g. "vX.Y.Z".
|
1. Version starts with "v", e.g. "vX.Y.Z".
|
||||||
1. Fill "Raw notes".
|
1. Fill "Raw notes".
|
||||||
- `git fetch --tags upstream`
|
- `git fetch --tags upstream`
|
||||||
- `git log --pretty="%h - %s" v0.11.1..HEAD`
|
- `git log --pretty="%h - %s" $(git describe --tags --abbrev=0)..HEAD`
|
||||||
1. Fill "Bug fixes".
|
1. Fill "Bug fixes".
|
||||||
- `git log v0.11.1..HEAD`
|
- `git log $(git describe --tags --abbrev=0)..HEAD`
|
||||||
- Manually look for `#1234` references in commit messages.
|
- Manually look for `#1234` references in commit messages.
|
||||||
1. Fill "Current status".
|
1. Fill "Current status".
|
||||||
- `node utils/print_versions.js`
|
- `node utils/print_versions.js`
|
||||||
|
|
@ -14,9 +14,9 @@
|
||||||
1. Fill "Highlights" if any.
|
1. Fill "Highlights" if any.
|
||||||
- Be creative.
|
- Be creative.
|
||||||
1. Fill "Breaking API Changes" if any.
|
1. Fill "Breaking API Changes" if any.
|
||||||
- `git diff v0.11.1:docs/api.md docs/api.md`
|
- `git diff $(git describe --tags --abbrev=0):docs/api.md docs/api.md`
|
||||||
1. Fill "New APIs" if any.
|
1. Fill "New APIs" if any.
|
||||||
- `git diff v0.11.1:docs/api.md docs/api.md`
|
- `git diff $(git describe --tags --abbrev=0):docs/api.md docs/api.md`
|
||||||
1. When making links to the API, copy actual links from [GitHub](https://github.com/microsoft/playwright/blob/master/docs/api.md), and not from `api.md` source - these might be incorrect.
|
1. When making links to the API, copy actual links from [GitHub](https://github.com/microsoft/playwright/blob/master/docs/api.md), and not from `api.md` source - these might be incorrect.
|
||||||
- Before publishing, replace `blob/master/docs` with `blob/vX.Y.Z/docs` in all the links.
|
- Before publishing, replace `blob/master/docs` with `blob/vX.Y.Z/docs` in all the links.
|
||||||
1. Use "Save Draft", not "Publish".
|
1. Use "Save Draft", not "Publish".
|
||||||
|
|
@ -26,8 +26,7 @@
|
||||||
1. Announce `PSA: release vX.Y.Z in progress. Please do not commit anything.`
|
1. Announce `PSA: release vX.Y.Z in progress. Please do not commit anything.`
|
||||||
- **Important**: no other commits should land in-between release commit and bump commit.
|
- **Important**: no other commits should land in-between release commit and bump commit.
|
||||||
1. Mark a new version.
|
1. Mark a new version.
|
||||||
- Bump `package.json` version to `vX.Y.Z`.
|
- `node utils/update_version.js vX.Y.Z && npm run doc`.
|
||||||
- `node utils/sync_package_versions.js && npm run doc`.
|
|
||||||
- Send a PR titled `chore: mark version vX.Y.Z`.
|
- Send a PR titled `chore: mark version vX.Y.Z`.
|
||||||
- Make sure the PR passes all required checks and merge it.
|
- Make sure the PR passes all required checks and merge it.
|
||||||
1. Publish to npm.
|
1. Publish to npm.
|
||||||
|
|
@ -35,7 +34,6 @@
|
||||||
- `utils/publish_all_packages.sh --release`
|
- `utils/publish_all_packages.sh --release`
|
||||||
1. Click 'Publish release' button on the prepared release notes.
|
1. Click 'Publish release' button on the prepared release notes.
|
||||||
1. Mark post release.
|
1. Mark post release.
|
||||||
- Bump `package.json` version to `vX.Y.Z-post`.
|
- `node utils/update_version.js vX.Y.Z-post && npm run doc`.
|
||||||
- `node utils/sync_package_versions.js && npm run doc`.
|
|
||||||
- Merge a PR titled `chore: bump version to vX.Y.Z-post`.
|
- Merge a PR titled `chore: bump version to vX.Y.Z-post`.
|
||||||
1. Announce `PSA: release vX.Y.Z is out.`
|
1. Announce `PSA: release vX.Y.Z is out.`
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,6 @@
|
||||||
"prepare": "node install-from-github.js",
|
"prepare": "node install-from-github.js",
|
||||||
"build": "node utils/runWebpack.js --mode='development' && tsc -p .",
|
"build": "node utils/runWebpack.js --mode='development' && tsc -p .",
|
||||||
"watch": "node utils/runWebpack.js --mode='development' --watch --silent | tsc -w -p .",
|
"watch": "node utils/runWebpack.js --mode='development' --watch --silent | tsc -w -p .",
|
||||||
"version": "node utils/sync_package_versions.js && npm run doc",
|
|
||||||
"test-types": "npm run generate-types && npx -p typescript@3.7.5 tsc -p utils/generate_types/test/tsconfig.json",
|
"test-types": "npm run generate-types && npx -p typescript@3.7.5 tsc -p utils/generate_types/test/tsconfig.json",
|
||||||
"generate-types": "node utils/generate_types/"
|
"generate-types": "node utils/generate_types/"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -13,19 +13,32 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const {version} = require('../package.json');
|
let version = process.argv[2];
|
||||||
|
|
||||||
|
if (!version || !version.match(/^v\d+\.\d+\.\d+(-post)?$/)) {
|
||||||
|
console.error(`Malformed version "${version}"`);
|
||||||
|
console.error(`Correct examples:`);
|
||||||
|
console.error(` update_version.js v1.0.0`);
|
||||||
|
console.error(` update_version.js v1.0.0-post`);
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
version = version.substring(1);
|
||||||
|
updatePackage(path.join(__dirname, '..', 'package.json'), packageJSON => {
|
||||||
|
packageJSON.version = version;
|
||||||
|
});
|
||||||
|
|
||||||
for (const packageName of ['playwright-chromium', 'playwright-firefox', 'playwright-webkit', 'playwright']) {
|
for (const packageName of ['playwright-chromium', 'playwright-firefox', 'playwright-webkit', 'playwright']) {
|
||||||
updatePackage(packageName, packageJSON => {
|
updatePackage(path.join(__dirname, '..', 'packages', packageName, 'package.json'), packageJSON => {
|
||||||
packageJSON.version = version;
|
packageJSON.version = version;
|
||||||
packageJSON.dependencies['playwright-core'] = `=${version}`;
|
packageJSON.dependencies['playwright-core'] = `=${version}`;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function updatePackage(packageName, transform) {
|
function updatePackage(packageJSONPath, transform) {
|
||||||
const packageJSONPath = path.join(__dirname, '..', 'packages', packageName, 'package.json');
|
|
||||||
console.log(`Updating ${packageJSONPath} to ${version}.`);
|
console.log(`Updating ${packageJSONPath} to ${version}.`);
|
||||||
const packageJSON = JSON.parse(fs.readFileSync(packageJSONPath));
|
const packageJSON = JSON.parse(fs.readFileSync(packageJSONPath));
|
||||||
transform(packageJSON);
|
transform(packageJSON);
|
||||||
Loading…
Reference in a new issue