Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add rustc as requirement for cargo install #231

Merged
merged 5 commits into from
Mar 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 15 additions & 14 deletions .github/workflows/readme-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,29 @@ 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
id: run-msrv
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 }}
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,23 +41,25 @@ 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
xattr -d com.apple.quarantine mdq
```
- 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

<details>
<summary>Security concerns</summary>
Expand Down
Loading