Skip to content

Commit

Permalink
Publish to NPM via GitHub Actions
Browse files Browse the repository at this point in the history
Rm dry-run

Add cache and change Node version to 14

Update the readme
  • Loading branch information
katspaugh committed Mar 8, 2021
1 parent 48e89e4 commit 9070ef7
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 3 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: NPM Package

on:
push:
branches: [ release ]

jobs:
publish-npm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14
registry-url: https://registry.npmjs.org/
- name: Cache Node.js modules
uses: actions/cache@v2
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-node-
${{ runner.OS }}-
- run: npm install
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,16 @@ If you want to use [the VS Code - Debugger for Chrome](https://github.com/Micros
## Editing documentation
The homepage and documentation files are maintained in the [`gh-pages` branch](https://github.com/katspaugh/wavesurfer.js/tree/gh-pages). Contributions to the documentation are especially welcome.

## Updating the NPM package
When preparing a new release, update the version in the `package.json` and have it merged to master. Also don't forget to update the changelog.

Once the updated version is on master, create a pull request to the protected `release` branch. When it's merged (please use the rebase option on GitHub), a new version of the package will be published to NPM.

## Credits

Initial idea by [Alex Khokhulin](https://github.com/xoxulin). Many
thanks to
[the awesome contributors](https://github.com/katspaugh/wavesurfer.js/contributors)!
The main maintainer: <img src="https://avatars.githubusercontent.com/u/305679" width="16" height="16" /> [Thijs Triemstra](https://github.com/thijstriemstra)

Many thanks to [all the awesome contributors](https://github.com/katspaugh/wavesurfer.js/contributors)!

## License

Expand Down

0 comments on commit 9070ef7

Please sign in to comment.