Skip to content

Commit 4bfe632

Browse files
committed
simple publish workspace with dry run
1 parent dbeb106 commit 4bfe632

File tree

1 file changed

+12
-45
lines changed

1 file changed

+12
-45
lines changed

.github/workflows/publish.yml

Lines changed: 12 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,26 @@
11
name: Publish workspace crates
22

33
on:
4+
workflow_dispatch: {}
45
push:
5-
branches:
6-
- '**'
6+
paths:
7+
- "**/Cargo.toml"
8+
- ".github/workflows/publish.yml"
79
tags:
8-
- '*'
10+
- "v*"
911
pull_request:
10-
branches:
11-
- '**'
12+
paths:
13+
- "**/Cargo.toml"
14+
- ".github/workflows/publish.yml"
1215

1316
jobs:
1417
publish:
1518
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
4719
steps:
4820
- uses: actions/checkout@v4
21+
- uses: dtolnay/rust-toolchain@stable
4922
- 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
5525
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

Comments
 (0)