From 2a5d7646da0b3dcd1ed9055d9d02e135ba857512 Mon Sep 17 00:00:00 2001 From: ArthurSonzogni Date: Sat, 26 Apr 2025 02:38:32 +0200 Subject: [PATCH] Add publish to BCR --- .bcr/README.md | 9 +++++++++ .bcr/config.yaml | 18 +++++++++++++++++ .bcr/metadata.template.json | 16 +++++++++++++++ .bcr/presubmit.yml | 25 ++++++++++++++++++++++++ .bcr/source.template.json | 5 +++++ .github/workflows/publish_to_bcr.yaml | 28 +++++++++++++++++++++++++++ .gitignore | 1 + MODULE.bazel | 4 ++++ WORKSPACE.bazel | 3 +++ 9 files changed, 109 insertions(+) create mode 100644 .bcr/README.md create mode 100644 .bcr/config.yaml create mode 100644 .bcr/metadata.template.json create mode 100644 .bcr/presubmit.yml create mode 100644 .bcr/source.template.json create mode 100644 .github/workflows/publish_to_bcr.yaml diff --git a/.bcr/README.md b/.bcr/README.md new file mode 100644 index 00000000..44ae7fe5 --- /dev/null +++ b/.bcr/README.md @@ -0,0 +1,9 @@ +# Bazel Central Registry + +When the ruleset is released, we want it to be published to the +Bazel Central Registry automatically: + + +This folder contains configuration files to automate the publish step. +See +for authoritative documentation about these files. diff --git a/.bcr/config.yaml b/.bcr/config.yaml new file mode 100644 index 00000000..37d1ca99 --- /dev/null +++ b/.bcr/config.yaml @@ -0,0 +1,18 @@ +# Copyright 2025 Arthur Sonzogni. All rights reserved. +# Use of this source code is governed by the MIT license that can be found in +# the LICENSE file. +{ + "homepage": "https://github.com/ArthurSonzogni/FTXUI", + "maintainers": [ + { + "name": "Arthur Sonzogni", + "email": "sonzogniarthur@gmail.com", + "github": "ArthurSonzogni" + } + ], + "repository": [ + "github:ArthurSonzogni/FTXUI" + ], + "versions": [], + "yanked_versions": {} +} diff --git a/.bcr/metadata.template.json b/.bcr/metadata.template.json new file mode 100644 index 00000000..9b2b52de --- /dev/null +++ b/.bcr/metadata.template.json @@ -0,0 +1,16 @@ +{ + "homepage": "https://github.com/ArthurSonzogni/FTXUI", + "maintainers": [ + { + "name": "Arthur Sonzogni", + "email": "sonzogniarthur@gmail.com", + "github": "ArthurSonzogni", + "github_user_id": 4759106 + } + ], + "repository": [ + "github:ArthurSonzogni/FTXUI" + ], + "versions": [], + "yanked_versions": {} +} diff --git a/.bcr/presubmit.yml b/.bcr/presubmit.yml new file mode 100644 index 00000000..8ca84f16 --- /dev/null +++ b/.bcr/presubmit.yml @@ -0,0 +1,25 @@ +# Copyright 2025 Arthur Sonzogni. All rights reserved. +# Use of this source code is governed by the MIT license that can be found in +# the LICENSE file. +bcr_test_module: + module_path: "." + matrix: + platform: [ + "debian11", + "macos", + "macos-arm64", + "ubuntu2204", + "windows", + ] + bazel: [ + 6.x, + 7.x, + 8.x, + ] + tasks: + run_tests: + name: "Run test module" + platform: ${{ platform }} + bazel: ${{ bazel }} + test_targets: + - "//..." diff --git a/.bcr/source.template.json b/.bcr/source.template.json new file mode 100644 index 00000000..20374716 --- /dev/null +++ b/.bcr/source.template.json @@ -0,0 +1,5 @@ +{ + "integrity": "", + "strip_prefix": "{REPO}-{VERSION}", + "url": "https://github.com/{OWNER}/{REPO}/releases/download/{TAG}/{REPO}-{TAG}.tar.gz" +} diff --git a/.github/workflows/publish_to_bcr.yaml b/.github/workflows/publish_to_bcr.yaml new file mode 100644 index 00000000..43e11599 --- /dev/null +++ b/.github/workflows/publish_to_bcr.yaml @@ -0,0 +1,28 @@ +on: + # Run the publish workflow after a successful release. + workflow_call: + inputs: + tag_name: + required: true + type: string + + # Allow manual triggering of the workflow. + workflow_dispatch: + inputs: + tag_name: + required: true + type: string + +jobs: + publish: + uses: bazel-contrib/publish-to-bcr/.github/workflows/publish.yaml@[version] + with: + tag_name: ${{ inputs.tag_name }} + # GitHub repository which is a fork of the upstream where the Pull Request will be opened. + registry_fork: ArthurSonzogni/bazel-central-registry + permissions: + attestations: write + contents: write + id-token: write + secrets: + publish_token: ${{ secrets.PUBLISH_TOKEN }} diff --git a/.gitignore b/.gitignore index 3b71c497..a3820005 100644 --- a/.gitignore +++ b/.gitignore @@ -35,6 +35,7 @@ out/ # bazel directory: !bazel/**/*.bzl +!.bcr/* # doc directory: !doc/**/Doxyfile.in diff --git a/MODULE.bazel b/MODULE.bazel index 503fe36e..b26b6c95 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -1,3 +1,7 @@ +# Copyright 2025 Arthur Sonzogni. All rights reserved. +# Use of this source code is governed by the MIT license that can be found in +# the LICENSE file. + # FTXUI Module. module(name = "ftxui", version = "6.0.3") diff --git a/WORKSPACE.bazel b/WORKSPACE.bazel index 945e96dd..1c3bb376 100644 --- a/WORKSPACE.bazel +++ b/WORKSPACE.bazel @@ -1 +1,4 @@ +# Copyright 2025 Arthur Sonzogni. All rights reserved. +# Use of this source code is governed by the MIT license that can be found in +# the LICENSE file. workspace(name = "ftxui")