feat(config): add post-release event file

This commit is contained in:
2023-12-16 18:32:29 +02:00
parent 357036d029
commit 4c60f62e72
5 changed files with 35 additions and 0 deletions

View File

@@ -40,6 +40,8 @@ You can create an `.rczrc`, `.rczrc.json` or `rcz.config.json` file in your root
}
```
### On-release event
You are also able to create an onRelease event file, that is going to run before creation of a git tag and a release commit, when `rcz release` is run. The file is to be named `.rczrc.onrelease.js`. A sample can be seen below.
```js
@@ -62,3 +64,7 @@ fs.writeFileSync("./src/index.ts", newIndexFile); // Write to source code index
In your onRelease file you are provided with `__NEW_VERSION__` constant string which is the new version submitted in `rcz release` and `__IS_SIGNED__` constant which is a boolean telling whether the release (it's commit and tag) is going to be signed.
Bear in mind, **this script is going to be executed through `eval()` with no sanitation**, be careful with whatever you write.
### Post-release event
Same as for onRelease you can also create a postRelease file which gets run after the tag and commit get created. Same as for onRelease file you are provided with `__NEW_VERSION__` and `__IS_SIGNED__`