Fix publish workflow

This commit is contained in:
ArthurSonzogni 2025-05-01 10:32:33 +02:00
parent 694fa6bf5c
commit ba6716c6e1
No known key found for this signature in database
GPG Key ID: 41D98248C074CD6C
2 changed files with 28 additions and 7 deletions

View File

@ -1,22 +1,41 @@
name: "Publish to Bazel Central Registry" name: "Publish to Bazel Central Registry"
on: on:
# On manual trigger: # Manual kick-off (you type the tag)
workflow_dispatch: workflow_dispatch:
inputs: inputs:
tag_name: tag_name:
description: "Tag to publish"
required: true required: true
type: string type: string
jobs: # Fire as soon as the Release workflow completes
workflow_run:
workflows:
- Release
types:
- completed
permissions:
attestations: write
contents: write
id-token: write
jobs:
publish: publish:
uses: bazel-contrib/publish-to-bcr/.github/workflows/publish.yaml@v0.0.4 uses: bazel-contrib/publish-to-bcr/.github/workflows/publish.yaml@v0.0.4
# Only run on manual dispatch, or when Release finishes successfully
if: |
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success')
with: with:
tag_name: ${{ inputs.tag_name }} # If manual: use the input, otherwise grab the tag from the completed run
tag_name: ${{
github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name ||
github.event_name == 'workflow_run' && github.event.workflow_run.head_branch
}}
registry_fork: ArthurSonzogni/bazel-central-registry registry_fork: ArthurSonzogni/bazel-central-registry
permissions:
attestations: write
contents: write
id-token: write
secrets: secrets:
publish_token: ${{ secrets.PUBLISH_TOKEN }} publish_token: ${{ secrets.PUBLISH_TOKEN }}

View File

@ -13,6 +13,8 @@ permissions:
# Needed to mint attestations # Needed to mint attestations
id-token: write id-token: write
attestations: write attestations: write
# Needed to upload release assets
contents: write
jobs: jobs:
release: release: