From 32a8180a28d79c4ad61e0b49b1c0eb01f322cfe2 Mon Sep 17 00:00:00 2001 From: Sean Huh Date: Mon, 9 Nov 2026 18:29:16 -0800 Subject: [PATCH] Add Bazel Central Registry release templates and publish workflow. PiperOrigin-RevId: 1017810645 --- .bcr/README.md | 6 +++++ .bcr/metadata.template.json | 40 ++++++++++++++++++++++++++++ .bcr/presubmit.yml | 16 +++++++++++ .bcr/source.template.json | 5 ++++ .github/workflows/publish_to_bcr.yml | 28 +++++++++++++++++++ .github/workflows/workflow.yml | 6 +++-- 6 files changed, 99 insertions(+), 2 deletions(-) create mode 100644 .bcr/README.md create mode 100644 .bcr/metadata.template.json create mode 100644 .bcr/presubmit.yml create mode 100644 .bcr/source.template.json create mode 100644 .github/workflows/publish_to_bcr.yml diff --git a/.bcr/README.md b/.bcr/README.md new file mode 100644 index 0000000..7338f45 --- /dev/null +++ b/.bcr/README.md @@ -0,0 +1,6 @@ +# Bazel Central Registry release configuration + +Configuration files for the +[Publish to BCR](https://github.com/bazel-contrib/publish-to-bcr) workflow, +used to publish releases of `cel-conformance` to the +[Bazel Central Registry](https://registry.bazel.build/). diff --git a/.bcr/metadata.template.json b/.bcr/metadata.template.json new file mode 100644 index 0000000..ea81390 --- /dev/null +++ b/.bcr/metadata.template.json @@ -0,0 +1,40 @@ +{ + "homepage": "https://cel.dev", + "maintainers": [ + { + "email": "cel-lang-discuss@googlegroups.com", + "github": "cel-expr", + "github_user_id": 186625994, + "name": "CEL Team" + }, + { + "github": "dmitriplotnikov", + "github_user_id": 6456853 + }, + { + "github": "TristonianJones", + "github_user_id": 483300 + }, + { + "github": "l46kok", + "github_user_id": 2355949 + }, + { + "github": "jcking", + "github_user_id": 997958 + }, + { + "github": "jnthntatum", + "github_user_id": 733856 + }, + { + "github": "maskri17", + "github_user_id": 101070626 + } + ], + "repository": [ + "github:cel-expr/cel-conformance" + ], + "versions": [], + "yanked_versions": {} +} diff --git a/.bcr/presubmit.yml b/.bcr/presubmit.yml new file mode 100644 index 0000000..512c867 --- /dev/null +++ b/.bcr/presubmit.yml @@ -0,0 +1,16 @@ +matrix: + platform: + - debian11 + - ubuntu2004 + bazel: + - 9.x + - 8.x +tasks: + verify_targets: + name: Verify build targets + platform: ${{ platform }} + bazel: ${{ bazel }} + build_flags: + - '--incompatible_autoload_externally=proto_library,cc_proto_library,java_proto_library,py_proto_library' + build_targets: + - '@cel-conformance//...' diff --git a/.bcr/source.template.json b/.bcr/source.template.json new file mode 100644 index 0000000..a3bd62f --- /dev/null +++ b/.bcr/source.template.json @@ -0,0 +1,5 @@ +{ + "integrity": "", + "strip_prefix": "{REPO}-{VERSION}", + "url": "https://github.com/{OWNER}/{REPO}/archive/refs/tags/{TAG}.tar.gz" +} diff --git a/.github/workflows/publish_to_bcr.yml b/.github/workflows/publish_to_bcr.yml new file mode 100644 index 0000000..dce0f7a --- /dev/null +++ b/.github/workflows/publish_to_bcr.yml @@ -0,0 +1,28 @@ +# Publish to Bazel Central Registry +# See https://github.com/bazel-contrib/publish-to-bcr/tree/main/templates + +name: Publish to BCR +on: + push: + tags: + - "v*.*.*" + workflow_dispatch: + inputs: + tag_name: + description: The release tag to publish + required: true + type: string +permissions: {} + +jobs: + publish: + uses: bazel-contrib/publish-to-bcr/.github/workflows/publish.yaml@748dc7186bc60d0e24a81ee30aba8aa543794767 # v1.0.0 + with: + tag_name: ${{ inputs.tag_name || github.ref_name }} + attest: false + permissions: + contents: write + id-token: write + attestations: write + secrets: + publish_token: ${{ secrets.BCR_PUBLISH_TOKEN }} diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 74fad4a..b9ef5e7 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -20,10 +20,12 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + persist-credentials: false - name: Cache bazel - uses: actions/cache@v4 + uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 with: path: "~/.cache/bazel" key: bazel-${{ runner.os }}-${{ hashFiles('.bazelrc', 'MODULE.bazel') }}