Skip to content

Commit 03f6688

Browse files
committed
Cleanup other binary download steps
Be consistent and always use wget Signed-off-by: Joe Richey <[email protected]>
1 parent f84a061 commit 03f6688

File tree

1 file changed

+57
-20
lines changed

1 file changed

+57
-20
lines changed

.github/workflows/tests.yml

Lines changed: 57 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,19 @@ jobs:
1919
steps:
2020
- uses: actions/checkout@v3
2121
- uses: dtolnay/rust-toolchain@nightly # Needed for -Z minimal-versions and doc_cfg
22+
- uses: octokit/[email protected]
23+
id: latest
24+
with:
25+
route: GET /repos/deadlinks/cargo-deadlinks/releases/latest
26+
env:
27+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2228
- name: Install precompiled cargo-deadlinks
2329
run: |
24-
export URL=$(curl -s https://api.github.com/repos/deadlinks/cargo-deadlinks/releases/latest | jq -r '.assets[] | select(.name | contains("cargo-deadlinks-linux")) | .browser_download_url')
25-
wget -O /tmp/cargo-deadlinks $URL
26-
chmod +x /tmp/cargo-deadlinks
27-
mv /tmp/cargo-deadlinks ~/.cargo/bin
30+
VERSION=${{ fromJson(steps.latest.outputs.data).tag_name }}
31+
URL="https://github.com/deadlinks/cargo-deadlinks/releases/download/${VERSION}/cargo-deadlinks-linux"
32+
wget -O ~/.cargo/bin/cargo-deadlinks $URL
33+
chmod +x ~/.cargo/bin/cargo-deadlinks
34+
cargo deadlinks --version
2835
- uses: Swatinem/rust-cache@v2
2936
- name: Generate Docs
3037
env:
@@ -90,11 +97,17 @@ jobs:
9097
- uses: dtolnay/rust-toolchain@stable
9198
with:
9299
targets: x86_64-apple-ios
93-
- name: Download cargo-dinghy
100+
- uses: octokit/[email protected]
101+
id: latest
102+
with:
103+
route: GET /repos/sonos/dinghy/releases/latest
104+
env:
105+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
106+
- name: Install precompiled cargo-dinghy
94107
run: |
95-
VERSION=0.6.2
108+
VERSION=${{ fromJson(steps.latest.outputs.data).tag_name }}
96109
URL="https://github.com/sonos/dinghy/releases/download/${VERSION}/cargo-dinghy-macos-${VERSION}.tgz"
97-
curl -L $URL | tar -xz --strip-components=1 -C ~/.cargo/bin
110+
wget -O - $URL | tar -xz --strip-components=1 -C ~/.cargo/bin
98111
cargo dinghy --version
99112
- name: Setup Simulator
100113
run: |
@@ -137,12 +150,18 @@ jobs:
137150
]
138151
steps:
139152
- uses: actions/checkout@v3
153+
- uses: octokit/[email protected]
154+
id: latest
155+
with:
156+
route: GET /repos/cross-rs/cross/releases/latest
157+
env:
158+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
140159
- name: Install precompiled cross
141160
run: |
142-
export URL=$(curl -s https://api.github.com/repos/cross-rs/cross/releases/latest | jq -r '.assets[] | select(.name | contains("x86_64-unknown-linux-gnu.tar.gz")) | .browser_download_url')
143-
wget -O /tmp/binaries.tar.gz $URL
144-
tar -C /tmp -xzf /tmp/binaries.tar.gz
145-
mv /tmp/cross ~/.cargo/bin
161+
VERSION=${{ fromJson(steps.latest.outputs.data).tag_name }}
162+
URL=https://github.com/cross-rs/cross/releases/download/${VERSION}/cross-x86_64-unknown-linux-gnu.tar.gz
163+
wget -O - $URL | tar -xz -C ~/.cargo/bin
164+
cross --version
146165
- uses: Swatinem/rust-cache@v2
147166
- name: Test
148167
run: cross test --no-fail-fast --target=${{ matrix.target }} --features=std
@@ -174,12 +193,18 @@ jobs:
174193
]
175194
steps:
176195
- uses: actions/checkout@v3
196+
- uses: octokit/[email protected]
197+
id: latest
198+
with:
199+
route: GET /repos/cross-rs/cross/releases/latest
200+
env:
201+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
177202
- name: Install precompiled cross
178203
run: |
179-
export URL=$(curl -s https://api.github.com/repos/cross-rs/cross/releases/latest | jq -r '.assets[] | select(.name | contains("x86_64-unknown-linux-gnu.tar.gz")) | .browser_download_url')
180-
wget -O /tmp/binaries.tar.gz $URL
181-
tar -C /tmp -xzf /tmp/binaries.tar.gz
182-
mv /tmp/cross ~/.cargo/bin
204+
VERSION=${{ fromJson(steps.latest.outputs.data).tag_name }}
205+
URL=https://github.com/cross-rs/cross/releases/download/${VERSION}/cross-x86_64-unknown-linux-gnu.tar.gz
206+
wget -O - $URL | tar -xz -C ~/.cargo/bin
207+
cross --version
183208
- uses: Swatinem/rust-cache@v2
184209
- name: Build Tests
185210
run: cross test --no-run --target=${{ matrix.target }} --features=std
@@ -203,10 +228,16 @@ jobs:
203228
- uses: dtolnay/rust-toolchain@stable
204229
- run: choco install wget
205230
if: matrix.os == 'windows-latest'
231+
- uses: octokit/[email protected]
232+
id: latest
233+
with:
234+
route: GET /repos/rustwasm/wasm-pack/releases/latest
235+
env:
236+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
206237
- name: Install precompiled wasm-pack
207238
shell: bash
208239
run: |
209-
VERSION=$(wget -nv -O - https://api.github.com/repos/rustwasm/wasm-pack/releases/latest | jq -r '.tag_name')
240+
VERSION=${{ fromJson(steps.latest.outputs.data).tag_name }}
210241
URL=https://github.com/rustwasm/wasm-pack/releases/download/${VERSION}/wasm-pack-${VERSION}-${{ matrix.target }}.tar.gz
211242
wget -O - $URL | tar -xz --strip-components=1 -C ~/.cargo/bin
212243
wasm-pack --version
@@ -250,12 +281,18 @@ jobs:
250281
- uses: dtolnay/rust-toolchain@stable
251282
with:
252283
targets: wasm32-wasi
284+
- uses: octokit/[email protected]
285+
id: latest
286+
with:
287+
route: GET /repos/cross-rs/bytecodealliance/wasmtime/latest
288+
env:
289+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
253290
- name: Install precompiled wasmtime
254291
run: |
255-
export URL=$(curl -s https://api.github.com/repos/bytecodealliance/wasmtime/releases/latest | jq -r '.assets[] | select(.name | contains("x86_64-linux.tar.xz")) | .browser_download_url')
256-
wget -O /tmp/binaries.tar.xz $URL
257-
tar -C /tmp -xf /tmp/binaries.tar.xz --strip-components=1
258-
mv /tmp/wasmtime ~/.cargo/bin
292+
VERSION=${{ fromJson(steps.latest.outputs.data).tag_name }}
293+
URL=https://github.com/bytecodealliance/wasmtime/releases/download/${VERSION}/wasmtime-${VERSION}-x86_64-linux.tar.xz
294+
wget -O - $URL | tar -xJ --strip-components=1 -C ~/.cargo/bin
295+
wasmtime --version
259296
- uses: Swatinem/rust-cache@v2
260297
- run: cargo test --target wasm32-wasi
261298

0 commit comments

Comments
 (0)