Skip to content

Commit 46ce025

Browse files
committed
ci: publish workflow
1 parent 378dd79 commit 46ce025

File tree

2 files changed

+68
-0
lines changed

2 files changed

+68
-0
lines changed

.github/workflows/publish.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Publish to BCR
2+
on:
3+
# Run the publish workflow after a successful release
4+
# Will be triggered from the release.yaml workflow
5+
workflow_call:
6+
inputs:
7+
tag_name:
8+
required: true
9+
type: string
10+
secrets:
11+
publish_token:
12+
required: true
13+
# In case of problems, let release engineers retry by manually dispatching
14+
# the workflow from the GitHub UI
15+
workflow_dispatch:
16+
inputs:
17+
tag_name:
18+
description: git tag being released
19+
required: true
20+
type: string
21+
jobs:
22+
publish:
23+
uses: bazel-contrib/publish-to-bcr/.github/workflows/[email protected]
24+
with:
25+
tag_name: ${{ inputs.tag_name }}
26+
# GitHub repository which is a fork of the upstream where the Pull Request will be opened.
27+
registry_fork: TendTo/bazel-central-registry
28+
draft: false
29+
permissions:
30+
attestations: write
31+
contents: write
32+
id-token: write
33+
secrets:
34+
# Necessary to push to the BCR fork, and to open a pull request against a registry
35+
publish_token: ${{ secrets.publish_token || secrets.BCR_PUBLISH_TOKEN }}

.github/workflows/release.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Release
2+
on:
3+
# Can be triggered from the tag.yaml workflow
4+
workflow_call:
5+
inputs:
6+
tag_name:
7+
required: true
8+
type: string
9+
secrets:
10+
publish_token:
11+
required: true
12+
# Or, developers can manually push a tag from their clone
13+
push:
14+
tags:
15+
- "*.*.*"
16+
permissions:
17+
id-token: write
18+
attestations: write
19+
contents: write
20+
jobs:
21+
release:
22+
uses: bazel-contrib/.github/.github/workflows/[email protected]
23+
with:
24+
release_files: rules_doxygen-*.tar.gz
25+
prerelease: false
26+
tag_name: ${{ inputs.tag_name || github.ref_name }}
27+
publish:
28+
needs: release
29+
uses: ./.github/workflows/publish.yml
30+
with:
31+
tag_name: ${{ inputs.tag_name || github.ref_name }}
32+
secrets:
33+
publish_token: ${{ secrets.publish_token || secrets.BCR_PUBLISH_TOKEN }}

0 commit comments

Comments
 (0)