Skip to content

Commit f23b68b

Browse files
feat: add support for automated BCR publication
1 parent 3a4f42b commit f23b68b

File tree

8 files changed

+156
-0
lines changed

8 files changed

+156
-0
lines changed

.bcr/config.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
moduleRoots:
2+
- "core"
3+
- "google_benchmark"

.bcr/core/metadata.template.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"homepage": "https://codspeed.io",
3+
"maintainers": [
4+
{
5+
"name": "Arthur Pastel",
6+
"email": "arthur@codspeed.io",
7+
"github": "art049"
8+
}
9+
],
10+
"repository": [
11+
"github:CodSpeedHQ/codspeed-cpp"
12+
],
13+
"versions": [],
14+
"yanked_versions": {}
15+
}

.bcr/core/presubmit.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
bcr_test_module:
2+
module_path: ""
3+
matrix:
4+
platform:
5+
- debian10
6+
- macos
7+
- ubuntu2004
8+
- windows
9+
bazel:
10+
- 7.x
11+
- 8.x
12+
tasks:
13+
verify_instrumentation:
14+
platform: ${{ platform }}
15+
bazel: ${{ bazel }}
16+
build_flags:
17+
- "--//:codspeed_mode=instrumentation"
18+
build_targets:
19+
- "//:codspeed"
20+
- "//:instrument_hooks"
21+
verify_simulation:
22+
platform: ${{ platform }}
23+
bazel: ${{ bazel }}
24+
build_flags:
25+
- "--//:codspeed_mode=simulation"
26+
build_targets:
27+
- "//:codspeed"
28+
- "//:instrument_hooks"
29+
verify_walltime:
30+
platform: ${{ platform }}
31+
bazel: ${{ bazel }}
32+
build_flags:
33+
- "--//:codspeed_mode=walltime"
34+
build_targets:
35+
- "//:codspeed"
36+
- "//:instrument_hooks"
37+
verify_off:
38+
platform: ${{ platform }}
39+
bazel: ${{ bazel }}
40+
build_flags:
41+
- "--//:codspeed_mode=off"
42+
build_targets:
43+
- "//:codspeed"
44+
- "//:instrument_hooks"

.bcr/core/source.template.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"url": "https://github.com/{OWNER}/{REPO}/releases/download/{TAG}/codspeed-cpp-{TAG}.tar.gz",
3+
"integrity": "{INTEGRITY}",
4+
"strip_prefix": "codspeed-cpp-{TAG}/core"
5+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"homepage": "https://codspeed.io",
3+
"maintainers": [
4+
{
5+
"name": "Arthur Pastel",
6+
"email": "arthur@codspeed.io",
7+
"github": "art049"
8+
}
9+
],
10+
"repository": [
11+
"github:CodSpeedHQ/codspeed-cpp"
12+
],
13+
"versions": [],
14+
"yanked_versions": {}
15+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
bcr_test_module:
2+
module_path: ""
3+
matrix:
4+
platform:
5+
- debian10
6+
- macos
7+
- ubuntu2004
8+
- windows
9+
bazel:
10+
- 7.x
11+
- 8.x
12+
tasks:
13+
verify_instrumentation:
14+
platform: ${{ platform }}
15+
bazel: ${{ bazel }}
16+
build_flags:
17+
- "--@codspeed_core//:codspeed_mode=instrumentation"
18+
build_targets:
19+
- "//:benchmark"
20+
- "//:benchmark_main"
21+
verify_simulation:
22+
platform: ${{ platform }}
23+
bazel: ${{ bazel }}
24+
build_flags:
25+
- "--@codspeed_core//:codspeed_mode=simulation"
26+
build_targets:
27+
- "//:benchmark"
28+
- "//:benchmark_main"
29+
verify_walltime:
30+
platform: ${{ platform }}
31+
bazel: ${{ bazel }}
32+
build_flags:
33+
- "--@codspeed_core//:codspeed_mode=walltime"
34+
build_targets:
35+
- "//:benchmark"
36+
- "//:benchmark_main"
37+
verify_off:
38+
platform: ${{ platform }}
39+
bazel: ${{ bazel }}
40+
build_flags:
41+
- "--@codspeed_core//:codspeed_mode=off"
42+
build_targets:
43+
- "//:benchmark"
44+
- "//:benchmark_main"
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"url": "https://github.com/{OWNER}/{REPO}/releases/download/{TAG}/codspeed-cpp-{TAG}.tar.gz",
3+
"integrity": "{INTEGRITY}",
4+
"strip_prefix": "codspeed-cpp-{TAG}/google_benchmark"
5+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Publish to Bazel Central Registry
2+
3+
on:
4+
release:
5+
types: [published]
6+
workflow_dispatch:
7+
inputs:
8+
tag_name:
9+
description: 'Release tag to publish (e.g., v1.4.0)'
10+
required: true
11+
type: string
12+
13+
jobs:
14+
publish-to-bcr:
15+
uses: bazel-contrib/publish-to-bcr/.github/workflows/publish.yaml@v1.0.0
16+
with:
17+
tag_name: ${{ github.event.release.tag_name || inputs.tag_name }}
18+
registry_fork: CodSpeedHQ/bazel-central-registry
19+
# TODO: Change this back to bazel-central-registry when initial submission has been approved
20+
registry: CodSpeedHQ/bazel-central-registry
21+
# If we need this, because it requries tweaking permissions on the BCR_PUBLISH_TOKEN secret
22+
# Currently it only has access to the bazel-central-registry repo
23+
attest: false
24+
secrets:
25+
publish_token: ${{ secrets.BCR_PUBLISH_TOKEN }}

0 commit comments

Comments
 (0)