Skip to content

Commit c3b6231

Browse files
committed
Set up automated npm publish
1 parent 15e01b6 commit c3b6231

File tree

4 files changed

+52
-8
lines changed

4 files changed

+52
-8
lines changed

.github/workflows/publish-on-tag.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: publish-on-tag
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v2
14+
- name: Set up Node.js
15+
uses: actions/setup-node@v3
16+
with:
17+
node-version-file: '.nvmrc'
18+
- name: Install dependencies
19+
run: npm install
20+
- name: Test
21+
run: npm test
22+
- name: Publish
23+
env:
24+
NPM_TOKEN: ${{secrets.NPM_TOKEN}}
25+
run: |
26+
npm config set registry 'https://wombat-dressing-room.appspot.com/'
27+
npm config set '//wombat-dressing-room.appspot.com/:_authToken' '${NPM_TOKEN}'
28+
npm publish

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
18

.travis.yml

Lines changed: 0 additions & 7 deletions
This file was deleted.

README.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# ES6 `String.prototype.codePointAt` polyfill [![Build status](https://travis-ci.org/mathiasbynens/String.prototype.codePointAt.svg?branch=master)](https://travis-ci.org/mathiasbynens/String.prototype.codePointAt)
1+
# ES6 `String.prototype.codePointAt` polyfill [![string.prototype.codepointat on npm](https://img.shields.io/npm/v/string.prototype.codepointat)](https://www.npmjs.com/package/string.prototype.codepointat)
22

33
A robust & optimized polyfill for [the `String.prototype.codePointAt` method in ECMAScript 6](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.codepointat).
44

@@ -42,6 +42,28 @@ In a browser:
4242

4343
[A polyfill + test suite for `String.fromCodePoint`](https://mths.be/fromcodepoint) is available, too.
4444

45+
## For maintainers
46+
47+
### How to publish a new release
48+
49+
1. On the `main` branch, bump the version number in `package.json`:
50+
51+
```sh
52+
npm version patch -m 'Release v%s'
53+
```
54+
55+
Instead of `patch`, use `minor` or `major` [as needed](https://semver.org/).
56+
57+
Note that this produces a Git commit + tag.
58+
59+
1. Push the release commit and tag:
60+
61+
```sh
62+
git push && git push --tags
63+
```
64+
65+
Our CI then automatically publishes the new release to npm.
66+
4567
## Author
4668

4769
| [![twitter/mathias](https://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") |

0 commit comments

Comments
 (0)