Skip to content

Commit 451a1f5

Browse files
authored
refactor: upgrade Bazel and use bazel_env (bazel-contrib#185)
1 parent 5528deb commit 451a1f5

File tree

13 files changed

+253
-45
lines changed

13 files changed

+253
-45
lines changed

.bazelversion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6.5.0
1+
8.4.0

.envrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
watch_file bazel-out/bazel_env-opt/bin/bin/bazel_env/bin
2+
PATH_add bazel-out/bazel_env-opt/bin/bin/bazel_env/bin
3+
if [[ ! -d bazel-out/bazel_env-opt/bin/bin/bazel_env/bin ]]; then
4+
log_error "ERROR[bazel_env.bzl]: Run 'bazel run //bin:bazel_env' to regenerate bazel-out/bazel_env-opt/bin/bin/bazel_env/bin"
5+
fi

.github/workflows/deploy.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,17 @@ jobs:
2929
with:
3030
version: 8.6.12
3131

32+
- name: Install direnv
33+
run: |
34+
sudo apt-get install -y direnv
35+
eval "$(direnv hook bash)"
3236
- name: Install required binaries
3337
run: |
34-
./install_bins.sh
35-
38+
direnv allow .
39+
eval "$(direnv export bash)"
40+
# GHA steps run as non-interactive shells so they don't source the .bashrc
41+
echo "PATH=$PATH" >> $GITHUB_ENV
42+
bazel run //bin:bazel_env
3643
- name: Checkout BCR submodule
3744
run: |
3845
git submodule update --init -- data/bazel-central-registry

.github/workflows/test.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,17 @@ jobs:
2121
version: 8.6.12
2222
- name: Install node_modules
2323
run: pnpm install --frozen-lockfile
24-
24+
- name: Install direnv
25+
run: |
26+
sudo apt-get install -y direnv
27+
eval "$(direnv hook bash)"
2528
- name: Install required binaries
2629
run: |
27-
./install_bins.sh
28-
30+
direnv allow .
31+
eval "$(direnv export bash)"
32+
# GHA steps run as non-interactive shells so they don't source the .bashrc
33+
echo "PATH=$PATH" >> $GITHUB_ENV
34+
bazel run //bin:bazel_env
2935
- name: Check prettier formatting
3036
run: pnpm prettier-check
3137

MODULE.bazel

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
bazel_dep(name = "bazel_env.bzl", version = "0.5.0")
2+
bazel_dep(name = "buildifier_prebuilt", version = "8.2.0.2")
3+
bazel_dep(name = "buildozer", version = "7.1.2")

MODULE.bazel.lock

Lines changed: 209 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ We use git submodules to include the data from bazelbuild/bazel-central-registry
2222
git submodule update --init
2323
```
2424

25-
To get a buildozer binary, you also need to run this before launching the app:
25+
To get a buildifier and buildozer on your PATH, you also need to run this before launching the app:
2626

2727
```bash
28-
./install_bins.sh
28+
bazel run //bin:bazel_env
2929
```
3030

3131
Packages are managed via [pnpm](https://pnpm.io/), so they can be installed via `npx pnpm install`

WORKSPACE

Lines changed: 0 additions & 26 deletions
This file was deleted.

bin/.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

bin/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)