From 4590768e530a470a8fb8917dafee69932831c854 Mon Sep 17 00:00:00 2001 From: Guillaume Chatelet Date: Fri, 13 Jan 2023 09:57:59 +0000 Subject: [PATCH] Fix badges in README.md --- README.md | 22 +++++++++++----------- scripts/generate_badges.d | 16 +++++++++------- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 91ef3f0..9d2aeb0 100644 --- a/README.md +++ b/README.md @@ -16,17 +16,17 @@ instructions) at runtime. [d0]: https://img.shields.io/badge/CMake-N%2FA-lightgrey [d1]: https://img.shields.io/badge/Bazel-N%2FA-lightgrey -[i1a0]: https://img.shields.io/github/workflow/status/google/cpu_features/amd64%20Linux%20CMake/main?label=CMake -[i1a1]: https://img.shields.io/github/workflow/status/google/cpu_features/amd64%20Linux%20Bazel/main?label=Bazel -[i1b0]: https://img.shields.io/github/workflow/status/google/cpu_features/AArch64%20Linux%20CMake/main?label=CMake -[i1c0]: https://img.shields.io/github/workflow/status/google/cpu_features/ARM%20Linux%20CMake/main?label=CMake -[i1d0]: https://img.shields.io/github/workflow/status/google/cpu_features/MIPS%20Linux%20CMake/main?label=CMake -[i1e0]: https://img.shields.io/github/workflow/status/google/cpu_features/POWER%20Linux%20CMake/main?label=CMake -[i1f0]: https://img.shields.io/github/workflow/status/google/cpu_features/RISCV%20Linux%20CMake/main?label=CMake -[i1g0]: https://img.shields.io/github/workflow/status/google/cpu_features/s390x%20Linux%20CMake/main?label=CMake -[i2a0]: https://img.shields.io/github/workflow/status/google/cpu_features/amd64%20FreeBSD%20CMake/main?label=CMake -[i3a0]: https://img.shields.io/github/workflow/status/google/cpu_features/amd64%20MacOS%20CMake/main?label=CMake -[i4a0]: https://img.shields.io/github/workflow/status/google/cpu_features/amd64%20Windows%20CMake/main?label=CMake +[i1a0]: https://img.shields.io/github/actions/workflow/status/google/cpu_features/amd64_linux_cmake.yml?branch=main&label=CMake +[i1a1]: https://img.shields.io/github/actions/workflow/status/google/cpu_features/amd64_linux_bazel.yml?branch=main&label=Bazel +[i1b0]: https://img.shields.io/github/actions/workflow/status/google/cpu_features/aarch64_linux_cmake.yml?branch=main&label=CMake +[i1c0]: https://img.shields.io/github/actions/workflow/status/google/cpu_features/arm_linux_cmake.yml?branch=main&label=CMake +[i1d0]: https://img.shields.io/github/actions/workflow/status/google/cpu_features/mips_linux_cmake.yml?branch=main&label=CMake +[i1e0]: https://img.shields.io/github/actions/workflow/status/google/cpu_features/power_linux_cmake.yml?branch=main&label=CMake +[i1f0]: https://img.shields.io/github/actions/workflow/status/google/cpu_features/riscv_linux_cmake.yml?branch=main&label=CMake +[i1g0]: https://img.shields.io/github/actions/workflow/status/google/cpu_features/s390x_linux_cmake.yml?branch=main&label=CMake +[i2a0]: https://img.shields.io/github/actions/workflow/status/google/cpu_features/amd64_freebsd_cmake.yml?branch=main&label=CMake +[i3a0]: https://img.shields.io/github/actions/workflow/status/google/cpu_features/amd64_macos_cmake.yml?branch=main&label=CMake +[i4a0]: https://img.shields.io/github/actions/workflow/status/google/cpu_features/amd64_windows_cmake.yml?branch=main&label=CMake [l1a0]: https://github.com/google/cpu_features/actions/workflows/amd64_linux_cmake.yml [l1a1]: https://github.com/google/cpu_features/actions/workflows/amd64_linux_bazel.yml [l1b0]: https://github.com/google/cpu_features/actions/workflows/aarch64_linux_cmake.yml diff --git a/scripts/generate_badges.d b/scripts/generate_badges.d index 1cb8159..bf5aa54 100644 --- a/scripts/generate_badges.d +++ b/scripts/generate_badges.d @@ -82,20 +82,22 @@ const: return format("%s: https://img.shields.io/badge/%s-N%%2FA-lightgrey", disabled_image_ref, build_system); } - string link_decl() + string filename() { import std.uni : toLower; - const filename = toLower(format("%s_%s_%s.yml", cpu, os, build_system)); - return format("%s: https://github.com/google/cpu_features/actions/workflows/%s", link_ref, filename); + return toLower(format("%s_%s_%s.yml", cpu, os, build_system)); + } + + string link_decl() + { + return format("%s: https://github.com/google/cpu_features/actions/workflows/%s", link_ref, filename()); } string image_decl() { - import std.uri : encode; - - const worflow_name = encode(format("%s %s %s", cpu, os, build_system)); - return format("%s: https://img.shields.io/github/workflow/status/google/cpu_features/%s/main?label=%s", image_ref, worflow_name, build_system); + return format( + "%s: https://img.shields.io/github/actions/workflow/status/google/cpu_features/%s?branch=main&label=%s", image_ref, filename(), build_system); } }