Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zenoo/publish-npm-github-action
https://github.com/zenoo/publish-npm-github-action
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/zenoo/publish-npm-github-action
- Owner: Zenoo
- Created: 2021-06-27T16:46:13.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-04-22T18:11:47.000Z (over 1 year ago)
- Last Synced: 2024-05-28T19:41:53.623Z (7 months ago)
- Language: JavaScript
- Size: 1.38 MB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# Publish to NPM & Github action
Publish your package on NPM, Github or both, without much configuration.
## Optional inputs
## `publish-to-npm`
**Optional** Should your package be published to npm? Defaults to `true`
## `publish-to-github`
**Optional** Should your package be published to Github? Defaults to `true`
## `github-scope`
**Optional** Custom scope for the Github publication. Defaults to the repository owner
## `github-package-name`
**Optional** Custom package name for the Github publication. Defaults to your repository name
## Example usage
If you want to publish to NPM, you'll need to add a token to your repository's secrets.
See [npm's documentation](https://docs.npmjs.com/creating-and-viewing-access-tokens) 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.
```yml
name: Publish to NPM & Githubon:
push:
tags:
- 'v*.*.*'jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: zenoo/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
```OR
```yml
name: Publish to NPM & Githubon:
push:
tags:
- 'v*.*.*'jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: zenoo/[email protected]
with:
publish-to-npm: false
github-scope: 'customscope'
github-package-name: 'custompackagename'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
```