From ca8e17a0aab0610c87368c78f3540ee60f1055e0 Mon Sep 17 00:00:00 2001 From: Mathias Bynens Date: Tue, 14 Sep 2021 12:20:37 +0200 Subject: [PATCH] Set up automated `npm publish` --- .github/workflows/publish-on-tag.yml | 26 ++++++++++++++++++++++++++ README.md | 24 +++++++++++++++++++++++- 2 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/publish-on-tag.yml diff --git a/.github/workflows/publish-on-tag.yml b/.github/workflows/publish-on-tag.yml new file mode 100644 index 0000000..9e8347d --- /dev/null +++ b/.github/workflows/publish-on-tag.yml @@ -0,0 +1,26 @@ +name: publish-on-tag + +on: + push: + tags: + - '*' + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Install dependencies + run: npm install + - name: Build + run: npm run build + - name: Test + run: npm test + - name: Publish + env: + NPM_TOKEN: ${{secrets.NPM_TOKEN}} + run: | + npm config set registry 'https://wombat-dressing-room.appspot.com/' + npm config set '//wombat-dressing-room.appspot.com/:_authToken' '${NPM_TOKEN}' + npm publish diff --git a/README.md b/README.md index 5677e43..6dd4fb4 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# regenerate-unicode-properties [![Build status](https://travis-ci.org/mathiasbynens/regenerate-unicode-properties.svg?branch=master)](https://travis-ci.org/mathiasbynens/regenerate-unicode-properties) +# regenerate-unicode-properties [![Build status](https://travis-ci.org/mathiasbynens/regenerate-unicode-properties.svg?branch=main)](https://travis-ci.org/mathiasbynens/regenerate-unicode-properties) [![regenerate-unicode-properties on npm](https://img.shields.io/npm/v/regenerate-unicode-properties)](https://www.npmjs.com/package/regenerate-unicode-properties) _regenerate-unicode-properties_ is a collection of [Regenerate](https://github.com/mathiasbynens/regenerate) sets for [various Unicode properties](https://github.com/tc39/proposal-regexp-unicode-property-escapes). @@ -32,6 +32,28 @@ To get the Unicode version the data was based on: const unicodeVersion = require('regenerate-unicode-properties/unicode-version.js'); ``` +## For maintainers + +### How to publish a new release + +1. On the `main` branch, bump the version number in `package.json`: + + ```sh + npm version patch -m 'Release v%s' + ``` + + Instead of `patch`, use `minor` or `major` [as needed](https://semver.org/). + + Note that this produces a Git commit + tag. + +1. Push the release commit and tag: + + ```sh + git push && git push --tags + ``` + + Our CI then automatically publishes the new release to npm. + ## Author | [![twitter/mathias](https://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") |