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:
|
|
|
|
- name: Determine cargo bin directory
|
|
|
|
run: echo "::set-output name=dir::$(dirname $(which cargo))"
|
2021-10-08 05:03:25 +02:00
|
|
|
shell: bash
|
2021-10-08 04:51:09 +02:00
|
|
|
id: cargo
|
|
|
|
- name: Download ${{inputs.bin || inputs.crate}}
|
2021-10-08 05:11:32 +02:00
|
|
|
run: curl --output ${{steps.cargo.outputs.dir}}/${{inputs.bin || inputs.crate}} https://github.com/dtolnay/install/releases/download/${{inputs.crate}}/${{inputs.bin || inputs.crate}} --location --silent --show-error
|
2021-10-08 05:03:25 +02:00
|
|
|
shell: bash
|
2021-10-08 04:51:09 +02:00
|
|
|
- name: Download ${{inputs.bin || inputs.crate}}.sig
|
2021-10-08 05:11:32 +02:00
|
|
|
run: curl --output ${{runner.temp}}/${{inputs.bin || inputs.crate}}.sig https://github.com/dtolnay/install/releases/download/${{inputs.crate}}/${{inputs.bin || inputs.crate}}.sig --location --silent --show-error
|
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
|
|
|
|
run: gpg --output ${{runner.temp}}/signing-key.gpg --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
|
|
|
|
run: gpg --no-default-keyring --keyring ${{runner.temp}}/signing-key.gpg --verify ${{runner.temp}}/${{inputs.bin || inputs.crate}}.sig ${{steps.cargo.outputs.dir}}/${{inputs.bin || inputs.crate}}
|
2021-10-08 05:03:25 +02:00
|
|
|
shell: bash
|
2021-10-08 04:51:09 +02:00
|
|
|
- name: Set executable bit
|
|
|
|
run: chmod +x ${{steps.cargo.outputs.dir}}/${{inputs.bin || inputs.crate}}
|
2021-10-08 05:03:25 +02:00
|
|
|
shell: bash
|