From bbc5f65479ac1acebf86f1ce4eb06f7ac451a9ca Mon Sep 17 00:00:00 2001 From: Teddy Katz Date: Fri, 18 Oct 2019 17:28:23 -0400 Subject: [PATCH] Add release instructions (#223) * Added CircleCI for building and linting (#222) * Fix indentation * Fix deploy script for local running * Add release instructions * Add pushing-to-github instructions --- scripts/deploy/deploy_docs.sh | 4 +--- src/README.md | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/scripts/deploy/deploy_docs.sh b/scripts/deploy/deploy_docs.sh index 9830c64a..2d1fa1f9 100755 --- a/scripts/deploy/deploy_docs.sh +++ b/scripts/deploy/deploy_docs.sh @@ -3,8 +3,6 @@ set -e REPO=`git config remote.origin.url` -SSH_REPO=${REPO/https:\/\/github.com\//git@github.com:} - rm -rf doc/ || true git clone $REPO --branch gh-pages --single-branch --depth 1 doc scripts/build_docs.sh @@ -13,4 +11,4 @@ cd doc/ git add -A git commit -m "Docs for v$(npm info .. version)" -git push $SSH_REPO $TARGET_BRANCH +git push origin gh-pages diff --git a/src/README.md b/src/README.md index 40803553..5ef2cf6c 100644 --- a/src/README.md +++ b/src/README.md @@ -121,3 +121,19 @@ Most content constructors (`Comment`, `Submission`, etc.) are subclasses of the `RedditContent` instances carry shortcut functions such as `_get`, `_post`, etc. These do the same thing as the corresponding functions on the snoowrap prototype. `RedditContent` objects also have a `_fetch` property. This starts out as `null` when the object is created, and gets set to a Promise and returned when `fetch()` is called for the first time. All subsequent calls to `fetch()` return the same Promise. This ensures that no objects get fetched more than once (unless it is explicitly re-fetched using `refresh()`). + +## Releases + +To do a release: + +1. Decide on the version number of the new release, based on the changes since the last release. +1. Prepare the package for the release: + * Update the `version` field in `package.json` + * Update the `VERSION` constant in `src/constants.js` + * Add a new entry to `CHANGELOG.md` describing the release + * Run `npm run bundle-size` and update `README.md` with the new size of `snoowrap-v1.min.js` in the "Browsers" section, if needed. (This doesn't need to be kept up to date every release, but running it once in a while is nice to make sure the advertised size isn't wildly off.) +1. Consider running `npm test`, or making sure the latest build on master is passing. +1. Run `npm publish` to publish the package to npm. +1. Push the released to GitHub (`git commit` followed by `git push`) +1. Create a tag for the release (e.g. `git tag v1.20.0`) and push the tag to GitHub (`git push --tag`) +1. To update the docs website and the browser build, run `scripts/deploy/deploy_docs.sh`. Note that this script will create a git commit and push it to GitHub.