3
0
Fork 0
mirror of https://github.com/dtolnay/install.git synced 2024-11-26 09:59:33 +01:00

Factor build steps into reusable workflow

This commit is contained in:
David Tolnay 2021-10-08 00:40:08 -04:00
parent de230d0f11
commit 98a5d57fe8
No known key found for this signature in database
GPG key ID: F9BA143B95FF6D82
4 changed files with 44 additions and 60 deletions

34
.github/workflows/build.yml vendored Normal file
View 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

View file

@ -7,23 +7,6 @@ on:
jobs: jobs:
build: build:
name: cargo-expand uses: dtolnay/install/.github/workflows/build.yml@master
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: with:
files: | crate: cargo-expand
${{steps.which.outputs.which}}
cargo-expand.sig
fail_on_unmatched_files: true

View file

@ -7,23 +7,6 @@ on:
jobs: jobs:
build: build:
name: cargo-outdated uses: dtolnay/install/.github/workflows/build.yml@master
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: with:
files: | crate: cargo-outdated
${{steps.which.outputs.which}}
cargo-outdated.sig
fail_on_unmatched_files: true

View file

@ -7,23 +7,7 @@ on:
jobs: jobs:
build: build:
name: cxxbridge-cmd uses: dtolnay/install/.github/workflows/build.yml@master
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: with:
files: | crate: cxxbridge-cmd
${{steps.which.outputs.which}} bin: cxxbridge
cxxbridge.sig
fail_on_unmatched_files: true