Skip to content

Commit

Permalink
Set up automated npm publish
Browse files Browse the repository at this point in the history
  • Loading branch information
mathiasbynens committed May 3, 2023
1 parent 15e01b6 commit c3b6231
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 8 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/publish-on-tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: publish-on-tag

on:
push:
tags:
- '*'

jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
- name: Install dependencies
run: npm install
- 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
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18
7 changes: 0 additions & 7 deletions .travis.yml

This file was deleted.

24 changes: 23 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 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)
# 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)

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).

Expand Down Expand Up @@ -42,6 +42,28 @@ In a browser:

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

## 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") |
Expand Down

0 comments on commit c3b6231

Please sign in to comment.