|
1 | 1 | name: Publish workspace crates |
2 | 2 |
|
3 | 3 | on: |
| 4 | + workflow_dispatch: {} |
4 | 5 | push: |
5 | | - branches: |
6 | | - - '**' |
| 6 | + paths: |
| 7 | + - "**/Cargo.toml" |
| 8 | + - ".github/workflows/publish.yml" |
7 | 9 | tags: |
8 | | - - '*' |
| 10 | + - "v*" |
9 | 11 | pull_request: |
10 | | - branches: |
11 | | - - '**' |
| 12 | + paths: |
| 13 | + - "**/Cargo.toml" |
| 14 | + - ".github/workflows/publish.yml" |
12 | 15 |
|
13 | 16 | jobs: |
14 | 17 | publish: |
15 | 18 | runs-on: ubuntu-latest |
16 | | - steps: |
17 | | - - name: Checkout |
18 | | - uses: actions/checkout@v4 |
19 | | - |
20 | | - - name: Use latest stable Rust (dtolnay/rust-toolchain) |
21 | | - uses: dtolnay/rust-toolchain@stable |
22 | | - with: |
23 | | - toolchain: stable |
24 | | - |
25 | | - - name: Dry run workspace publish |
26 | | - if: ${{ !startsWith(github.ref, 'refs/tags/v') }} |
27 | | - run: cargo publish --workspace --dry-run |
28 | | - |
29 | | - - name: Publish workspace |
30 | | - if: ${{ startsWith(github.ref, 'refs/tags/v') }} |
31 | | - env: |
32 | | - CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} |
33 | | - run: cargo publish --workspace |
34 | | -on: |
35 | | - workflow_dispatch: {} |
36 | | - push: |
37 | | - # Sequence of patterns matched against refs/tags |
38 | | - tags: |
39 | | - - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 |
40 | | - |
41 | | -name: Publish |
42 | | - |
43 | | -jobs: |
44 | | - publish: |
45 | | - name: Publish |
46 | | - runs-on: ubuntu-22.04 |
47 | 19 | steps: |
48 | 20 | - uses: actions/checkout@v4 |
| 21 | + - uses: dtolnay/rust-toolchain@stable |
49 | 22 | - uses: Swatinem/rust-cache@v2 |
50 | | - - run: | |
51 | | - cargo publish ${ARGS} --package sqlx-rt-oldapi |
52 | | - cargo publish ${ARGS} --package sqlx-core-oldapi |
53 | | - cargo publish ${ARGS} --package sqlx-macros-oldapi |
54 | | - cargo publish ${ARGS} --package sqlx-oldapi |
| 23 | + - name: Publish workspace |
| 24 | + run: cargo publish ${DRY} --workspace --token ${{ secrets.CRATES_TOKEN }} --no-default-features --features runtime-actix-rustls |
55 | 25 | env: |
56 | | - ARGS: |
57 | | - --token ${{ secrets.CRATES_TOKEN }} |
58 | | - --no-default-features |
59 | | - --features runtime-actix-rustls |
| 26 | + DRY: ${{ startsWith(github.ref, 'refs/tags/v') && '--dry-run' || '' }} |
0 commit comments