Refactor publish workflow and remove dry-run script #50
Workflow file for this run
This file contains hidden or 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 workspace crates | ||
|
Check failure on line 1 in .github/workflows/publish.yml
|
||
| on: | ||
| push: | ||
| branches: | ||
| - '**' | ||
| tags: | ||
| - '*' | ||
| pull_request: | ||
| branches: | ||
| - '**' | ||
| jobs: | ||
| publish: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| - name: Use latest stable Rust (dtolnay/rust-toolchain) | ||
| uses: dtolnay/rust-toolchain@stable | ||
| with: | ||
| toolchain: stable | ||
| - name: Dry run workspace publish | ||
| if: ${{ !startsWith(github.ref, 'refs/tags/') }} | ||
| run: cargo publish --workspace --dry-run --no-verify | ||
| - name: Publish workspace | ||
| if: ${{ startsWith(github.ref, 'refs/tags/') }} | ||
| env: | ||
| CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | ||
| run: cargo publish --workspace | ||
| on: | ||
| workflow_dispatch: {} | ||
| push: | ||
| # Sequence of patterns matched against refs/tags | ||
| tags: | ||
| - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 | ||
| name: Publish | ||
| jobs: | ||
| publish: | ||
| name: Publish | ||
| runs-on: ubuntu-22.04 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: Swatinem/rust-cache@v2 | ||
| - run: | | ||
| cargo publish ${ARGS} --package sqlx-rt-oldapi | ||
| cargo publish ${ARGS} --package sqlx-core-oldapi | ||
| cargo publish ${ARGS} --package sqlx-macros-oldapi | ||
| cargo publish ${ARGS} --package sqlx-oldapi | ||
| env: | ||
| ARGS: | ||
| --token ${{ secrets.CRATES_TOKEN }} | ||
| --no-default-features | ||
| --features runtime-actix-rustls | ||