Newer
Older
A `semantic-release` plugin to run [Bazelisk][bazelisk] targets for each
`semantic-release` stage.
| Step | Description |
| ---------------- | -------------------------------------- |
| verifyConditions | Runs `//release:verify`, if available |
| prepare | Runs `//release:prepare`, if available |
| publish | Runs `//release:publish`, if available |
| notify | Runs `//release:notify`, if available |
```sh
npm config --location project set registry https://gitlab.arm.com/api/v4/groups/semantic-release/-/packages/npm/
npm install --save-dev @semantic-release/bazelisk
```yaml
plugins:
- "@semantic-release/bazelisk"
```
Add a `release/BUILD.bazel` file with the stage targets:
```py
alias(
name = "prepare",
actual = "//some:target",
)
```
The `//some:target` would be ran as part of the `prepare` stage.
Custom rules can be written to customise what Bazelisk performs in that stage.
## Configuration
The command and arguments to `bazelisk <command> -- <arguments>` can be
controlled for each stage:
```yaml
plugins:
- path: "@semantic-release/yq"
stages:
verify: "//something:verify"
prepare:
- "//something:else"
publish:
query: false
timeout: "60s"
command:
- "run"
- "--stamp"
- "--embed_label=${nextRelease.version}"
arguments: "//some:target"
verify:
arguments:
- "//something:upload"
- "--url=https://somewhere.com/upload/endpoint"
```
Can be a string as a convenience for a single element array.
Otherwise, an array of arguments to use for the command portion of
The command can consume [substitutions] in a [lodash template].
Can be a string as a convenience for a single element array.
Otherwise, an array of arguments to use for the arguments portion of
The arguments can consume [substitutions] in a [lodash template].
Determines if `bazelisk query -- <target>` is ran to detect if the target
exists. If the target is not available, the stage does nothing.
Setting it to `false` will run the command and fail if the target does not
exist.
Can be anything that [ms] understands (such as `"60s"`, `"1m"`) or the number of
milliseconds.
[bazelisk]: https://github.com/bazelbuild/bazelisk
[lodash template]: https://docs-lodash.com/v4/template/
[substitutions]:
https://semantic-release.gitbook.io/semantic-release/developer-guide/js-api#nextrelease
[ms]: https://www.npmjs.com/package/ms