-
-
Notifications
You must be signed in to change notification settings - Fork 30
42 lines (41 loc) · 2.16 KB
/
bazel.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: Bazel
on: [ push ]
jobs:
build:
runs-on: ubuntu-latest
container:
image: gcr.io/bazel-public/bazel@sha256:7430f06fff16c8860ec486e1fe0e8c7ce0209a78605b97f41ab6e17f1330ab85
options: --user root # ref: https://docs.github.com/en/actions/creating-actions/dockerfile-support-for-github-actions#user
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GOOGLE_BUCKET: https://storage.googleapis.com/ls-lint-bazel
steps:
- run: set -eu
- uses: actions/checkout@v4
- uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GOOGLE_CREDENTIALS }}
- run: bazel test --remote_cache=$GOOGLE_BUCKET --google_default_credentials //...
- run: bazel build --remote_cache=$GOOGLE_BUCKET --google_default_credentials //...
- run: bazel run //cmd/ls_lint:ls-lint -- --config ${PWD}/.ls-lint.yml --workdir ${PWD}
release:
needs: build
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
container:
image: gcr.io/bazel-public/bazel@sha256:7430f06fff16c8860ec486e1fe0e8c7ce0209a78605b97f41ab6e17f1330ab85
options: --user root # ref: https://docs.github.com/en/actions/creating-actions/dockerfile-support-for-github-actions#user
env:
GH_TOKEN: ${{ github.token }}
STABLE_GIT_TAG: ${{ github.ref_name }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GOOGLE_BUCKET: https://storage.googleapis.com/ls-lint-bazel
steps:
- run: set -eu && curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && apt-get install -y nodejs
- uses: actions/checkout@v4
- uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GOOGLE_CREDENTIALS }}
- run: bazel run --remote_cache=$GOOGLE_BUCKET --google_default_credentials //deployments/github:ls_lint_publish
- run: bazel build --remote_cache=$GOOGLE_BUCKET --google_default_credentials //deployments/npm:ls_lint
- run: (cd bazel-bin/deployments/npm/ls_lint && NPM_CONFIG_USERCONFIG=${GITHUB_WORKSPACE}/deployments/npm/.npmrc npm publish --no-git-checks) # workaround: https://bazelbuild.slack.com/archives/CEZUUKQ6P/p1667995025343689 # --dry-run --tag beta