https://github.com/tool3/publisher
a simple github-action to publish to npm and github registries
https://github.com/tool3/publisher
Last synced: about 2 months ago
JSON representation
a simple github-action to publish to npm and github registries
- Host: GitHub
- URL: https://github.com/tool3/publisher
- Owner: tool3
- License: mit
- Created: 2020-03-08T12:11:24.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-08-30T08:31:03.000Z (almost 4 years ago)
- Last Synced: 2026-04-17T14:05:18.200Z (2 months ago)
- Language: JavaScript
- Homepage:
- Size: 854 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Publisher
github action for simple npm and github packages publish
# Create an action from this template
Click the `Use this Template` and provide the new repo details for your action
# Usage
using `publisher` is easy, all you do is add the relevant publish step in your action, or set it up as a standalone action.
an example step would be:
```yaml
- uses: tool3/publisher@v1
with:
npm_token: ${{ secrets.NPM_TOKEN }}
github_token: ${{ secrets.GP_TOKEN }}
scope: "@tool3"
```
# Scoped packages
whether you provide a `scope` input or not, `publisher` will check if your `package.json` file has a scope, and will use that as the publish scope.
# Options
* `github_token`
**required**
Github access token
* `npm_token`
**required**
npm private token
* `scope`
user scope for package
# Example
example of an automated release workflow.
this workflow will:
* bump patch version (or minor\major if provided in commit msg. see [`bump`](https://github.com/tool3/bump))
* publish to `npm`
* publish to `gpr`
```yaml
name: release
on:
push:
branches:
- release
jobs:
tag:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: tool3/bump@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
unrelated: true
publisher:
needs: tag
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: tool3/publisher@v1
with:
npm_token: ${{ secrets.NPM_TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}
scope: "@tool3"
```