3
0
Fork 0
mirror of https://github.com/dtolnay/install.git synced 2024-11-22 08:29:30 +01:00

Merge pull request #10 from dtolnay/git

Checkout and install from repo, instead of --git
This commit is contained in:
David Tolnay 2022-12-01 16:03:02 -08:00 committed by GitHub
commit a4009f7dc7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 5 deletions

View file

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

View file

@ -12,7 +12,10 @@ on:
git: git:
required: false required: false
type: string type: string
branch: ref:
required: false
type: string
path:
required: false required: false
type: string type: string
secrets: secrets:
@ -28,8 +31,15 @@ jobs:
timeout-minutes: 45 timeout-minutes: 45
steps: steps:
- uses: actions/checkout@v3 - 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 - 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 - id: which
run: echo "which=$(which ${{inputs.bin || inputs.crate}})" >> $GITHUB_OUTPUT run: echo "which=$(which ${{inputs.bin || inputs.crate}})" >> $GITHUB_OUTPUT
- id: version - id: version

View file

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