3
0
Fork 0
mirror of https://github.com/dtolnay/install.git synced 2025-01-31 15:11:22 +01:00
cargo-install/action.yml

32 lines
1.4 KiB
YAML
Raw Normal View History

name: cargo install
author: David Tolnay
description: Fast `cargo install` action using a GitHub-based binary cache
inputs:
2025-01-28 19:04:42 -08:00
github_token:
2025-01-28 21:51:56 -08:00
description: Access token for connecting to GitHub API for artifact attestation; normally the ephemeral {{github.token}} when used in a GitHub workflow, or a personal access token {{secrets.GH_TOKEN}} in Gitea's act runner
2025-01-28 19:04:42 -08:00
default: ${{github.token}}
runs:
using: composite
steps:
- name: Check inputs
run: |
2023-03-26 17:15:09 -07:00
echo "crate=cargo-afl" >> $GITHUB_OUTPUT
echo "bin=cargo-afl" >> $GITHUB_OUTPUT
shell: bash
id: inputs
- name: Determine cargo bin directory
run: echo "dir=$(dirname $(which cargo))" >> $GITHUB_OUTPUT
shell: bash
id: cargo
- name: Download ${{steps.inputs.outputs.bin}}
run: curl --output ${{steps.cargo.outputs.dir}}/${{steps.inputs.outputs.bin}} https://github.com/dtolnay/install/releases/download/${{steps.inputs.outputs.crate}}/${{steps.inputs.outputs.bin}} --location --silent --show-error --fail --retry 5
shell: bash
2025-01-26 13:20:09 -08:00
- name: Verify artifact attestation
run: gh attestation verify --owner dtolnay ${{steps.cargo.outputs.dir}}/${{steps.inputs.outputs.bin}}
env:
2025-01-28 19:04:42 -08:00
GH_TOKEN: ${{inputs.github_token}}
2025-01-26 13:20:09 -08:00
shell: bash
- name: Set executable bit
run: chmod +x ${{steps.cargo.outputs.dir}}/${{steps.inputs.outputs.bin}}
shell: bash