From dd0e522122218acee43bdb9f8b468098c173585b Mon Sep 17 00:00:00 2001 From: Negezor Date: Sun, 31 Mar 2024 23:58:35 +1100 Subject: [PATCH 1/2] chore: update github actions ci --- .github/workflows/audit.yml | 4 ++-- .github/workflows/build.yml | 48 +++++++++++++++---------------------- 2 files changed, 21 insertions(+), 31 deletions(-) diff --git a/.github/workflows/audit.yml b/.github/workflows/audit.yml index c6e8a49..6b833f8 100644 --- a/.github/workflows/audit.yml +++ b/.github/workflows/audit.yml @@ -9,8 +9,8 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v1 + uses: actions/checkout@v4 - name: Run audit check - uses: actions-rs/audit-check@v1 + uses: rustsec/audit-check@v1 with: token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ae3f338..275c1ac 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,8 +16,8 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v2 - - uses: actions/cache@v2 + uses: actions/checkout@v4 + - uses: actions/cache@v4 with: path: | ~/.cargo/registry @@ -25,21 +25,18 @@ jobs: target key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - name: Install rust - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@stable with: components: rustfmt - name: Run cargo fmt - uses: actions-rs/cargo@v1 - with: - command: fmt - args: -- --check + run: cargo fmt -- --check clippy_check: name: Clippy check runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v1 - - uses: actions/cache@v2 + uses: actions/checkout@v4 + - uses: actions/cache@v4 with: path: | ~/.cargo/registry @@ -47,19 +44,19 @@ jobs: target key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - name: Install clippy - run: rustup component add clippy - - name: Run clippy check - uses: actions-rs/clippy-check@v1 + uses: dtolnay/rust-toolchain@stable with: - token: ${{ secrets.GITHUB_TOKEN }} - args: --all-features + components: clippy + - name: Run clippy check + run: cargo clippy --all-features + test: name: Run tests runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v2 - - uses: actions/cache@v2 + uses: actions/checkout@v4 + - uses: actions/cache@v4 with: path: | ~/.cargo/registry @@ -67,11 +64,9 @@ jobs: target key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - name: Install rust - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@stable - name: Run cargo test - uses: actions-rs/cargo@v1 - with: - command: test + run: cargo test publish_on_crates_io: name: Publish on crates.io runs-on: ubuntu-latest @@ -82,15 +77,10 @@ jobs: - test steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install rust - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@stable - name: Run cargo login - uses: actions-rs/cargo@v1 - with: - command: login - args: ${{ secrets.CRATES_IO_TOKEN }} + run: cargo login ${{ secrets.CRATES_IO_TOKEN }} - name: Run cargo publish - uses: actions-rs/cargo@v1 - with: - command: publish + run: cargo publish From b0d2238929da9acd017bf04434075b13de4100fb Mon Sep 17 00:00:00 2001 From: Negezor Date: Wed, 10 Apr 2024 22:44:45 +1100 Subject: [PATCH 2/2] chore: pass token in publish command --- .github/workflows/build.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 275c1ac..3cfafce 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -80,7 +80,5 @@ jobs: uses: actions/checkout@v4 - name: Install rust uses: dtolnay/rust-toolchain@stable - - name: Run cargo login - run: cargo login ${{ secrets.CRATES_IO_TOKEN }} - name: Run cargo publish - run: cargo publish + run: cargo publish --token ${{ secrets.CRATES_IO_TOKEN }}