chore(ci): add dry run for cargo publish #68
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- "Cargo.toml" | |
pull_request: | |
branches: | |
- main | |
paths: | |
- "Cargo.toml" | |
jobs: | |
crates: | |
runs-on: ubuntu-latest | |
environment: | |
name: crates.io | |
url: https://crates.io/crates/databend-driver | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Rust toolchain | |
uses: ./.github/actions/setup | |
with: | |
cache-key: publish | |
- name: Setup Cargo Release | |
run: | | |
cargo install cargo-quickinstall | |
cargo quickinstall cargo-release | |
touch ~/.gitconfig | |
- name: Dry run release | |
if: github.event_name == 'pull_request' | |
run: | | |
cargo release publish --no-confirm --no-publish | |
- name: Release to crates.io | |
if: github.event_name == 'push' | |
env: | |
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
run: | | |
cargo release publish --execute --no-confirm |