Skip to content

Commit 66c6591

Browse files
authored
Fetch the cargo-dist binary directly instead of using the installer (#18731)
1 parent 4faa20e commit 66c6591

2 files changed

Lines changed: 18 additions & 4 deletions

File tree

.github/workflows/check-release.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
on:
22
workflow_call:
33

4+
env:
5+
CARGO_DIST_VERSION: "0.31.0"
6+
CARGO_DIST_CHECKSUM: "cd355dab0b4c02fb59038fef87655550021d07f45f1d82f947a34ef98560abb8"
7+
48
jobs:
59
dist-plan:
610
name: "dist plan"
@@ -15,7 +19,11 @@ jobs:
1519

1620
- name: Install dist
1721
shell: bash
18-
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.31.0/cargo-dist-installer.sh | sh"
22+
run: |
23+
curl --proto '=https' --tlsv1.2 -LsSf "https://github.com/axodotdev/cargo-dist/releases/download/v${CARGO_DIST_VERSION}/cargo-dist-x86_64-unknown-linux-gnu.tar.xz" -o /tmp/cargo-dist.tar.xz
24+
echo "${CARGO_DIST_CHECKSUM} /tmp/cargo-dist.tar.xz" | sha256sum -c -
25+
tar -xf /tmp/cargo-dist.tar.xz -C /tmp
26+
install /tmp/cargo-dist-x86_64-unknown-linux-gnu/dist ~/.cargo/bin/
1927
2028
- name: Run dist plan
2129
run: |

.github/workflows/release.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ on:
4747
default: dry-run
4848
type: string
4949

50+
env:
51+
CARGO_DIST_VERSION: "0.31.0"
52+
CARGO_DIST_CHECKSUM: "cd355dab0b4c02fb59038fef87655550021d07f45f1d82f947a34ef98560abb8"
53+
5054
jobs:
5155
# Run 'dist plan' (or host) to determine what tasks we need to do
5256
plan:
@@ -64,10 +68,12 @@ jobs:
6468
persist-credentials: false
6569
submodules: recursive
6670
- name: Install dist
67-
# we specify bash to get pipefail; it guards against the `curl` command
68-
# failing. otherwise `sh` won't catch that `curl` returned non-0
6971
shell: bash
70-
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.31.0/cargo-dist-installer.sh | sh"
72+
run: |
73+
curl --proto '=https' --tlsv1.2 -LsSf "https://github.com/axodotdev/cargo-dist/releases/download/v${CARGO_DIST_VERSION}/cargo-dist-x86_64-unknown-linux-gnu.tar.xz" -o /tmp/cargo-dist.tar.xz
74+
echo "${CARGO_DIST_CHECKSUM} /tmp/cargo-dist.tar.xz" | sha256sum -c -
75+
tar -xf /tmp/cargo-dist.tar.xz -C /tmp
76+
install /tmp/cargo-dist-x86_64-unknown-linux-gnu/dist ~/.cargo/bin/
7177
- name: Cache dist
7278
uses: actions/upload-artifact@6027e3dd177782cd8ab9af838c04fd81a07f1d47
7379
with:

0 commit comments

Comments
 (0)