From 7bccf7e9f64a06d103dba5b21e57bcf655cbcc15 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Tue, 2 Nov 2021 17:36:57 +0200 Subject: [PATCH] simplify release process (#7727) --- RELEASE.md | 37 +++++++++++++++++-------------------- build/publish.sh | 36 ------------------------------------ package.json | 7 ++++--- 3 files changed, 21 insertions(+), 59 deletions(-) delete mode 100755 build/publish.sh diff --git a/RELEASE.md b/RELEASE.md index bd366d0271b..28f3401a24c 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -1,28 +1,25 @@ -Documentation for the release process of Leaflet. +## Releasing a new version of Leaflet -**Please note that you will need to have a git remote called `origin` that points to Leaflet's GitHub repo, since the publish script assumes it** -- [ ] Make a new release branch (for example named `prepare-X.Y.Z`) -- [ ] Make sure you do not have any `package.lock.json` or `yarn.lock` locally, since they can potentially make you build with the wrong package versions -- [ ] Update [the changelog](https://github.com/Leaflet/Leaflet/blob/master/CHANGELOG.md) since last release and commit to the release branch -- [ ] Write a blog post about the new release and put in `/docs/_posts` and commit to the release branch -- [ ] Bump version number in `package.json` and commit to `master` -- [ ] Run `npm run release` +- [ ] Update [the changelog](https://github.com/Leaflet/Leaflet/blob/master/CHANGELOG.md) since last release and commit +- [ ] Run `npm version ` +- [ ] Run `npm publish` - [ ] Verify that the release was correctly published to NPM by checking: - [ ] [Leaflet NPM package page](https://www.npmjs.com/package/leaflet) - [ ] files on [Leaflet unpkg page](https://unpkg.com/leaflet@latest/) +- [ ] Make a new release on [Leaflet's GitHub release page](https://github.com/Leaflet/Leaflet/releases/) with the most important parts of the changelog + +### Updating docs after the release + +- [ ] Make a new branch for the update +- [ ] Write a blog post about the new release and put in `/docs/_posts` - [ ] Update API docs: - [ ] run `npm run docs` - [ ] Copy the built docs from `dist/reference-X.Y.Z.html` to `docs/reference-X.Y.Z.html`, remove content before first and after second "CUT HERE" comment - [ ] Insert YAML front matter, see old `docs/reference-X.Y.Z.html` for reference - - [ ] Commit the new docs to the release branch -- [ ] Update `docs/reference.html` to redirect to the new version and commit the change to the release branch -- [ ] Update integrity hashes: - - [ ] Checkout the release tag (`git checkout vX.Y.Z`) - - [ ] Run `npm run integrity` or simply `node ./build/integrity.js` if you're not on Debian - - [ ] Copy the hashes and update `integrity_hash_css`, `integrity_hash_source` and `integrity_hash_uglified` in `docs/_config.yml`; commit changes to the release branch -- [ ] Update link to latest release in `docs/download.html`, and commit to the release branch -- [ ] Add link to new version reference in `docs/reference-versions.html`, and commit to the release branch -- [ ] Update `latest_leaflet_version` (and possibly `latest_leaflet_reference`) in `docs/_config.yml` and commit to the release branch -- [ ] Update the announcement section in `docs/index.html` and commit to the release branch -- [ ] If it looks like everything is good at this point, merge the release branch into `master` -- [ ] Make a new release on [Leaflet's GitHub release page](https://github.com/Leaflet/Leaflet/releases/) with the most important parts of the changelog +- [ ] Update `docs/reference.html` to redirect to the new version +- [ ] Run `npm run integrity` and make sure `docs/_config.yml` is updated with new hashes +- [ ] Update link to latest release in `docs/download.md` +- [ ] Add link to new version reference in `docs/reference-versions.html` +- [ ] Update `latest_leaflet_version` (and possibly `latest_leaflet_reference`) in `docs/_config.yml` +- [ ] Update the announcement section in `docs/index.html` +- [ ] Commit all the changes and submit a PR for someone to review diff --git a/build/publish.sh b/build/publish.sh deleted file mode 100755 index 31b9876c453..00000000000 --- a/build/publish.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash - -npm update - -VERSION=$(node --eval "console.log(require('./package.json').version);") - -npm test || exit 1 - -echo "Ready to publish Leaflet version $VERSION." -echo "Has the version number been bumped?" -read -n1 -r -p "Press Ctrl+C to cancel, or any other key to continue." key - -git checkout -b build - -export NODE_ENV=release - -npm run-script build - -echo "Creating git tag v$VERSION..." - -git add dist/leaflet-src.js dist/leaflet.js dist/leaflet-src.esm.js dist/leaflet-src.js.map dist/leaflet.js.map dist/leaflet-src.esm.js.map -f - -git commit -m "v$VERSION" - -git tag v$VERSION -f -git push --tags -f - -echo "Uploading to NPM..." - -npm publish - -git checkout master -git branch -D build - -echo "All done." -echo "Remember to run 'npm run-script integrity' and then commit the changes to the master branch, in order to update the website." diff --git a/package.json b/package.json index 01bbe8f3b2c..bd59187db5d 100644 --- a/package.json +++ b/package.json @@ -33,19 +33,20 @@ "files": [ "dist", "src", - "!dist/leaflet.zip" + "!dist/leaflet.zip", + "!*.leafdoc" ], "scripts": { "docs": "node ./build/docs.js", "test": "karma start ./spec/karma.conf.js", "build": "npm run rollup && npm run uglify", - "release": "./build/publish.sh", "lint": "eslint src spec/suites docs/docs/js build", "lintfix": "npm run lint -- --fix", "rollup": "rollup -c build/rollup-config.js", "watch": "rollup -w -c build/rollup-watch-config.js", "uglify": "uglifyjs dist/leaflet-src.js -c -m -o dist/leaflet.js --source-map filename=dist/leaflet.js.map --source-map content=dist/leaflet-src.js.map --source-map url=leaflet.js.map --comments", - "integrity": "node ./build/integrity.js" + "integrity": "node ./build/integrity.js", + "prepublishOnly": "npm ci && npm run lint && npm run test && NODE_ENV=release npm run build" }, "eslintConfig": { "root": true,