2021-10-08 04:51:09 +02:00
|
|
|
name: cargo install
|
|
|
|
author: David Tolnay
|
|
|
|
description: Fast `cargo install` action using a GitHub-based binary cache
|
|
|
|
inputs:
|
|
|
|
crate:
|
|
|
|
description: Name of crate as published to crates.io
|
|
|
|
required: true
|
|
|
|
bin:
|
|
|
|
description: Name of binary; default = same as crate name
|
|
|
|
required: false
|
|
|
|
runs:
|
|
|
|
using: composite
|
|
|
|
steps:
|
2024-04-14 19:08:49 +02:00
|
|
|
- name: Check inputs
|
|
|
|
run: |
|
|
|
|
echo "crate=${{inputs.crate}}" >> $GITHUB_OUTPUT
|
|
|
|
echo "bin=${{inputs.bin || inputs.crate}}" >> $GITHUB_OUTPUT
|
|
|
|
shell: bash
|
|
|
|
id: inputs
|
2021-10-08 04:51:09 +02:00
|
|
|
- name: Determine cargo bin directory
|
2022-10-13 18:35:44 +02:00
|
|
|
run: echo "dir=$(dirname $(which cargo))" >> $GITHUB_OUTPUT
|
2021-10-08 05:03:25 +02:00
|
|
|
shell: bash
|
2021-10-08 04:51:09 +02:00
|
|
|
id: cargo
|
2024-04-14 19:08:49 +02:00
|
|
|
- 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
|
2021-10-08 05:03:25 +02:00
|
|
|
shell: bash
|
2024-04-14 19:08:49 +02:00
|
|
|
- name: Download ${{steps.inputs.outputs.bin}}.sig
|
|
|
|
run: curl --output ${{runner.temp}}/${{steps.inputs.outputs.bin}}.sig https://github.com/dtolnay/install/releases/download/${{steps.inputs.outputs.crate}}/${{steps.inputs.outputs.bin}}.sig --location --silent --show-error --fail --retry 5
|
2021-10-08 05:03:25 +02:00
|
|
|
shell: bash
|
2021-10-08 04:51:09 +02:00
|
|
|
- name: Retrieve public key of signing key
|
2021-10-08 05:15:17 +02:00
|
|
|
run: gpg --output ${{runner.temp}}/signing-key.gpg --yes --dearmor ${{github.action_path}}/signing-key.asc
|
2021-10-08 05:03:25 +02:00
|
|
|
shell: bash
|
2021-10-08 04:51:09 +02:00
|
|
|
- name: Verify gpg signature
|
2024-04-14 19:08:49 +02:00
|
|
|
run: gpg --no-default-keyring --keyring ${{runner.temp}}/signing-key.gpg --trusted-key 830334D6A6010C41 --verify ${{runner.temp}}/${{steps.inputs.outputs.bin}}.sig ${{steps.cargo.outputs.dir}}/${{steps.inputs.outputs.bin}}
|
2021-10-08 05:03:25 +02:00
|
|
|
shell: bash
|
2021-10-08 04:51:09 +02:00
|
|
|
- name: Set executable bit
|
2024-04-14 19:08:49 +02:00
|
|
|
run: chmod +x ${{steps.cargo.outputs.dir}}/${{steps.inputs.outputs.bin}}
|
2021-10-08 05:03:25 +02:00
|
|
|
shell: bash
|