2021-10-08 06:40:08 +02:00
|
|
|
name: build
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_call:
|
|
|
|
inputs:
|
|
|
|
crate:
|
|
|
|
required: true
|
|
|
|
type: string
|
|
|
|
bin:
|
|
|
|
required: false
|
|
|
|
type: string
|
2021-10-08 06:46:40 +02:00
|
|
|
secrets:
|
|
|
|
private_key:
|
|
|
|
required: true
|
2021-10-08 06:40:08 +02:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
2021-10-08 06:42:30 +02:00
|
|
|
name: ${{inputs.crate}}
|
2021-10-08 06:40:08 +02:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
|
|
- run: cargo install --force ${{inputs.crate}} --bin ${{inputs.bin || inputs.crate}}
|
|
|
|
- id: which
|
|
|
|
run: echo "::set-output name=which::$(which ${{inputs.bin || inputs.crate}})"
|
|
|
|
- run: echo "$PRIVATE_KEY" | gpg --import
|
|
|
|
env:
|
2021-10-08 06:46:40 +02:00
|
|
|
PRIVATE_KEY: ${{secrets.private_key}}
|
2021-10-08 06:40:08 +02:00
|
|
|
- run: gpg --output ${{inputs.bin || inputs.crate}}.sig --detach-sig ${{steps.which.outputs.which}}
|
|
|
|
- run: gpg --output signing-key.gpg --dearmor signing-key.asc
|
|
|
|
- run: gpg --no-default-keyring --keyring ./signing-key.gpg --verify ${{inputs.bin || inputs.crate}}.sig ${{steps.which.outputs.which}}
|
|
|
|
- uses: softprops/action-gh-release@v1
|
|
|
|
with:
|
2021-10-09 02:38:20 +02:00
|
|
|
tag_name: ${{inputs.crate}}
|
2021-10-08 06:40:08 +02:00
|
|
|
files: |
|
|
|
|
${{steps.which.outputs.which}}
|
|
|
|
${{inputs.bin || inputs.crate}}.sig
|
|
|
|
fail_on_unmatched_files: true
|