Added automated TRLC to BCR release pipeline#181
Conversation
Introduces GitHub Actions workflows and BCR templates to automate trlc releases to Bazel Central Registry on trlc-* tag push.
1ccc098 to
f0e5b7c
Compare
dc3c890 to
8f9e9fe
Compare
…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.
8f9e9fe to
e25fe23
Compare
| (An alternative to PyPI CVC5, make sure to rename the binary to | ||
| `cvc5` and put it on your PATH). | ||
|
|
||
| ## Automated Release Flow |
There was a problem hiding this comment.
This section could be added to a README for developers only.
There was a problem hiding this comment.
could you point out which README.md. so its essay to move.
| - 8.x | ||
| matrix: | ||
| platform: | ||
| - ubuntu2004 |
There was a problem hiding this comment.
- 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 |
There was a problem hiding this comment.
- 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.
| bazel: | ||
| - 8.x | ||
| tasks: | ||
| verify_api_examples: |
There was a problem hiding this comment.
- 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.
| @@ -0,0 +1,5 @@ | |||
| { | |||
| "integrity": "**leave this alone**", | |||
There was a problem hiding this comment.
- "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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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' }} |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
- 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 |
There was a problem hiding this comment.
- 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 | |||
There was a problem hiding this comment.
- 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.
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.