Skip to content

Commit

Permalink
docs: update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudcome committed Mar 19, 2023
1 parent cddb2d7 commit 9d4335a
Showing 1 changed file with 47 additions and 1 deletion.
48 changes: 47 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,48 @@
# publish-node-package-action
Publish a NodeJS package to NPM or GitHub Packages

![release](https://img.shields.io/github/v/release/cloudcome/publish-node-package-action)
![license](https://img.shields.io/github/license/cloudcome/publish-node-package-action)

Publish a NodeJS package to NPM Repository or GitHub Packages

# Publish to NPM Repository
```yaml
jobs:
publish-npm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: npm ci
- run: npm run build
- uses: cloudcome/publish-node-package-action@v1
with:
target: npm
token: ${{ secrets.NPM_TOKEN }}
```
# Publish to GitHub Packages
**Requires GitHub Packages write access**
```yaml
jobs:
publish-github:
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- uses: actions/checkout@v3
- run: npm ci
- run: npm run build
- uses: cloudcome/publish-node-package-action@v1
with:
target: github
```
# Inputs
| Name | Required | Default | Description |
|----------|----------|----------|------------------------------------------------------------------------------------------------------------------------|
| `target` | true | None | Release target, optionally npm/github |
| `token` | false | None | Target authorization token, GitHub Packages target does not need, internally has automatically obtained `github.token` |
| `tag` | false | `latest` | The version label to release, the default is latest |

0 comments on commit 9d4335a

Please sign in to comment.