Skip to content

Commit 3b3195e

Browse files
authored
add msrv badge + script to generate it (#680)
* add msrv badge + script to generate it Signed-off-by: clux <[email protected]> * use jq select Signed-off-by: clux <[email protected]>
1 parent 4eb11f7 commit 3b3195e

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
[![Client Capabilities](https://img.shields.io/badge/Kubernetes%20client-Silver-blue.svg?style=plastic&colorB=C0C0C0&colorA=306CE8)](http://bit.ly/kubernetes-client-capabilities-badge)
55
[![Client Support Level](https://img.shields.io/badge/kubernetes%20client-beta-green.svg?style=plastic&colorA=306CE8)](http://bit.ly/kubernetes-client-support-badge)
66
[![Crates.io](https://img.shields.io/crates/v/kube.svg)](https://crates.io/crates/kube)
7+
[![Rust 1.56](https://img.shields.io/badge/MSRV-1.56-dea584.svg)](https://github.com/rust-lang/rust/releases/tag/1.56.0)
78
[![Discord chat](https://img.shields.io/discord/500028886025895936.svg?logo=discord&style=plastic)](https://discord.gg/tokio)
89

910
Rust client for [Kubernetes](http://kubernetes.io) in the style of a more generic [client-go](https://github.com/kubernetes/client-go), a runtime abstraction inspired by [controller-runtime](https://github.com/kubernetes-sigs/controller-runtime), and a derive macro for [CRDs](https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/) inspired by [kubebuilder](https://book.kubebuilder.io/reference/generating-crd.html).

scripts/msrv.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
set -euo pipefail
3+
4+
main() {
5+
local -r msrv="$(cargo msrv --output-format=json | jq -r 'select(.reason == "msrv-complete") | .msrv')"
6+
local -r badge="[![Rust ${msrv::-2}](https://img.shields.io/badge/MSRV-${msrv::-2}-dea584.svg)](https://github.com/rust-lang/rust/releases/tag/${msrv})"
7+
sd "^.+badge/MSRV.+$" "${badge}" README.md
8+
}
9+
10+
11+
# helper script to be run by users when bumping dependencies
12+
#
13+
# This script determines our msrv using cargo-msrv, and then
14+
# edits the badge in the README using `sd`.
15+
#
16+
# shellcheck disable=SC2068
17+
main $@

0 commit comments

Comments
 (0)