mirror of
https://github.com/dtolnay/install.git
synced 2024-11-22 08:29:30 +01:00
Factor build steps into reusable workflow
This commit is contained in:
parent
de230d0f11
commit
98a5d57fe8
4 changed files with 44 additions and 60 deletions
34
.github/workflows/build.yml
vendored
Normal file
34
.github/workflows/build.yml
vendored
Normal file
|
@ -0,0 +1,34 @@
|
|||
name: build
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
crate:
|
||||
required: true
|
||||
type: string
|
||||
bin:
|
||||
required: false
|
||||
type: string
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: build ${{inputs.crate}}
|
||||
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:
|
||||
PRIVATE_KEY: ${{secrets.PRIVATE_KEY}}
|
||||
- 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:
|
||||
files: |
|
||||
${{steps.which.outputs.which}}
|
||||
${{inputs.bin || inputs.crate}}.sig
|
||||
fail_on_unmatched_files: true
|
23
.github/workflows/cargo-expand.yml
vendored
23
.github/workflows/cargo-expand.yml
vendored
|
@ -7,23 +7,6 @@ on:
|
|||
|
||||
jobs:
|
||||
build:
|
||||
name: cargo-expand
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
- run: cargo install --force cargo-expand
|
||||
- id: which
|
||||
run: echo "::set-output name=which::$(which cargo-expand)"
|
||||
- run: echo "$PRIVATE_KEY" | gpg --import
|
||||
env:
|
||||
PRIVATE_KEY: ${{secrets.PRIVATE_KEY}}
|
||||
- run: gpg --output cargo-expand.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 cargo-expand.sig ${{steps.which.outputs.which}}
|
||||
- uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
files: |
|
||||
${{steps.which.outputs.which}}
|
||||
cargo-expand.sig
|
||||
fail_on_unmatched_files: true
|
||||
uses: dtolnay/install/.github/workflows/build.yml@master
|
||||
with:
|
||||
crate: cargo-expand
|
||||
|
|
23
.github/workflows/cargo-outdated.yml
vendored
23
.github/workflows/cargo-outdated.yml
vendored
|
@ -7,23 +7,6 @@ on:
|
|||
|
||||
jobs:
|
||||
build:
|
||||
name: cargo-outdated
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
- run: cargo install --force cargo-outdated
|
||||
- id: which
|
||||
run: echo "::set-output name=which::$(which cargo-outdated)"
|
||||
- run: echo "$PRIVATE_KEY" | gpg --import
|
||||
env:
|
||||
PRIVATE_KEY: ${{secrets.PRIVATE_KEY}}
|
||||
- run: gpg --output cargo-outdated.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 cargo-outdated.sig ${{steps.which.outputs.which}}
|
||||
- uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
files: |
|
||||
${{steps.which.outputs.which}}
|
||||
cargo-outdated.sig
|
||||
fail_on_unmatched_files: true
|
||||
uses: dtolnay/install/.github/workflows/build.yml@master
|
||||
with:
|
||||
crate: cargo-outdated
|
||||
|
|
24
.github/workflows/cxxbridge-cmd.yml
vendored
24
.github/workflows/cxxbridge-cmd.yml
vendored
|
@ -7,23 +7,7 @@ on:
|
|||
|
||||
jobs:
|
||||
build:
|
||||
name: cxxbridge-cmd
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
- run: cargo install --force cxxbridge-cmd
|
||||
- id: which
|
||||
run: echo "::set-output name=which::$(which cxxbridge)"
|
||||
- run: echo "$PRIVATE_KEY" | gpg --import
|
||||
env:
|
||||
PRIVATE_KEY: ${{secrets.PRIVATE_KEY}}
|
||||
- run: gpg --output cxxbridge.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 cxxbridge.sig ${{steps.which.outputs.which}}
|
||||
- uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
files: |
|
||||
${{steps.which.outputs.which}}
|
||||
cxxbridge.sig
|
||||
fail_on_unmatched_files: true
|
||||
uses: dtolnay/install/.github/workflows/build.yml@master
|
||||
with:
|
||||
crate: cxxbridge-cmd
|
||||
bin: cxxbridge
|
||||
|
|
Loading…
Reference in a new issue