Skip to content

Commit 64fef3b

Browse files
authored
Merge pull request #13 from actions-rust-lang/double-run
2 parents 9fa7c33 + cea2ca5 commit 64fef3b

File tree

2 files changed

+17
-9
lines changed

2 files changed

+17
-9
lines changed

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [1.4.3] - 2023-02-21
11+
12+
### Fixed
13+
14+
* Executing the action twice for different toolchains now no longer fails around unstable features #12.
15+
If multiple toolchains are installed, the "CARGO_REGISTRIES_CRATES_IO_PROTOCOL" can be downgraded to "git" if any of the installed toolchains require it.
16+
1017
## [1.4.2] - 2023-02-15
1118

1219
### Fixed

action.yml

+10-9
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@ runs:
8585
if [[ ! -v CARGO_UNSTABLE_SPARSE_REGISTRY ]]; then
8686
echo "CARGO_UNSTABLE_SPARSE_REGISTRY=true" >> $GITHUB_ENV
8787
fi
88+
if [[ ! -v CARGO_REGISTRIES_CRATES_IO_PROTOCOL ]]; then
89+
echo "CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse" >> $GITHUB_ENV
90+
fi
8891
shell: bash
8992
- name: "Install Rust Problem Matcher"
9093
run: echo "::add-matcher::${{ github.action_path }}/rust.json"
@@ -126,17 +129,15 @@ runs:
126129
echo "cachekey=$(echo $DATE$HASH | head -c12)" >> $GITHUB_OUTPUT
127130
shell: bash
128131

129-
# Copied from dtolnay/rust-toolchain and adapted
130-
# https://github.com/dtolnay/rust-toolchain/blob/25dc93b901a87e864900a8aec6c12e9aa794c0c3/action.yml#L100-L108
131-
- name: "Enable cargo sparse registry on stable"
132+
- name: "Downgrade registry access protocol when needed"
132133
run: |
133-
# except on 1.66 and 1.67, on which it is unstable
134-
# Not all 1.68.0-nightly versions support it either
134+
# Not all versions support setting CARGO_REGISTRIES_CRATES_IO_PROTOCOL
135+
# On versions 1.66, 1.67, and 1.68.0-nightly the value "sparse" is still unstable.
135136
# https://github.com/dtolnay/rust-toolchain/pull/69#discussion_r1107268108
136-
if [[ ! -v CARGO_REGISTRIES_CRATES_IO_PROTOCOL ]]; then
137-
if echo "${{steps.versions.outputs.rustc-version}}" | grep --invert --quiet '^rustc \(1\.6[67]\.\|1\.68\.0-nightly\)'; then
138-
echo "CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse" >> $GITHUB_ENV
139-
fi
137+
# If we detect an incompatible value, set it to "git" which is always supported.
138+
if [[ "${{steps.versions.outputs.rustc-version}}" =~ ^rustc\ (1\.6[67]\.|1\.68\.0-nightly) && "${CARGO_REGISTRIES_CRATES_IO_PROTOCOL}" == "sparse" ]]; then
139+
echo "Downgrade cargo registry protocol to git"
140+
echo "CARGO_REGISTRIES_CRATES_IO_PROTOCOL=git" >> $GITHUB_ENV
140141
fi
141142
shell: bash
142143

0 commit comments

Comments
 (0)