From dcf661607b18bbee2c5f4df6ab75269637e3f952 Mon Sep 17 00:00:00 2001 From: misssonder <819643718@qq.com> Date: Wed, 31 Jul 2024 19:30:46 +0800 Subject: [PATCH 1/3] Add publish ci --- .github/workflows/rust.yml | 40 ++++++++++++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 4c985fc..51a62c0 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -13,17 +13,41 @@ env: jobs: build: - runs-on: ubuntu-latest strategy: matrix: toolchain: - stable - + - nightly + steps: + - uses: actions/checkout@v4 + - run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }} + - name: Build + run: cargo build --verbose + - name: Run tests + run: cargo test --verbose + lint: + needs: [build] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: Swatinem/rust-cache@v1 + - name: Install rust stable + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + components: clippy + - name: Lint code + run: cargo clippy --all-features --no-deps -- -D clippy::all + release: + if: github.event_name == 'push' && github.ref_type == 'tag' + needs: [build, test, lint] + runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }} - - name: Build - run: cargo build --verbose - - name: Run tests - run: cargo test --verbose + - uses: actions/checkout@v2 + - uses: Swatinem/rust-cache@v1 + - name: publish crate + env: + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} + run: cargo publish From fddd2459177d5b44edaa8b7f8077d3cae3481f1f Mon Sep 17 00:00:00 2001 From: misssonder <819643718@qq.com> Date: Wed, 31 Jul 2024 19:33:07 +0800 Subject: [PATCH 2/3] Update publish ci --- .github/workflows/rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 51a62c0..1aa448e 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -42,7 +42,7 @@ jobs: run: cargo clippy --all-features --no-deps -- -D clippy::all release: if: github.event_name == 'push' && github.ref_type == 'tag' - needs: [build, test, lint] + needs: [build, lint] runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 From 1f50d903459d4cc32c745d4a4271b9d00fb00b34 Mon Sep 17 00:00:00 2001 From: misssonder <819643718@qq.com> Date: Wed, 31 Jul 2024 19:40:21 +0800 Subject: [PATCH 3/3] Update publish ci --- .github/workflows/rust.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 1aa448e..ce8201a 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -18,7 +18,6 @@ jobs: matrix: toolchain: - stable - - nightly steps: - uses: actions/checkout@v4 - run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}