From 97db979bf844c838b06022f305ca480d01b4d5fe Mon Sep 17 00:00:00 2001 From: Jonas Bushart Date: Mon, 21 Oct 2024 23:54:51 +0200 Subject: [PATCH 1/7] Specify dependencies in README --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 12aca64..605859d 100644 --- a/README.md +++ b/README.md @@ -88,6 +88,16 @@ You can read more rustflags, and their load order, in the [Cargo reference]. | `rustup-version` | Version as reported by `rustup --version` | | `cachekey` | A short hash of the installed rustc version | +## Dependencies + +The action works best on the GitHub-hosted runners, but can work on self-hosted ones too, provided the necessary dependencies are available. +PRs to add support for more environments are welcome. + +* bash 5 +* brew (macOS only) +* rustup or curl (Linux and macOS) +* using other node actions + ## License The scripts and documentation in this project are released under the [MIT From f8efd60d2dea71cf378cafb3f494ecf103ae1179 Mon Sep 17 00:00:00 2001 From: skanehira Date: Sat, 8 Feb 2025 01:22:20 +0900 Subject: [PATCH 2/7] feat: add shared-cache-key to inputs --- README.md | 1 + action.yml | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/README.md b/README.md index 605859d..209e5d3 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,7 @@ Afterward, the `components` and `target` specified via inputs are installed in a | `cache-workspaces` | Propagates the value to [`Swatinem/rust-cache`] | | | `cache-on-failure` | Propagates the value to [`Swatinem/rust-cache`] | true | | `cache-key` | Propagates the value to [`Swatinem/rust-cache`] as `key` | | +| `shared-cache-key` | Propagates the value to [`Swatinem/rust-cache`] as `shared-key` | | | `matcher` | Enable problem matcher to surface build messages and formatting issues | true | | `rustflags` | Set the value of `RUSTFLAGS` (set to empty string to avoid overwriting existing flags) | "-D warnings" | | `override` | Setup the last installed toolchain as the default via `rustup override` | true | diff --git a/action.yml b/action.yml index 21ef752..df6946e 100644 --- a/action.yml +++ b/action.yml @@ -38,6 +38,9 @@ inputs: cache-key: description: "An additional cache key that is added alongside the automatic `job`-based cache key and can be used to further differentiate jobs." required: false + shared-cache-key: + description: "A cache key that is used instead of the automatic `job`-based key, and is stable over multiple jobs." + required: false matcher: description: "Enable the Rust problem matcher" required: false @@ -200,3 +203,4 @@ runs: cache-directories: ${{inputs.cache-directories}} cache-on-failure: ${{inputs.cache-on-failure}} key: ${{inputs.cache-key}} + shared-key: ${{inputs.shared-cache-key}} From 30081c4da55e5f2a707c228afc2c7d6f422a676c Mon Sep 17 00:00:00 2001 From: Enkhjil Enkhbaatar Date: Tue, 4 Feb 2025 15:13:57 +0900 Subject: [PATCH 3/7] fix: add cache-bin input with true as default value --- README.md | 1 + action.yml | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/README.md b/README.md index 605859d..60f0b0d 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,7 @@ Afterward, the `components` and `target` specified via inputs are installed in a | `cache-workspaces` | Propagates the value to [`Swatinem/rust-cache`] | | | `cache-on-failure` | Propagates the value to [`Swatinem/rust-cache`] | true | | `cache-key` | Propagates the value to [`Swatinem/rust-cache`] as `key` | | +| `cache-bin` | Propagates the value to [`Swatinem/rust-cache`] | | | `matcher` | Enable problem matcher to surface build messages and formatting issues | true | | `rustflags` | Set the value of `RUSTFLAGS` (set to empty string to avoid overwriting existing flags) | "-D warnings" | | `override` | Setup the last installed toolchain as the default via `rustup override` | true | diff --git a/action.yml b/action.yml index 21ef752..1befac2 100644 --- a/action.yml +++ b/action.yml @@ -38,6 +38,10 @@ inputs: cache-key: description: "An additional cache key that is added alongside the automatic `job`-based cache key and can be used to further differentiate jobs." required: false + cache-bin: + description: "Determines whether to cache ${CARGO_HOME}/bin." + required: false + default: "true" matcher: description: "Enable the Rust problem matcher" required: false @@ -199,4 +203,5 @@ runs: workspaces: ${{inputs.cache-workspaces}} cache-directories: ${{inputs.cache-directories}} cache-on-failure: ${{inputs.cache-on-failure}} + cache-bin: ${{inputs.cache-bin}} key: ${{inputs.cache-key}} From 6cbea1a7947962ed471795015128faa83769af2d Mon Sep 17 00:00:00 2001 From: Rob Ede Date: Mon, 24 Feb 2025 02:18:45 +0000 Subject: [PATCH 4/7] chore: prepare release 1.11.0 --- CHANGELOG.md | 5 +++++ README.md | 2 +- action.yml | 4 ++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ac8d9f..25142be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.11.0] - 2025-02-24 + +* Add new parameter `cache-bin` that is propagated to `Swatinem/rust-cache` as `cache-bin` (#51 by @enkhjile) +* Add new parameter `cache-shared-key` that is propagated to `Swatinem/rust-cache` as `shared-key` (#52 by @skanehira) + ## [1.10.1] - 2024-10-01 * Fix problem matcher for rustfmt output. diff --git a/README.md b/README.md index 209e5d3..10e7bb2 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ Afterward, the `components` and `target` specified via inputs are installed in a | `cache-workspaces` | Propagates the value to [`Swatinem/rust-cache`] | | | `cache-on-failure` | Propagates the value to [`Swatinem/rust-cache`] | true | | `cache-key` | Propagates the value to [`Swatinem/rust-cache`] as `key` | | -| `shared-cache-key` | Propagates the value to [`Swatinem/rust-cache`] as `shared-key` | | +| `cache-shared-key` | Propagates the value to [`Swatinem/rust-cache`] as `shared-key` | | | `matcher` | Enable problem matcher to surface build messages and formatting issues | true | | `rustflags` | Set the value of `RUSTFLAGS` (set to empty string to avoid overwriting existing flags) | "-D warnings" | | `override` | Setup the last installed toolchain as the default via `rustup override` | true | diff --git a/action.yml b/action.yml index df6946e..f829e66 100644 --- a/action.yml +++ b/action.yml @@ -38,7 +38,7 @@ inputs: cache-key: description: "An additional cache key that is added alongside the automatic `job`-based cache key and can be used to further differentiate jobs." required: false - shared-cache-key: + cache-shared-key: description: "A cache key that is used instead of the automatic `job`-based key, and is stable over multiple jobs." required: false matcher: @@ -203,4 +203,4 @@ runs: cache-directories: ${{inputs.cache-directories}} cache-on-failure: ${{inputs.cache-on-failure}} key: ${{inputs.cache-key}} - shared-key: ${{inputs.shared-cache-key}} + shared-key: ${{inputs.cache-shared-key}} From d9c91b20fd575d8e7998826de9744357e3a7a903 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonatan=20M=C3=A4nnchen?= Date: Wed, 23 Apr 2025 16:16:31 +0200 Subject: [PATCH 5/7] Support rustup installation for Windows --- action.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index d3aecfe..ca44c3d 100644 --- a/action.yml +++ b/action.yml @@ -130,13 +130,20 @@ runs: run: echo "::add-matcher::${{ github.action_path }}/rust.json" - name: Install rustup, if needed - if: runner.os != 'Windows' shell: bash run: | if ! command -v rustup &> /dev/null ; then curl --proto '=https' --tlsv1.2 --retry 10 --retry-connrefused -fsSL "https://sh.rustup.rs" | sh -s -- --default-toolchain none -y - echo "${CARGO_HOME:-$HOME/.cargo}/bin" >> $GITHUB_PATH + + # Resolve the correct CARGO_HOME path depending on OS + if [[ "$RUNNER_OS" == "Windows" ]]; then + echo "${CARGO_HOME:-$USERPROFILE/.cargo}/bin" | sed 's|/|\\|g' >> $GITHUB_PATH + else + echo "${CARGO_HOME:-$HOME/.cargo}/bin" >> $GITHUB_PATH + fi fi + env: + RUNNER_OS: "${{ runner.os }}" - name: rustup toolchain install ${{inputs.toolchain || 'stable'}} env: From 9988a3d74bdbde17eac1e61264c78dea69889540 Mon Sep 17 00:00:00 2001 From: Jonas Bushart Date: Wed, 23 Apr 2025 22:42:15 +0200 Subject: [PATCH 6/7] Update the dependency section to mark the new windows rustup support --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index cfbf823..6f8a15c 100644 --- a/README.md +++ b/README.md @@ -97,7 +97,7 @@ PRs to add support for more environments are welcome. * bash 5 * brew (macOS only) -* rustup or curl (Linux and macOS) +* rustup or curl * using other node actions ## License From 9d7e65c320fdb52dcd45ffaa68deb6c02c8754d9 Mon Sep 17 00:00:00 2001 From: Jonas Bushart Date: Wed, 23 Apr 2025 22:46:51 +0200 Subject: [PATCH 7/7] Update changelog for windows support --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 25142be..a637784 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.12.0] - 2025-04-23 + +* Add support for installing rustup on Windows (#58 by @maennchen) + This adds support for using Rust on the GitHub provided Windows ARM runners. + ## [1.11.0] - 2025-02-24 * Add new parameter `cache-bin` that is propagated to `Swatinem/rust-cache` as `cache-bin` (#51 by @enkhjile)