-
Notifications
You must be signed in to change notification settings - Fork 216
Create release scripts for rules_pkg_providers #1028
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| name: "Create a submodule release" | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| subdir: | ||
| required: true | ||
| type: string | ||
| description: "The subdir within rules_pkg" | ||
| default: "providers" | ||
| version: | ||
| required: true | ||
| type: string | ||
| description: "Version #" | ||
|
|
||
| permissions: | ||
| id-token: write | ||
| attestations: write | ||
| contents: write | ||
|
|
||
| jobs: | ||
| tests: | ||
| name: "Release Tests" | ||
| uses: "./.github/workflows/checks.yml" | ||
|
|
||
| create_tag: | ||
| name: "Create tag" | ||
| runs-on: | ||
| - "ubuntu-latest" | ||
| needs: | ||
| - "tests" | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v6 | ||
|
|
||
| - name: "Create tag" | ||
| id: "tag" | ||
| env: | ||
| SUBDIR: "${{ inputs.subdir }}" | ||
| VERSION: "${{ inputs.version }}" | ||
| MODULE: "rules_pkg_${SUBDIR}" | ||
|
|
||
| GIT_AUTHOR_NAME: "${{ github.actor }}" | ||
| GIT_AUTHOR_EMAIL: "${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com" | ||
| GIT_COMMITTER_NAME: "${{ github.actor }}" | ||
| GIT_COMMITTER_EMAIL: "${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com" | ||
| run: | | ||
| # Download `buildozer` | ||
| # | ||
| 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 | ||
| git add "${MODULE}/MODULE.bazel" | ||
| git commit -m "Release `${MODULE}-${VERSION}`" | ||
|
|
||
| # 3. Push release tag. | ||
| git tag "${MODULE}-${VERSION}" "HEAD" | ||
| git push origin "${MODULE}-${VERSION}" | ||
|
|
||
| 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 }}" | ||
|
Comment on lines
+59
to
+69
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| """The version of rules_pkg_providers.""" | ||
|
|
||
| version = "1.0.0" |
There was a problem hiding this comment.
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.bazela personal preference? I was under the impression this was not necessary if you use the publish to BCR workflow.There was a problem hiding this comment.
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.