fix workflow

This commit is contained in:
Julian Chang 2026-08-05 05:09:38 +07:00
parent 76e7c2ca7e
commit 413931eb74
No known key found for this signature in database

View file

@ -17,9 +17,13 @@ runs:
- name: Check for an already-installed ${{ inputs.tool }} - name: Check for an already-installed ${{ inputs.tool }}
id: check id: check
shell: bash shell: bash
env:
TOOL: ${{ inputs.tool }}
VERSION: ${{ inputs.version }}
run: | run: |
if cargo install --list | grep -qF "${{ inputs.tool }} v${{ inputs.version }}:"; then if command -v "$TOOL" > /dev/null 2>&1 \
echo "Found ${{ inputs.tool }} v${{ inputs.version }} in \$CARGO_HOME/bin" && cargo install --list | grep -qF "$TOOL v$VERSION:"; then
echo "Found $TOOL v$VERSION in \$CARGO_HOME/bin"
echo "installed=true" >> "$GITHUB_OUTPUT" echo "installed=true" >> "$GITHUB_OUTPUT"
else else
echo "installed=false" >> "$GITHUB_OUTPUT" echo "installed=false" >> "$GITHUB_OUTPUT"
@ -39,5 +43,5 @@ runs:
# Prebuilt download takes seconds; building cargo-packager from source # Prebuilt download takes seconds; building cargo-packager from source
# takes minutes on every leg of the matrix. Fall back to a source build # takes minutes on every leg of the matrix. Fall back to a source build
# so a missing prebuilt artifact can never break a release. # so a missing prebuilt artifact can never break a release.
cargo binstall --no-confirm "${TOOL}@${VERSION}" \ cargo binstall --no-confirm --force "${TOOL}@${VERSION}" \
|| cargo install "${TOOL}" --version "${VERSION}" --locked || cargo install "${TOOL}" --version "${VERSION}" --locked --force