3
0
Fork 0
mirror of https://github.com/dtolnay/install.git synced 2024-11-25 17:39:33 +01:00

Checkout and install from repo, instead of --git

This commit is contained in:
David Tolnay 2022-12-01 15:04:14 -08:00
parent 6c41e2d294
commit f850d6b745
No known key found for this signature in database
GPG key ID: F9BA143B95FF6D82
3 changed files with 16 additions and 5 deletions

View file

@ -10,7 +10,8 @@ jobs:
uses: ./.github/workflows/build.yml
with:
crate: buck2
git: https://github.com/facebookincubator/buck2
git: facebookincubator/buck2
path: cli
permissions:
contents: write
secrets: inherit

View file

@ -12,7 +12,10 @@ on:
git:
required: false
type: string
branch:
ref:
required: false
type: string
path:
required: false
type: string
secrets:
@ -28,8 +31,15 @@ jobs:
timeout-minutes: 45
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v3
with:
repository: ${{inputs.git}}
ref: ${{inputs.ref}}
path: ${{inputs.crate}}
if: inputs.git
- uses: dtolnay/rust-toolchain@stable
- run: cargo install --force ${{inputs.crate}} --bin ${{inputs.bin || inputs.crate}} ${{inputs.git && format('--git={0}', inputs.git) || ''}} ${{inputs.branch && format('--branch={0}', inputs.branch) || ''}}
- run: cargo install --force ${{inputs.git && format('--path={0}', inputs.path || '.') || inputs.crate}} --bin ${{inputs.bin || inputs.crate}}
working-directory: ${{inputs.git && inputs.crate || '.'}}
- id: which
run: echo "which=$(which ${{inputs.bin || inputs.crate}})" >> $GITHUB_OUTPUT
- id: version

View file

@ -10,8 +10,8 @@ jobs:
uses: ./.github/workflows/build.yml
with:
crate: rustup-toolchain-install-master
git: https://github.com/dtolnay-contrib/rustup-toolchain-install-master
branch: nodefault
git: dtolnay-contrib/rustup-toolchain-install-master
ref: nodefault
permissions:
contents: write
secrets: inherit