-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
47 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | | ||
|