Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/christophwurst/conventional-nextcloud-npm-release
Github action to release @nextcloud/* npm package using conventional commits
https://github.com/christophwurst/conventional-nextcloud-npm-release
Last synced: about 1 month ago
JSON representation
Github action to release @nextcloud/* npm package using conventional commits
- Host: GitHub
- URL: https://github.com/christophwurst/conventional-nextcloud-npm-release
- Owner: ChristophWurst
- License: mit
- Created: 2022-12-28T10:46:02.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-12-11T17:28:13.000Z (about 1 year ago)
- Last Synced: 2024-11-17T20:46:31.779Z (2 months ago)
- Size: 7.81 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Release npm package using conventional commits
Release npm package to Github and the npm registry using conventional commits.
The action performs the following steps:
1) Check out the code
2) Figure out what type of release is do, if any
3) Generate a CHANGELOG
4) Bump the version, commit the changes, tag and push to Github
5) Create a Github release using the tag and the changelog information
6) Build the package
7) Publish to the npm package registry## Inputs
* **Required** ``github-token``: Personal access token for GitHub with the ``public_repo`` scope.
* **Required** ``npm-token``: Granular access token for npmjs.org with read and write permissions for the package to release.## Usage
### Personal GitHub repository
1) Generate the GitHub auth token and store it as a new repository secret ``RELEASE_PAT``
2) Generate the npm auth token and store it as new repository secret ``NPM_TOKEN``
3) Create ``.github/workflows/release.yml`` with the contents below```yaml
name: Release
on: workflow_dispatchjobs:
npm-registry:
name: Npm registry
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: ChristophWurst/[email protected]
with:
github-token: ${{ secrets.RELEASE_PAT }}
npm-token: ${{ secrets.NPM_TOKEN }}
```Releases are triggered manually or on a cron schedule. Adjust `on` for the trigger.
### @nextcloud GitHub repository
Repositories in the [@nextcloud](https://github.com/nextcloud) organization have to use environments to protect repository secrets.
1) Create a GitHub environment "npm release"
1) Enable reviewers and pick the maintainers of the repository
2) Generate the GitHub auth token and store it as a new environment secret ``RELEASE_PAT``
3) Generate the npm auth token and store it as new environment secret ``NPM_TOKEN``
2) Create ``.github/workflows/release.yml`` with the contents below```yaml
name: Release
on: workflow_dispatchjobs:
npm-registry:
name: Npm registry
permissions:
contents: write
environment: npm registry
runs-on: ubuntu-latest
steps:
- uses: ChristophWurst/[email protected]
with:
github-token: ${{ secrets.RELEASE_PAT }}
npm-token: ${{ secrets.NPM_TOKEN }}
```Releases are triggered manually and need an approval from the maintainers.