Publish your package on NPM, Github or both, without much configuration.
Optional Should your package be published to npm? Defaults to true
Optional Should your package be published to Github? Defaults to true
Optional Custom scope for the Github publication. Defaults to the repository owner
Optional Custom package name for the Github publication. Defaults to your repository name
If you want to publish to NPM, you'll need to add a token to your repository's secrets.
See npm's documentation to generate your token.
Add this token to your repository as a secret named NPM_TOKEN
.
Add a .github/workflows/publish.yml
file to your repository.
name: Publish to NPM & Github
on:
push:
tags:
- 'v*.*.*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: zenoo/publish-npm-github-action@v1.1.4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
OR
name: Publish to NPM & Github
on:
push:
tags:
- 'v*.*.*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: zenoo/publish-npm-github-action@v1.1.4
with:
publish-to-npm: false
github-scope: 'customscope'
github-package-name: 'custompackagename'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}