1
0
mirror of https://github.com/joaquinjsb/gitea-release-please-action synced 2026-05-09 13:11:15 +02:00

docs: document automating publication (#27)

This commit is contained in:
Benjamin E. Coe
2020-05-20 22:01:53 -07:00
committed by GitHub
parent e2f52f0d16
commit 3815b6b90a

View File

@@ -70,6 +70,48 @@ The most important prefixes you should have in mind are:
* `feat!:`, or `fix!:`, `refactor!:`, etc., which represent a breaking change
(indicated by the `!`) and will result in a SemVer major.
## Automating publication to npm
With a few additions, the Release Please action can be made to publish to
npm when a Release PR is merged:
```yaml
on:
push:
branches:
- master
name: release-please
jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: bcoe/release-please-action@v1.2.1
id: release
with:
token: ${{ secrets.GITHUB_TOKEN }}
release-type: node
package-name: test-release-please
# The logic below handles the npm publication:
- uses: actions/checkout@v2
# these if statements ensure that a publication only occurs when
# a new release is created:
if: ${{ steps.release.outputs.release_created }}
- uses: actions/setup-node@v1
with:
node-version: 12
registry-url: 'https://registry.npmjs.org'
if: ${{ steps.release.outputs.release_created }}
- run: npm ci
if: ${{ steps.release.outputs.release_created }}
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
if: ${{ steps.release.outputs.release_created }}
```
> So that you can keep 2FA enabled for npm publications, we recommend setting
`registry-url` to your own [Wombat Dressing Room](https://github.com/GoogleCloudPlatform/wombat-dressing-room) deployment.
## License
Apache Version 2.0