Skip to content
CONTRIBUTING.md 1.26 KiB
Newer Older
# Contributing

# Getting Started

[Install][bazelisk-install] `bazelisk` and run the tests:

```sh
$ bazelisk test //...
$ (cd e2e; bazelisk test //...)
```

[bazelisk-install]: https://github.com/bazelbuild/bazelisk?tab=readme-ov-file#installation

# Release

`semantic-release` performs automatic releases of the project.

Release channels for `alpha`, `beta` and `stable` releases are used.

The [upstream configuration usage guide][semrel-release-channels-usage] provides information on how to perform a
release.

[semrel-release-channels-usage]:
  https://gitlab.arm.com/semantic-release/config-release-channels/-/blob/main/README.md?ref_type=heads#usage

# Upgrading Binaries

The following script can be ran in a POSIX shell:

```console
# Clear out all integrities
sed -i 's|"\([a-z0-9-]\+\)": "sha256.\+",|"\1": "",|g' MODULE.bazel
# Run a fetch and update integrity
for BINARY in $(rg --no-line-number '^ +"([a-z0-9]+)": "",' -or '$1' MODULE.bazel); do
  INTEGRITY="$(bazelisk fetch @${BINARY}//:entrypoint 2>&1 | rg -o 'sha256-[^"]+')"
  echo "${BINARY}: ${INTEGRITY}"
  sed -i "s|\"${BINARY}\": \"\",|\"${BINARY}\": \"${INTEGRITY}\",|" MODULE.bazel
done
# Upload all binaries
for TARGET in $(bazelisk query 'upload:*' | tail -n +2); do
    bazelisk run "${TARGET}"
done
```