build(deps): Update Rust crate rpassword to v7.5.3 #3697
Workflow file for this run
This file contains hidden or 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: Rust | |
| on: | |
| push: | |
| branches: [master] | |
| tags: | |
| - v* | |
| pull_request: | |
| branches: [master] | |
| jobs: | |
| fmt: | |
| name: Rustfmt | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout sources | |
| uses: actions/checkout@v6 | |
| - name: Install fmt with stable toolchain | |
| id: toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| - run: rustup override set ${{steps.toolchain.outputs.name}} | |
| - run: rustup component add rustfmt | |
| - name: Run cargo fmt | |
| run: cargo fmt --all -- --check | |
| clippy: | |
| name: Clippy | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout sources | |
| uses: actions/checkout@v6 | |
| - name: Install clippy with stable toolchain | |
| id: toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| - run: rustup override set ${{steps.toolchain.outputs.name}} | |
| - run: rustup component add clippy | |
| - uses: clechasseur/[email protected] | |
| with: | |
| args: --locked --all-targets --all-features | |
| min_version: | |
| name: Minimum supported rust version | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: Checkout source code | |
| uses: actions/checkout@v6 | |
| - name: Extract min supported rust version | |
| shell: bash | |
| run: | | |
| echo "MIN_SUPPORTED_RUST_VERSION=$(sed -n 's/^rust-version = "\(.*\)"/\1/p' Cargo.toml | head -n1)" >> $GITHUB_ENV | |
| - name: Install rust toolchain (v${{ env.MIN_SUPPORTED_RUST_VERSION }}) | |
| id: toolchain | |
| uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: ${{ env.MIN_SUPPORTED_RUST_VERSION }} | |
| - run: rustup override set ${{steps.toolchain.outputs.name}} | |
| - run: rustup component add clippy | |
| - name: Run clippy (on minimum supported rust version to prevent warnings we can't fix) | |
| run: cargo clippy --locked --all-targets --all-features | |
| - name: Run tests | |
| run: cargo test --locked | |
| - name: Run examples | |
| run: | | |
| cp target/debug/rash /usr/local/bin/rash | |
| make test-examples | |
| build: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| job: | |
| # cross minimum glibc version is 2.32 | |
| - {os: ubuntu-24.04, target: x86_64-unknown-linux-musl} | |
| - {os: ubuntu-24.04, target: x86_64-unknown-freebsd} | |
| - {os: ubuntu-24.04, target: aarch64-unknown-linux-gnu} | |
| # use ubuntu 22.04 to keep older glibc version dependency | |
| - {os: ubuntu-22.04, target: x86_64-unknown-linux-gnu} | |
| - {os: macos-15, target: aarch64-apple-darwin} | |
| name: (${{ matrix.job.os }}) ${{ matrix.job.target }} | |
| runs-on: ${{ matrix.job.os }} | |
| steps: | |
| - name: Checkout source code | |
| uses: actions/checkout@v6 | |
| - name: Install prerequisites | |
| shell: bash | |
| run: | | |
| case ${{ matrix.job.target }} in | |
| arm-unknown-linux-*) sudo apt-get -y update ; sudo apt-get -y install gcc-arm-linux-gnueabihf ;; | |
| aarch64-unknown-linux-gnu) sudo apt-get -y update ; sudo apt-get -y install gcc-aarch64-linux-gnu ;; | |
| esac | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| # not reuse cache between different targets: | |
| # https://github.com/cross-rs/cross/issues/39#issuecomment-270684223 | |
| key: ${{ matrix.job.target }} | |
| - name: Install Rust toolchain | |
| id: toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.job.target }} | |
| - run: rustup override set ${{steps.toolchain.outputs.name}} | |
| - run: rustup component add rustfmt clippy | |
| - name: Run tests | |
| if: matrix.job.target != 'x86_64-unknown-freebsd' | |
| run: CARGO_TARGET=${{ matrix.job.target }} make test | |
| - name: Extract crate information | |
| shell: bash | |
| run: | | |
| echo "PROJECT_NAME=rash" >> $GITHUB_ENV | |
| echo "PROJECT_VERSION=$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -n1)" >> $GITHUB_ENV | |
| - name: Install UPX | |
| uses: crazy-max/ghaction-upx@v4 | |
| with: | |
| install-only: true | |
| version: latest | |
| if: contains(matrix.job.target, 'linux') | |
| - name: Make release | |
| id: package | |
| shell: bash | |
| run: | | |
| export CARGO_TARGET=${{ matrix.job.target }} | |
| export PKG_BASE_NAME=${PROJECT_NAME}-${PROJECT_VERSION}-${CARGO_TARGET} | |
| make release | |
| echo "PKG_BASE_NAME=${PKG_BASE_NAME}" >> $GITHUB_OUTPUT | |
| - name: Generate SHA256 hash | |
| if: startsWith(github.ref, 'refs/tags/') | |
| shell: bash | |
| run: | | |
| if [[ "${{ runner.os }}" == "macOS" ]]; then | |
| shasum -a 256 ${{ steps.package.outputs.PKG_BASE_NAME }}.tar.gz > ${{ steps.package.outputs.PKG_BASE_NAME }}.tar.gz.sha256 | |
| else | |
| sha256sum ${{ steps.package.outputs.PKG_BASE_NAME }}.tar.gz > ${{ steps.package.outputs.PKG_BASE_NAME }}.tar.gz.sha256 | |
| fi | |
| cat ${{ steps.package.outputs.PKG_BASE_NAME }}.tar.gz.sha256 | |
| - name: Upload release artifacts | |
| if: startsWith(github.ref, 'refs/tags/') | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: release-${{ matrix.job.target }} | |
| path: | | |
| ${{ steps.package.outputs.PKG_BASE_NAME }}.tar.gz | |
| ${{ steps.package.outputs.PKG_BASE_NAME }}.tar.gz.sha256 | |
| publish: | |
| name: Publish Release | |
| needs: build | |
| if: ${{ !cancelled() && needs.build.result == 'success' && startsWith(github.ref, 'refs/tags/') }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout source code | |
| uses: actions/checkout@v6 | |
| - name: Extract crate information | |
| shell: bash | |
| run: | | |
| echo "PROJECT_VERSION=$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -n1)" >> $GITHUB_ENV | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v8 | |
| with: | |
| pattern: release-* | |
| merge-multiple: true | |
| - name: Publish crates | |
| env: | |
| CRATES_IO_TOKEN: ${{ secrets.CRATES_IO_TOKEN }} | |
| shell: bash | |
| run: | | |
| echo "${CRATES_IO_TOKEN}" | cargo login | |
| make publish | |
| - name: Get Changelog Entry | |
| id: changelog_reader | |
| uses: mindsers/[email protected] | |
| with: | |
| version: v${{ env.PROJECT_VERSION }} | |
| path: ./CHANGELOG.md | |
| - name: Publish GitHub Release | |
| uses: softprops/action-gh-release@v3 | |
| with: | |
| body: ${{ steps.changelog_reader.outputs.changes }} | |
| prerelease: ${{ steps.changelog_reader.outputs.status == 'prereleased' }} | |
| draft: ${{ steps.changelog_reader.outputs.status == 'unreleased' }} | |
| files: | | |
| *.tar.gz | |
| *.tar.gz.sha256 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |