Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mikeal/merge-release
Automatically release all merges to master on npm.
https://github.com/mikeal/merge-release
Last synced: 15 days ago
JSON representation
Automatically release all merges to master on npm.
- Host: GitHub
- URL: https://github.com/mikeal/merge-release
- Owner: mikeal
- License: other
- Created: 2019-01-26T21:50:24.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-06-12T12:41:02.000Z (over 1 year ago)
- Last Synced: 2024-05-22T02:22:34.932Z (6 months ago)
- Language: JavaScript
- Homepage:
- Size: 92.8 KB
- Stars: 470
- Watchers: 10
- Forks: 62
- Open Issues: 20
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## merge-release
GitHub Action for automated npm publishing.
This Action publishes a package to npm. It is meant to be used on every successful merge to master but
you'll need to configure that workflow yourself. You can look to the
[`.github/workflows/push.yml`](./.github/workflows/mikeals-workflow.yml) file in this project as an example.### Workflow
* Check for the latest version number published to npm.
* Lookup all commits between the git commit that triggered the action and the latest publish.
* If the package hasn't been published or the prior publish does not include a git hash, we'll
only pull the commit data that triggered the action.
* Based on the commit messages, increment the version from the lastest release.
* If the string "BREAKING CHANGE" is found anywhere in any of the commit messages or descriptions the major
version will be incremented.
* If a commit message begins with the string "feat" then the minor version will be increased. This works
for most common commit metadata for feature additions: `"feat: new API"` and `"feature: new API"`.
* All other changes will increment the patch version.
* Publish to npm using the configured token.
* Push a tag for the new version to GitHub.### Configuration
You can configure some aspects of merge-release action by passing some environmental variables.
* **GITHUB_TOKEN (required)**
* Github token to allow tagging the version.
* **NPM_AUTH_TOKEN (required)**
* NPM Auth Token to publish to NPM, read [here](https://docs.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets) how to setup it as a secret.
* **DEPLOY_DIR**
* The path where the dist `package.json` is to run npm publish. Defaults to the root dir.
* **SRC_PACKAGE_DIR**
* The path where the src package.json is found. Defaults to the root dir.
* **NPM_REGISTRY_URL**
* NPM Registry URL to use. defaults to: `https://registry.npmjs.org/``merge-release` will use `npm publish` unless you've defined a `publish` script in your `package.json`.
```yaml
- uses: mikeal/merge-release@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
DEPLOY_DIR: my/deploy/dir
SRC_PACKAGE_DIR: my/src/package
```