mirror of
https://github.com/joaquinjsb/gitea-release-please-action
synced 2026-05-13 07:41:39 +02:00
docs: document automating publication (#27)
This commit is contained in:
42
README.md
42
README.md
@@ -70,6 +70,48 @@ The most important prefixes you should have in mind are:
|
|||||||
* `feat!:`, or `fix!:`, `refactor!:`, etc., which represent a breaking change
|
* `feat!:`, or `fix!:`, `refactor!:`, etc., which represent a breaking change
|
||||||
(indicated by the `!`) and will result in a SemVer major.
|
(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
|
## License
|
||||||
|
|
||||||
Apache Version 2.0
|
Apache Version 2.0
|
||||||
|
|||||||
Reference in New Issue
Block a user