Skip to content

Simplify RELEASE.md with npm version #298

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

Merged
merged 1 commit into from
Mar 5, 2021
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
18 changes: 0 additions & 18 deletions .bumpversion.cfg

This file was deleted.

1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tag-version-prefix=
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

npm version's default is to use the v prefix on tags, but since we haven't been doing that (I don't happen like it, personally), this config lets us stay consistent.

43 changes: 18 additions & 25 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,69 +13,62 @@ meet the prerequisites:

- To have push rights to the [configurable-http-proxy GitHub
repository](https://github.com/jupyterhub/configurable-http-proxy).
- To have [`bump2version`](https://github.com/c4urself/bump2version) installed
(`pip install bump2version`).
- To have [Node.js](https://nodejs.org) installed.

## Steps to make a release

1. Update [CHANGELOG.md](CHANGELOG.md) if it is not up to date, and verify
[README.md](README.md) has an updated output of running `--help`. Make a PR
to review the CHANGELOG notes.

1. Once the changelog is up to date, checkout main and make sure it is up to
1. Once the changelog is up to date, checkout the main branch and make sure it is up to
date and clean.

```bash
ORIGIN=${ORIGIN:-origin} # set to the canonical remote, e.g. 'upstream' if 'origin' is not the official repo
git checkout main
git fetch $ORIGIN main
git reset --hard $ORIGIN/main
# WARNING! This next command deletes any untracked files in the repo
git clean -xfd
git branch --set-upstream-to=$ORIGIN/main main
git pull
```

1. Update the version with `bump2version` to not include the -dev suffix and let
it make a git commit and tag as well for us.
1. Update the version with [`npm version`](https://docs.npmjs.com/cli/v6/commands/npm-version)
and let it make a git commit and tag as well for us.

```bash
# optionally first bump a minor or major version, but
# don't bump the patch version, that's already done.
# bump2version --no-commit minor
# bump2version --no-commit major
bump2version --tag release
# specify the new version here,
# which should already have been chosen when updating the changelog.
npm version 1.2.3
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This in particular, explicitly stating the new version, means we can't publish the wrong thing, whereas bump2version --tag release assumes the prior state was correct for the next released version.

Copy link
Member

@consideRatio consideRatio Mar 5, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've come to appreciate that ;) (EDIT: explicitly stating version, less complexity)


# verify changes
git diff HEAD~1
```

1. Reset the version to the next development version with `bump2version`.
1. Reset the version to the next development version with `npm version`,
without creating a tag:

```bash
bump2version --no-tag patch
npm version --no-git-tag-version prerelease --preid=dev
git commit -am "back to dev"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It still boggles my mind that npm version doesn't have a 'commit but don't tag' option


# verify changes
git diff HEAD~1
```

1. Push your release related commits to main along with the annotated tags
referencing commits on the main branch.
1. Push your new tag and commits to GitHub.

```
```bash
git push --follow-tags $ORIGIN main
```

1. Visit [GitHub: create new
release](https://github.com/jupyterhub/configurable-http-proxy/releases/new)
and reference your tag.

This will trigger a workflow to publish the NPM package.

1. Verify [the automated
workflow](https://github.com/jupyterhub/configurable-http-proxy/actions?query=workflow%3A%22Publish+to+npm%22)
succeeded.

## Manual release to npm

A manual release should not generally be required,
but might be needed in the event of a problem in the automated publishing workflow.

1. Verify you are a collaborator of the [npmjs
project](https://www.npmjs.com/package/configurable-http-proxy).

Expand Down
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,5 +1,5 @@
{
"version": "4.3.2-dev",
"version": "4.3.2-dev.0",
"name": "configurable-http-proxy",
"description": "A configurable-on-the-fly HTTP Proxy",
"author": "Jupyter Developers",
Expand Down