Skip to content

Create release scripts for rules_pkg_providers#1028

Merged
tonyaiuto merged 4 commits intobazelbuild:mainfrom
aiuto:prov2
Mar 3, 2026
Merged

Create release scripts for rules_pkg_providers#1028
tonyaiuto merged 4 commits intobazelbuild:mainfrom
aiuto:prov2

Conversation

@tonyaiuto
Copy link
Collaborator

@tonyaiuto tonyaiuto commented Feb 18, 2026

  • create a new release_module workflow
    • takes subdir and version as args, default to providers for now.
    • stole the buildifier technique we used in supply_chain
    • the code should work for toolchains if we split that.
  • modify release_prep.sh to deal with old and new styles

Hand testing release_prep.sh seems to work. Testing the workflow is nearly impossible until it exists the first time.

Next steps:

Future work:

  • generate git changelog on a per-subdir basis.
  • allow better customization of release notes documentation link.

- generalizable to more modules.
- creates the tarball and relnotes as part of the distro package.

Future work:

- figure out something for BCR releases.
  - Hope for: bazel-contrib/publish-to-bcr#368
  - more pragmatic solution might be to have a shell script around the bcr add-module script
- generate git changelog on a per-subdir basis
- allow better customization of release notes documentation link
@tonyaiuto
Copy link
Collaborator Author

@cgrindel Friendly ping.

Copy link
Collaborator

@cgrindel cgrindel left a comment

Choose a reason for hiding this comment

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

Overall, LGTM. However, I added a couple of comments/questions.

Comment on lines +9 to +12
exit_code="$?"
if [ "${exit_code}" -ne 0 ] ; then
exit "${exit_code}"
fi
Copy link
Collaborator

Choose a reason for hiding this comment

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

With -o errexit, do you need to check for exit_code? My read is that the script will halt if an error occurs.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

TBH. I was lifting code from elsewhere, where they had this heavy-handed style. Removed.

Comment on lines +50 to +51
curl -o "${RUNNER_TEMP}/buildozer" -L "https://github.com/bazelbuild/buildtools/releases/download/v7.3.1/buildozer-linux-amd64"
"${RUNNER_TEMP}/buildozer" "set version ${VERSION}" "//${SUBDIR}/MODULE.bazel:${MODULE}" || true
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is updating the version in the MODULE.bazel a personal preference? I was under the impression this was not necessary if you use the publish to BCR workflow.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We won't be able to use the publish BCR workflow directly. That only works if every submodule publishes at the same version level, which defeats the point of having a slow release cycle.

Comment on lines +59 to +69
release:
name: "Create GitHub release"
needs:
- "create_tag"

uses: "bazel-contrib/.github/.github/workflows/release_ruleset.yaml@v7.2.4"
with:
# This will run release_prep.sh to do the dirty work.
# TODO: https://github.com/bazelbuild/rules_pkg/issues/1031
release_files: "bazel-bin/distro/rules_pkg_${{ inputs.subdir }}-*.tgz"
tag_name: "rule_pkg_${{ inputs.subdir }}-${{ inputs.version }}"
Copy link
Collaborator

Choose a reason for hiding this comment

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

FYI. There are GHA actions for creating releases (e.g., https://github.com/softprops/action-gh-release) and their associated tags. I wonder if some of the code in release_prep.sh could be replaced by the functionality in the action.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Maybe. I don't particularly like the constraints of release_ruleset that it always runs release_prep.sh., so I'm willing to switch. OTOH, its not clear that softprops does built attestations yet. I would like to be able to enable those, so release_ruleset might have the short term advantage.

@tonyaiuto tonyaiuto merged commit 5399653 into bazelbuild:main Mar 3, 2026
2 of 5 checks passed
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