From abecc5c70b9f661e101181be705bbaca7ad72278 Mon Sep 17 00:00:00 2001 From: Mike Nguyen Date: Mon, 25 Nov 2024 17:43:26 +0000 Subject: [PATCH] ci: add dry publish test Signed-off-by: Mike Nguyen --- .github/workflows/ci.yml | 40 +++++++++++++++++++++++++++++++++++----- 1 file changed, 35 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e5eada3..8ba36b4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -94,11 +94,43 @@ jobs: - uses: dtolnay/install@cargo-docs-rs - run: cargo docs-rs -p ${{ matrix.crate }} + publish-dry: + name: Publish Test + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + crate: + - dapr + - dapr-macros + + steps: + - name: Install Rust + uses: dtolnay/rust-toolchain@master + with: + toolchain: stable + components: clippy, rustfmt + - name: Install Protoc + uses: arduino/setup-protoc@v3 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + version: ${{ env.PROTOC_VERSION }} + - uses: actions/checkout@v4 + - name: cargo publish - ${{ matrix.crate }} + run: cargo publish --manifest-path ${{ matrix.crate }}/Cargo.toml --dry-run + + publish: name: Publish runs-on: ubuntu-latest - needs: [test-docs, lint, build] + needs: [test-docs, lint, build, publish-dry] if: startswith(github.ref, 'refs/tags/v') + strategy: + fail-fast: false + matrix: + crate: + - dapr + - dapr-macros steps: - name: Install Rust @@ -112,7 +144,5 @@ jobs: repo-token: ${{ secrets.GITHUB_TOKEN }} version: ${{ env.PROTOC_VERSION }} - uses: actions/checkout@v4 - - name: cargo publish dapr-macros - run: cargo publish --manifest-path dapr-macros/Cargo.toml --token ${{ env.CARGO_TOKEN }} - - name: cargo publish dapr - run: cargo publish --manifest-path dapr/Cargo.toml --token ${{ env.CARGO_TOKEN }} + - name: cargo publish - ${{ matrix.crate }} + run: cargo publish --manifest-path ${{ matrix.crate }}/Cargo.toml --token ${{ env.CARGO_TOKEN }}