ci: add dry publish test

Signed-off-by: Mike Nguyen <hey@mike.ee>
This commit is contained in:
Mike Nguyen 2024-11-25 17:43:26 +00:00
parent 4da565cbae
commit abecc5c70b
No known key found for this signature in database
GPG Key ID: ACED13988580D50E
1 changed files with 35 additions and 5 deletions

View File

@ -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 }}