diff --git a/.github/workflows/readme-checks.yml b/.github/workflows/readme-checks.yml index 92dccbd..18d0f15 100644 --- a/.github/workflows/readme-checks.yml +++ b/.github/workflows/readme-checks.yml @@ -14,12 +14,6 @@ jobs: steps: - uses: actions/checkout@v4 - run: docker pull yshavit/mdq - - name: find version mentioned in readme - id: readme-version - run: | - set -euo pipefail - readme_version="$(cat README.md | docker run -i --rm yshavit/mdq '# Development | P: "Requires rustc >=" ' | awk '{print $NF}')" - echo "result=$readme_version" >> "$GITHUB_OUTPUT" - name: pull cargo-msrv from docker hub run: docker pull foresterre/cargo-msrv - name: find minimum supported rust version @@ -27,15 +21,22 @@ jobs: run: | set -euo pipefail min_version="$(docker run --rm -t -v "$PWD/":/app/ foresterre/cargo-msrv find --no-log --output-format minimal | tr -d $'\r\n')" + echo "::notice title=cargo-msrv::$min_version" echo "result=$min_version" >> "$GITHUB_OUTPUT" - - name: compare versions + - name: check versions in readme + id: readme-version run: | - echo "::notice title=cargo-msrv::$MSRV_VERSION" - echo "::notice title=README.md-msrv::$README_VERSION" - if [[ "$MSRV_VERSION" != "$README_VERSION" ]]; then - echo "::error title=msrv-mismatch::cargo-msrv was $MSRV_VERSION but README.md says rustc >= $README_VERSION" - exit 1 - fi + set -euo pipefail + exit_code=0 + while IFS=: read -r file line_no version_contents; do + found_rustc_version="${version_contents//rustc >= /}" + if [[ "$found_rustc_version" == "$MSRV_VERSION" ]]; then + echo "::notice file=$file,line=$line_no,title=version::✅ $found_rustc_version" + else + echo "::error file=$file,line=$line_no,title=version::$found_rustc_version should have been $MSRV_VERSION" + exit_code=1 + fi + done <<<"$(grep -HnoE 'rustc >= \S+' README.md)" + exit "$exit_code" env: MSRV_VERSION: ${{ steps.run-msrv.outputs.result }} - README_VERSION: ${{ steps.readme-version.outputs.result }} diff --git a/README.md b/README.md index d32aa8b..6a19158 100644 --- a/README.md +++ b/README.md @@ -41,16 +41,14 @@ have one you prefer. Any of these will work: 1. ```shell - cargo install --git https://github.com/yshavit/mdq - ``` -2. ```shell + # (Mac and Linux, with brew installed) brew install mdq ``` -3. ```bash +1. ```bash docker pull yshavit/mdq echo 'My [example](https://github.com/yshavit/mdq) markdown' | docker run --rm -i yshavit/mdq '[]()' ``` -4. Download binaries from [the latest release] (or any other release, of course). +1. Download binaries from [the latest release] (or any other release, of course). - Macs quarantine downloads from the internet by default. If you get an error saying that Apple cannot check the the binary for malicious software, you can remove this flag by running the following on the binary after extracting it from the artifact zip: ```bash @@ -58,6 +56,10 @@ Any of these will work: ``` - You can also grab the binaries from the latest [build-release] workflow run. You must be logged into GitHub to do that (this is GitHub's limitation, not mine). You'll have to `chmod +x` them before you can run them. +1. ```shell + cargo install --git https://github.com/yshavit/mdq + ``` + Requires rustc >= 1.78.0
Security concerns