From 3a454a77020b65ee13ff64abb35c7e12a5f64adf Mon Sep 17 00:00:00 2001 From: Sean McGrail <549813+skmcgrail@users.noreply.github.com> Date: Tue, 18 Jul 2023 10:16:27 -0700 Subject: [PATCH] Use nightly cargo feature for scripts (#191) * Use nightly cargo feature for scripts * Cleanup GitHub Action --- .github/workflows/ci.yml | 7 +------ scripts/tools/cargo-dig.rs | 2 +- scripts/tools/semver.rs | 2 +- scripts/tools/target-platform.rs | 2 +- 4 files changed, 4 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c17ddb2dcd8..718a1632aa3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -90,11 +90,6 @@ jobs: with: command: install args: cargo-public-api - - name: Install rust-script - uses: actions-rs/cargo@v1.0.3 - with: - command: install - args: rust-script - name: Perform API Diff (Target Branch) if: matrix.diff_target == 'branch' working-directory: ${{ matrix.crate_dir }} @@ -104,7 +99,7 @@ jobs: working-directory: ${{ matrix.crate_dir }} shell: bash run: | - CRATE_NAME=$("${GITHUB_WORKSPACE}"/scripts/tools/cargo-dig.rs -n) + CRATE_NAME="${{ matrix.crate_dir }}" CRATE_VERSION=$(cargo search --limit 1 ${CRATE_NAME} | head -n 1 | sed -e 's/[^"]*"\([^"]*\)".*/\1/') cargo public-api diff --deny changed --deny removed "${CRATE_VERSION}" diff --git a/scripts/tools/cargo-dig.rs b/scripts/tools/cargo-dig.rs index 12fbe4a331b..e155586cfd2 100755 --- a/scripts/tools/cargo-dig.rs +++ b/scripts/tools/cargo-dig.rs @@ -1,4 +1,4 @@ -#!/usr/bin/env rust-script +#!/usr/bin/env -S cargo +nightly -Zscript //! Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. //! SPDX-License-Identifier: Apache-2.0 OR ISC //! ```cargo diff --git a/scripts/tools/semver.rs b/scripts/tools/semver.rs index b285de4ab93..738d8265182 100755 --- a/scripts/tools/semver.rs +++ b/scripts/tools/semver.rs @@ -1,4 +1,4 @@ -#!/usr/bin/env rust-script +#!/usr/bin/env -S cargo +nightly -Zscript //! Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. //! SPDX-License-Identifier: Apache-2.0 OR ISC //! ```cargo diff --git a/scripts/tools/target-platform.rs b/scripts/tools/target-platform.rs index 67f820c0f90..35e87e8e1c9 100755 --- a/scripts/tools/target-platform.rs +++ b/scripts/tools/target-platform.rs @@ -1,4 +1,4 @@ -#!/usr/bin/env rust-script +#!/usr/bin/env -S cargo +nightly -Zscript // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 OR ISC