Skip to content

Use the Publish to BCR reusable GitHub workflow #1731

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

mbland
Copy link
Contributor

@mbland mbland commented Apr 29, 2025

Description

Updates .github/workflows/release.yml and adds publish-to-bcr.yml for publishing to the Bazel Central Registry. Part of #1482 (originally broken out from #1722).

release.yml now uses the release_ruleset workflow from bazel-contrib/.github, which does everything release.yml did previously and adds SLSA provenance attestations. release.yml then invokes the new publish-to-bcr.yml workflow after publishing a successful release to GitHub.

Requires that the BCR_PUBLISH_TOKEN GitHub secret and the registry_fork specified in .github/workflows/publish-to-bcr.yml are in place.

See .bcr/README.md for all the details and references.

Motivation

This will enable automated publishing to https://registry.bazel.build/.

Updates `.github/workflows/release.yml` and adds `publish-to-bcr.yml`
for publishing to the Bazel Central Registry. Part of bazel-contrib#1482 (originally
broken out from bazel-contrib#1722).

`release.yml` now uses the `release_ruleset` workflow from
`bazel-contrib/.github`, which does everything `release.yml` did
previously and adds SLSA provenance attestations. `release.yml` then
invokes the new `publish-to-bcr.yml` workflow after publishing a
successful release to GitHub.

Requires that the `BCR_PUBLISH_TOKEN` GitHub secret and the
`registry_fork` specified in `.github/workflows/publish-to-bcr.yml` are
in place.

See `.bcr/README.md` for all the details and references.

---

This will enable automated publishing to https://registry.bazel.build/.
@mbland mbland requested review from liucijus and simuons as code owners April 29, 2025 16:23
@mbland
Copy link
Contributor Author

mbland commented Apr 29, 2025

@simuons @liucijus I believe if you're OK with the transfer to the bazel-contrib org, per #1616, then we can apply this change first before merging (@meteorcloudy please check me on this):

diff --git i/.github/workflows/publish-to-bcr.yml w/.github/workflows/publish-to-bcr.yml
index 8f51b975..b5ebd076 100644
--- i/.github/workflows/publish-to-bcr.yml
+++ w/.github/workflows/publish-to-bcr.yml
@@ -28,7 +28,7 @@ jobs:
     with:
       tag_name: ${{ inputs.tag_name }}
       # bazelbuild/bazel-central-registry fork used to open a pull request.
-      registry_fork: simuons/bazel-central-registry
+      registry_fork: bazel-contrib/bazel-central-registry
     permissions:
       attestations: write
       contents: write

Also, it's essential that #1730 lands before we actually publish to the BCR.


jobs:
publish-to-bcr:
uses: bazel-contrib/publish-to-bcr/.github/workflows/[email protected]
Copy link

Choose a reason for hiding this comment

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

I suggest using the latest v0.1.0.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@kormide Thanks, done in 7f2594d.

BTW, I see release_ruleset.yaml is at v7.2.2. Is it worth updating to that, too? At a first quick glance, it doesn't look like the API has changed.

Copy link

Choose a reason for hiding this comment

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

Probably not load bearing for your case, but it does have some fixes so worth upgrading.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, also done in b27b6b5.

mbland added 3 commits April 29, 2025 13:16
@meteorcloudy confirmed the transfer of the repo to the bazel-contrib
org in bazel-contrib#1616. Transfering ownership before publishing the release will
streamline publishing to the Bazel Central Registry by avoiding the need
for a personal bazel-central-registry fork.
@mbland
Copy link
Contributor Author

mbland commented Apr 29, 2025

@simuons @liucijus I set the registry_fork to bazel-contrib/bazel-central-registry in 4c4fcaf given @meteorcloudy's initiation of the transfer per #1616 (comment).

That just leaves creating the BCR_PUBLISH_TOKEN Personal Access Token in this repo. Then once this and #1730 (and possibly #1729) land, tagging v7.0.0 and pushing should work.

@mbland
Copy link
Contributor Author

mbland commented Apr 29, 2025

BTW, I just noticed another a bunch of similar errors in the CI build to the one I noted in 900847b earlier today:

WARNING: Download from
https://github.com/bufbuild/buf/releases/download/v1.27.0/protoc-gen-buf-lint-Windows-x86_64.exe
failed: class java.io.IOException GET returned 618 jwt:jwt-not-provided

Interesting that it looks like some invented a HTTP 618 error code somewhere.

mbland added a commit to mbland/rules_scala that referenced this pull request Apr 29, 2025
mbland added a commit to mbland/rules_scala that referenced this pull request Apr 29, 2025
@meteorcloudy meteorcloudy reopened this Apr 30, 2025
@meteorcloudy
Copy link

I think the github infra is a bit unstable recently, I'm also seeing similar issue in bazel builds.

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.

3 participants