Skip to content

ci: use cargo info to retrieve latest mise version#5401

Merged
jdx merged 1 commit into
jdx:mainfrom
risu729:fix-release
Jun 23, 2025
Merged

ci: use cargo info to retrieve latest mise version#5401
jdx merged 1 commit into
jdx:mainfrom
risu729:fix-release

Conversation

@risu729

@risu729 risu729 commented Jun 22, 2025

Copy link
Copy Markdown
Contributor

I'm not sure if this will work, but it might work.
--registry "crates-io" avoids printing the local mise verison, and --color never avoids printing ANSI color codes.

cargo info --registry "crates-io" --color never --quiet mise | grep "^version:" | cut -d' ' -f2

@risu729

risu729 commented Jun 22, 2025

Copy link
Copy Markdown
Contributor Author

I got it. Usually the color is disabled when using pipes, but it is forcibly enabled with CARGO_TERM_COLOR: always in the workflow level.

CARGO_TERM_COLOR: always

Then grep cannot match the line since it uses ^, but the line starts with the ANSI code.

I can confirm it only works with --color never if CARGO_TERM_COLOR=always is set.

$ cargo info --registry "crates-io" --color never --quiet mise | grep "^version:" | cut -d' ' -f2
2025.6.5
$ CARGO_TERM_COLOR=always cargo info --registry "crates-io" --color never --quiet mise | grep "^version:" | cut -d' ' -f2
2025.6.5
$ CARGO_TERM_COLOR=always cargo info --registry "crates-io" --quiet mise | grep "^version:" | cut -d' ' -f2

@risu729

risu729 commented Jun 22, 2025

Copy link
Copy Markdown
Contributor Author

The original implementation before 729aadc was:

curl -fSs https://crates.io/api/v1/crates/mise | jq -r '.versions[0].num'

However it fails even in my local environment with curl: (22) The requested URL returned error: 403, so I guess they changed something.

@roele

roele commented Jun 22, 2025

Copy link
Copy Markdown
Contributor

Odd the curl variant still works for me locally...

curl -fSs https://crates.io/api/v1/crates/mise | jq -r '.versions[0].num'
2025.6.5

@jdx jdx merged commit eb1c5e5 into jdx:main Jun 23, 2025
19 checks passed
@jdx

jdx commented Jun 23, 2025

Copy link
Copy Markdown
Owner

yeah the curl way works for me locally too but not on gha

@jdx

jdx commented Jun 23, 2025

Copy link
Copy Markdown
Owner

what's weird is it was working until a few days ago

@risu729 risu729 deleted the fix-release branch June 23, 2025 02:28
jdx pushed a commit that referenced this pull request Jun 23, 2025
### 🚀 Features

- **(registry)** add wash by [@jtakakura](https://github.com/jtakakura)
in [#5386](#5386)

### 🐛 Bug Fixes

- **(aqua)** parse consecutive pipes in aqua templates by
[@risu729](https://github.com/risu729) in
[#5385](#5385)
- **(aqua)** use versions list to install correct version by
[@risu729](https://github.com/risu729) in
[#5371](#5371)
- **(registry)** talosctl use aqua by
[@mangkoran](https://github.com/mangkoran) in
[#5348](#5348)
- **(registry)** use aqua backend for watchexec by
[@risu729](https://github.com/risu729) in
[#5390](#5390)
- **(shim)** improve resolve_symlink for Windows by
[@qianlongzt](https://github.com/qianlongzt) in
[#5361](#5361)
- add compression-zip-deflate feature on self_update crate for windows
target by [@roele](https://github.com/roele) in
[#5391](#5391)
- suppress hint on 'cargo search mise' command by
[@roele](https://github.com/roele) in
[#5400](#5400)

### 📚 Documentation

- Fix typo in README.md - Install mise by
[@cytsai1008](https://github.com/cytsai1008) in
[#5366](#5366)
- Document trivial task syntax by
[@JayBazuzi](https://github.com/JayBazuzi) in
[#5352](#5352)

### 🧪 Testing

- **(registry)** fix vultr test by
[@risu729](https://github.com/risu729) in
[#5372](#5372)

### 📦️ Dependency Updates

- update autofix-ci/action action to v1.3.2 by
[@renovate[bot]](https://github.com/renovate[bot]) in
[#5377](#5377)
- update docker/setup-buildx-action digest to e468171 by
[@renovate[bot]](https://github.com/renovate[bot]) in
[#5376](#5376)

### Chore

- update expr-lang crate to v0.3.2 by
[@risu729](https://github.com/risu729) in
[#5364](#5364)
- show curl error by [@jdx](https://github.com/jdx) in
[729aa4a](729aa4a)
- fix latest version fetch by [@jdx](https://github.com/jdx) in
[729aadc](729aadc)
- update vfox.rs crate to v1.0.3 by
[@risu729](https://github.com/risu729) in
[#5393](#5393)
- updated deps by [@jdx](https://github.com/jdx) in
[#5403](#5403)

### Ci

- use cargo info to retrieve latest mise version by
[@risu729](https://github.com/risu729) in
[#5401](#5401)

### New Contributors

- @jtakakura made their first contribution in
[#5386](#5386)
- @JayBazuzi made their first contribution in
[#5352](#5352)
- @cytsai1008 made their first contribution in
[#5366](#5366)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants