blob: 99a9c0f7521c52622340d601a5e0d2413c9be6e5 [file] [log] [blame]
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 }}"