You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- fix: Double 'https://' when using a custom registry URL, i.e. for GitHub packages
- fix: Remove redundant `git push remote --tags` command in `entrypoint.sh`
- docs: Update readme
- feat: Add support for a custom list of tags that trigger a major version update
- feat: Add support for a custom list of tags that trigger a minor version update
- feat: Add an option to disable the git tagging feature
- feat: Add a hidden debug option to enable more logging at runtime
- feat: Add support for the GitHub Actions inputs (enable using `with` instead of `env`); while keeping backward-compatibility for `env` users
- feat: Update node dependencies in `package.json`
- feat: Update docker container to use node v20
- feat: Omit the dev dependencies in the docker image
- feat: Drop unused `yargs` dependency
- feat: Switch `merge-release-run.js` to an ESM module
- chore: Put the license text into the `LICENSE` file
- chore: Move `package.json` from src to the root of the repo
- chore: Setup eslint and remove standard
- chore: Added the `.prettierrc` config file
- chore: Various cleanup in `entrypoint.sh`
- chore: Various cleanup in `merge-release-run.js`
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
6
+
7
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
This Action publishes a package to npm. It is meant to be used on every successful merge to main but
11
+
This Action publishes a package to npm. It is meant to be used on every successful merge to main but
10
12
you'll need to configure that workflow yourself. You can look to the
11
13
[`.github/workflows/push.yml`](./.github/workflows/release.yml) file in this project as an example.
12
14
13
15
### Workflow
14
16
15
-
* Check for the latest version number published to npm.
16
-
* Lookup all commits between the git commit that triggered the action and the latest publish.
17
-
* If the package hasn't been published or the prior publish does not include a git hash, we'll
18
-
only pull the commit data that triggered the action.
19
-
* Based on the commit messages, increment the version from the lastest release.
20
-
* If the strings "BREAKING CHANGE" or "!:" are found anywhere in any of the commit messages or descriptions the major
21
-
version will be incremented.
22
-
* If a commit message begins with the string "feat" then the minor version will be increased. This works
23
-
for most common commit metadata for feature additions: `"feat: new API"` and `"feature: new API"`.
24
-
* All other changes will increment the patch version.
25
-
* Publish to npm using the configured token.
26
-
* Push a tag for the new version to GitHub.
27
-
17
+
- Check for the latest version number published to npm.
18
+
- Lookup all commits between the git commit that triggered the action and the latest publish.
19
+
- Note: The package needs to have an initial publish in order to pull the package details.
20
+
- Based on the commit messages, increment the version from the latest release.
21
+
- If the strings "BREAKING CHANGE" is found anywhere in any of the commit messages, or "!:" is found in the first line or a commit message starts with one of the provided major tags (optional), then the major version will be incremented.
22
+
- If a commit message begins with the string "feat" (or a tag in the minor tags list) then the minor version will be increased. This works for most common commit metadata for feature additions: `"feat: new API"` and `"feature: new API"`.
23
+
- All other changes will increment the patch version.
24
+
- Publish to npm (or the provided registry url) using the configured token.
25
+
- Push a tag for the new version to GitHub.
28
26
29
27
### Configuration
30
28
31
29
You can configure some aspects of merge-release action by passing some environmental variables.
32
30
33
-
***GITHUB_TOKEN (required)**
34
-
* Github token to allow tagging the version.
35
-
***NPM_AUTH_TOKEN (required)**
36
-
* 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.
37
-
***DEPLOY_DIR**
38
-
* The path where the dist `package.json` is to run npm publish. Defaults to the root dir.
39
-
***SRC_PACKAGE_DIR**
40
-
* The path where the src package.json is found. Defaults to the root dir.
41
-
***NPM_REGISTRY_URL**
42
-
* NPM Registry URL to use. defaults to: `https://registry.npmjs.org/`
43
-
***NPM_PRIVATE**
44
-
* If you wish privately publish your package please ensure you have set this to `true`
45
-
46
-
`merge-release` will use `npm publish` unless you've defined a `publish` script in your `package.json`.
31
+
-**GITHUB_TOKEN (required)**
32
+
- Github token to allow tagging the version.
33
+
-**NPM_AUTH_TOKEN (required)**
34
+
- NPM Auth Token to publish to the registry, read [here](https://docs.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets) how to setup it as a secret.
35
+
-**DEPLOY_DIR**
36
+
- The path where the dist `package.json` is to run npm publish. Defaults to the root dir. This is a relative file path, relative to the root of the repo.
37
+
-**SRC_PACKAGE_DIR**
38
+
- The path where the src `package.json` is found. Defaults to the root dir. This is a relative file path, relative to the root of the repo.
39
+
-**NPM_REGISTRY_URL**
40
+
- NPM Registry URL to use. defaults to: `https://registry.npmjs.org/`. Set it to `https://npm.pkg.github.com` for GitHub Packages.
41
+
-**NPM_PRIVATE**
42
+
- If you wish privately publish your package please ensure you have set this to `true`
43
+
-**DISABLE_GIT_TAG**
44
+
- If you wish skip setting the git tag, set this to `true`
45
+
-**MAJOR_TAGS**
46
+
- A list of tags to check for when considering whether to perform a major version update. The value is a list separated by the `|` character. i.e. `major|my-major-tag`
47
+
-**MINOR_TAGS**
48
+
- Override the list of tags to check for when considering whether to perform a minor version update. The value is a list separated by the `|` character. i.e. `feat|minor|my-minor-tag`
49
+
50
+
`merge-release` will use `npm publish` by default; but if you've defined a `publish` script in your `package.json` it will use that instead.
0 commit comments