Skip to content

Added automated TRLC to BCR release pipeline#181

Open
AAmbuj wants to merge 3 commits into
bmw-software-engineering:mainfrom
AAmbuj:amsh_automated_release_trlc_to_bcr
Open

Added automated TRLC to BCR release pipeline#181
AAmbuj wants to merge 3 commits into
bmw-software-engineering:mainfrom
AAmbuj:amsh_automated_release_trlc_to_bcr

Conversation

@AAmbuj
Copy link
Copy Markdown
Contributor

@AAmbuj AAmbuj commented Apr 29, 2026

Introduces GitHub Actions workflows
and BCR templates to automate
trlc releases to Bazel Central Registry
on trlc-* tag push.

Note: To open BCR PRs through a fork, add a repository secret named BCR_PUBLISH_TOKEN in the lobster repository.
This secret must be a classic PAT (repo + workflow) from the GitHub account that owns (or can push to) the configured BCR fork, for example AAmbuj/bazel-central-registry.

Introduces GitHub Actions workflows
and BCR templates to automate
trlc releases to Bazel Central Registry
on trlc-* tag push.
@AAmbuj AAmbuj requested a review from a team as a code owner April 29, 2026 12:29
@AAmbuj AAmbuj force-pushed the amsh_automated_release_trlc_to_bcr branch from 1ccc098 to f0e5b7c Compare May 4, 2026 07:42
@AAmbuj AAmbuj force-pushed the amsh_automated_release_trlc_to_bcr branch 2 times, most recently from dc3c890 to 8f9e9fe Compare May 12, 2026 06:42
…engineering#182)

Windows CVC5 archive ships bin/cvc5.exe, not bin/cvc5. Use a
platform-aware select() so the filegroup references the correct binary
name on each OS.
@AAmbuj AAmbuj force-pushed the amsh_automated_release_trlc_to_bcr branch from 8f9e9fe to e25fe23 Compare May 20, 2026 05:44
Comment thread README.md
(An alternative to PyPI CVC5, make sure to rename the binary to
`cvc5` and put it on your PATH).

## Automated Release Flow
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section could be added to a README for developers only.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you point out which README.md. so its essay to move.

Comment thread .bcr/presubmit.yml
- 8.x
matrix:
platform:
- ubuntu2004
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Platforms (presubmit.yml L12-14, release.yml L51)
    Question: Why did you pick these platforms, and only these?

Answer: The platforms ubuntu2004, ubuntu2204, and windows are selected from the fixed set available in the BCR presubmit CI infrastructure (Bazel CI on BuildKite). The full list of supported platform labels is defined in the PLATFORMS variable in bazelci.py. Available options include rockylinux8, debian10, ubuntu2004, ubuntu2204, macos, macos_arm64, windows, among others (see BCR docs – Anonymous module test).

Since TRLC is a pure Python module with no native/compiled components, the two most common Linux environments plus Windows (for path-handling differences) provide sufficient coverage. macos can be added if desired.

The ubuntu-24.04 in release.yml L51 is a GitHub Actions runner (not a BCR platform) — it only runs gh release edit to publish a draft release, so any Linux runner suffices.

Action: No change needed unless macOS coverage is desired.


finalize:
needs: publish
runs-on: ubuntu-24.04
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Platforms (presubmit.yml L12-14, release.yml L51)
    Question: Why did you pick these platforms, and only these?

Answer: The platforms ubuntu2004, ubuntu2204, and windows are selected from the fixed set available in the BCR presubmit CI infrastructure (Bazel CI on BuildKite). The full list of supported platform labels is defined in the PLATFORMS variable in bazelci.py. Available options include rockylinux8, debian10, ubuntu2004, ubuntu2204, macos, macos_arm64, windows, among others (see BCR docs – Anonymous module test).

Since TRLC is a pure Python module with no native/compiled components, the two most common Linux environments plus Windows (for path-handling differences) provide sufficient coverage. macos can be added if desired.

The ubuntu-24.04 in release.yml L51 is a GitHub Actions runner (not a BCR platform) — it only runs gh release edit to publish a draft release, so any Linux runner suffices.

Action: No change needed unless macOS coverage is desired.

Comment thread .bcr/presubmit.yml
bazel:
- 8.x
tasks:
verify_api_examples:
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Verify API Examples (presubmit.yml L18-27)
    Question: What is happening here?

Answer: This is the BCR's standard "anonymous module test". It verifies that when a downstream user depends on TRLC as an external Bazel module, the api-examples/ directory builds and passes tests correctly.

The BCR CI creates a simple anonymous module with:

bazel_dep(name = "trlc", version = "X.Y.Z")
Then it builds/tests @trlc//api-examples/... to confirm the published module works for consumers. The test_flags line pins Python 3.12 via the rules_python config setting.

Action: No change needed — working as intended.

Comment thread .bcr/source.template.json
@@ -0,0 +1,5 @@
{
"integrity": "**leave this alone**",
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. "Leave this alone" (source.template.json L2)
    Question: What shall be left alone?

Answer: The literal text leave this alone is a placeholder from the publish-to-bcr tooling. When the automation runs, it automatically computes the SHA-256 integrity hash of the source archive and replaces this field. The text instructs maintainers: "don't manually fill in a value here — the tooling handles it."

This is the standard template pattern used by all projects using publish-to-bcr.

Action: No change needed — this is intentional.

registry_fork:
required: false
type: string
default: AAmbuj/bazel-central-registry
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Problem: default: AAmbuj/bazel-central-registry points to my personal fork of the BCR. The publish-to-bcr action pushes a branch to this fork and opens a PR from it to the upstream bazelbuild/bazel-central-registry. Using a personal fork was done during development/testing.

Solution: Change to bmw-software-engineering/bazel-central-registry. The org needs to fork bazelbuild/bazel-central-registry once (any org member with "create repository" permission can do this).

description: GitHub fork used to open the BCR PR (owner/repo)
required: false
type: string
default: AAmbuj/bazel-central-registry
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Problem: default: AAmbuj/bazel-central-registry points to my personal fork of the BCR. The publish-to-bcr action pushes a branch to this fork and opens a PR from it to the upstream bazelbuild/bazel-central-registry. Using a personal fork was done during development/testing.

Solution: Change to bmw-software-engineering/bazel-central-registry. The org needs to fork bazelbuild/bazel-central-registry once (any org member with "create repository" permission can do this).

description: GitHub fork used to open the BCR PR (owner/repo)
required: false
type: string
default: AAmbuj/bazel-central-registry
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Problem: default: AAmbuj/bazel-central-registry points to my personal fork of the BCR. The publish-to-bcr action pushes a branch to this fork and opens a PR from it to the upstream bazelbuild/bazel-central-registry. Using a personal fork was done during development/testing.

Solution: Change to bmw-software-engineering/bazel-central-registry. The org needs to fork bazelbuild/bazel-central-registry once (any org member with "create repository" permission can do this).

uses: ./.github/workflows/publish.yml
with:
tag_name: ${{ inputs.tag_name || github.ref_name }}
registry_fork: ${{ inputs.registry_fork || 'AAmbuj/bazel-central-registry' }}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Problem: default: AAmbuj/bazel-central-registry points to my personal fork of the BCR. The publish-to-bcr action pushes a branch to this fork and opens a PR from it to the upstream bazelbuild/bazel-central-registry. Using a personal fork was done during development/testing.

Solution: Change to bmw-software-engineering/bazel-central-registry. The org needs to fork bazelbuild/bazel-central-registry once (any org member with "create repository" permission can do this).

author_name: Ambuj Singh Kushwaha
author_email: ambujsingh7566180876@gmail.com
committer_name: github-actions[bot]
committer_email: 41898282+github-actions[bot]@users.noreply.github.com
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Strange committer email (publish.yml L40)
    Question: This looks odd.

Answer: 41898282+github-actions[bot]@users.noreply.github.com is the standard GitHub Actions bot email. 41898282 is the user ID of the github-actions[bot] account. This is the canonical format recommended by GitHub for commits authored by GitHub Actions workflows. Widely used across open-source projects.

Action: No change needed — this is correct and standard.

attest: true
tag_prefix: "trlc-"
author_name: Ambuj Singh Kushwaha
author_email: ambujsingh7566180876@gmail.com
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Private Email (publish.yml L38)
    Question: Here is still a gmail account.

Problem: author_email: ambujsingh7566180876@gmail.com is my personal Gmail used as the commit author email in BCR pull requests.

Solution: Replace with either:

BMW email address, or
The GitHub no-reply address of a BMW service account (ID+username@users.noreply.github.com)

@@ -0,0 +1,44 @@
#!/usr/bin/env bash
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Release Preparations (release_prep.sh)
    Question: What is the purpose of this file?

Answer: This script:

Validates the tag format (must match trlc-X.Y.Z)
Creates a reproducible source archive using git archive
Computes the SHA-256 checksum
Prints Markdown snippets (Bzlmod + WORKSPACE installation instructions) for GitHub Release notes
It generates release artifacts and user-facing documentation.

Action: No change needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants