diff --git a/.bcr/presubmit.yml b/.bcr/presubmit.yml index 9167b8c..f09c0eb 100644 --- a/.bcr/presubmit.yml +++ b/.bcr/presubmit.yml @@ -3,7 +3,7 @@ bcr_test_module: module_path: "examples" matrix: platform: ["macos_arm64", "ubuntu2004", "ubuntu2004_arm64"] - bazel: ["7.x", "8.x"] + bazel: ["7.x", "8.x", "9.x"] tasks: run_tests: name: "Run test module" diff --git a/.github/workflows/bcr-publish.yaml b/.github/workflows/bcr-publish.yaml new file mode 100644 index 0000000..d0700c0 --- /dev/null +++ b/.github/workflows/bcr-publish.yaml @@ -0,0 +1,44 @@ +# See https://github.com/bazel-contrib/publish-to-bcr +name: Publish to BCR + +on: + # Allow the publish workflow to be called from another workflow. + # In this case, we trigger it from the release.yaml workflow. + workflow_call: + inputs: + release_version: + required: true + type: string + secrets: + BCR_PUBLISH_TOKEN: + required: true + # In case of problems, let release engineers retry by manually dispatching + # the workflow from the GitHub UI. + workflow_dispatch: + inputs: + release_version: + required: true + type: string + description: Release version to publish to the Bazel Central Registry + templates_ref: + default: '' + type: string + description: Override the ref to read .bcr templates from +jobs: + publish: + uses: bazel-contrib/publish-to-bcr/.github/workflows/publish.yaml@v1.1.0 + with: + attest: false + tag_name: ${{ inputs.release_version }} + author_name: periareon-bot + author_email: 260522848+periareon-bot@users.noreply.github.com + # Tags don't include a "v" prefix + tag_prefix: "" + # GitHub repository which is a fork of the upstream where the Pull Request will be opened. + registry_fork: periareon/bazel-central-registry + templates_ref: ${{ inputs.templates_ref || inputs.release_version }} + draft: false + permissions: + contents: write + secrets: + publish_token: ${{ secrets.BCR_PUBLISH_TOKEN }} diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 761f7ac..2c4aeb7 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -23,15 +23,19 @@ jobs: contents: write actions: write attestations: write + outputs: + release_version: ${{ steps.version.outputs.release_version }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 with: ref: main - name: Detect the current version + id: version run: | version="$(grep 'VERSION =' ./version.bzl | sed 's/VERSION = "//' | sed 's/"//')" echo "RELEASE_VERSION=${version}" >> $GITHUB_ENV + echo "release_version=${version}" >> $GITHUB_OUTPUT # Ensure this does not exclude the module used for the .bcr presubmit job. - name: Create release artifact run: | @@ -61,3 +65,13 @@ jobs: asset_name: rules_tcl-${{ env.RELEASE_VERSION }}.tar.gz asset_path: ${{ github.workspace }}/.github/rules_tcl.tar.gz asset_content_type: application/gzip + + bcr-publish: + needs: [release] + permissions: + contents: write + uses: ./.github/workflows/bcr-publish.yaml + with: + release_version: ${{ needs.release.outputs.release_version }} + secrets: + BCR_PUBLISH_TOKEN: ${{ secrets.BCR_PUBLISH_TOKEN }} diff --git a/MODULE.bazel b/MODULE.bazel index a9147a7..b7122f5 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -2,7 +2,7 @@ module( name = "rules_tcl", - version = "0.1.1", + version = "0.2.0", ) bazel_dep(name = "bazel_skylib", version = "1.8.2") diff --git a/version.bzl b/version.bzl index 3a8d021..7441a94 100644 --- a/version.bzl +++ b/version.bzl @@ -1,3 +1,3 @@ """"rules_tcl version""" -VERSION = "0.1.1" +VERSION = "0.2.0"