Fix installer downloads for specific releases #656
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test install-script | |
on: | |
merge_group: | |
pull_request: | |
types: | |
- opened | |
- reopened | |
- synchronize | |
paths: | |
- install-from-binstall-release.ps1 | |
- install-from-binstall-release.sh | |
push: | |
branches: | |
- main | |
paths: | |
- install-from-binstall-release.ps1 | |
- install-from-binstall-release.sh | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref || github.event.pull_request.number || github.sha }} | |
cancel-in-progress: true | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
unix: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [macos-latest, ubuntu-latest] | |
set_cargo_home: [t, f] | |
set_binstall_version: ['no', 'with-v', 'without-v'] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set `CARGO_HOME` | |
if: matrix.set_cargo_home == 't' | |
run: | | |
CARGO_HOME="$(mktemp -d 2>/dev/null || mktemp -d -t 'cargo-home')" | |
mkdir -p "${CARGO_HOME}/bin" | |
echo "CARGO_HOME=$CARGO_HOME" >> "$GITHUB_ENV" | |
- name: Set `BINSTALL_VERSION` | |
if: matrix.set_binstall_version != 'no' | |
env: | |
STRIP_V: ${{ matrix.set_cargo_home }} | |
GH_TOKEN: ${{ github.token }} | |
run: | | |
# fetch most recent release tag. | |
BINSTALL_VERSION="$(gh release list --json name --jq '[.[] | select(.name | startswith("v")) | .name] | first')" | |
if [[ $STRIP_V == 'without-v' ]]; then BINSTALL_VERSION="${BINSTALL_VERSION#v*}"; fi | |
echo "Setting BINSTALL_VERSION=$BINSTALL_VERSION" | |
echo "BINSTALL_VERSION=$BINSTALL_VERSION" >> "$GITHUB_ENV" | |
- name: Install `cargo-binstall` using scripts | |
run: ./install-from-binstall-release.sh | |
env: | |
GITHUB_TOKEN: ${{ secrets.CI_RELEASE_TEST_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} | |
- name: Verify `cargo-binstall` installation | |
run: | | |
which cargo-binstall | |
cargo binstall -vV | |
windows: | |
strategy: | |
fail-fast: false | |
matrix: | |
set_cargo_home: [t, f] | |
set_binstall_version: ['no', 'with-v', 'without-v'] | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set `CARGO_HOME` | |
if: matrix.set_cargo_home == 't' | |
shell: bash | |
run: | | |
CARGO_HOME="$(mktemp -d 2>/dev/null || mktemp -d -t 'cargo-home')" | |
mkdir -p "${CARGO_HOME}/bin" | |
echo "CARGO_HOME=$CARGO_HOME" >> "$GITHUB_ENV" | |
- name: Set `BINSTALL_VERSION` | |
if: matrix.set_binstall_version != 'no' | |
shell: bash | |
env: | |
GH_TOKEN: ${{ github.token }} | |
STRIP_V: ${{ matrix.set_cargo_home }} | |
run: | | |
# fetch most recent release name. | |
BINSTALL_VERSION="$(gh release list --json name --jq '[.[] | select(.name | startswith("v")) | .name] | first')" | |
if [[ $STRIP_V == 'without-v' ]]; then BINSTALL_VERSION="${BINSTALL_VERSION#v*}"; fi | |
echo "Setting BINSTALL_VERSION=$BINSTALL_VERSION" | |
echo "BINSTALL_VERSION=$BINSTALL_VERSION" >> "$GITHUB_ENV" | |
- name: Install `cargo-binstall` using scripts | |
run: ./install-from-binstall-release.ps1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.CI_RELEASE_TEST_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} | |
- name: Verify `cargo-binstall` installation | |
run: cargo binstall -vV | |
windows-bash: | |
strategy: | |
fail-fast: false | |
matrix: | |
set_cargo_home: [t, f] | |
set_binstall_version: ['no', 'with-v', 'without-v'] | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set `CARGO_HOME` | |
if: matrix.set_cargo_home == 't' | |
shell: bash | |
run: | | |
CARGO_HOME="$(mktemp -d 2>/dev/null || mktemp -d -t 'cargo-home')" | |
mkdir -p "${CARGO_HOME}/bin" | |
echo "CARGO_HOME=$CARGO_HOME" >> "$GITHUB_ENV" | |
- name: Set `BINSTALL_VERSION` | |
if: matrix.set_binstall_version != 'no' | |
shell: bash | |
env: | |
GH_TOKEN: ${{ github.token }} | |
STRIP_V: ${{ matrix.set_cargo_home }} | |
run: | | |
# fetch most recent release name. | |
BINSTALL_VERSION="$(gh release list --json name --jq '[.[] | select(.name | startswith("v")) | .name] | first')" | |
if [[ $STRIP_V == 'without-v' ]]; then BINSTALL_VERSION="${BINSTALL_VERSION#v*}"; fi | |
echo "Setting BINSTALL_VERSION=$BINSTALL_VERSION" | |
echo "BINSTALL_VERSION=$BINSTALL_VERSION" >> "$GITHUB_ENV" | |
- name: Install `cargo-binstall` using scripts | |
shell: bash | |
run: ./install-from-binstall-release.sh | |
env: | |
GITHUB_TOKEN: ${{ secrets.CI_RELEASE_TEST_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} | |
- name: Verify `cargo-binstall` installation | |
shell: bash | |
run: cargo binstall -vV |