Skip to content

Commit 4fc72e8

Browse files
committed
Set up new workspace publish workflow
This sets up the publish workflow to use the new OIDC authentication, and to publish the whole workspace at once.
1 parent 4a28995 commit 4fc72e8

File tree

3 files changed

+16
-9
lines changed

3 files changed

+16
-9
lines changed

.github/workflows/deploy.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,17 @@ jobs:
5151
publish:
5252
name: Publish to crates.io
5353
runs-on: ubuntu-latest
54+
permissions:
55+
# Required for OIDC token exchange
56+
id-token: write
5457
steps:
5558
- uses: actions/checkout@v4
5659
- name: Install Rust (rustup)
5760
run: rustup update stable --no-self-update && rustup default stable
61+
- name: Authenticate with crates.io
62+
id: auth
63+
uses: rust-lang/crates-io-auth-action@v1
5864
- name: Publish
5965
env:
60-
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
61-
run: cargo publish --no-verify
66+
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
67+
run: cargo publish --workspace --no-verify

Cargo.toml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ hex = "0.4.3"
3939
html5ever = "0.35.0"
4040
indexmap = "2.10.0"
4141
ignore = "0.4.23"
42-
mdbook-core = { path = "crates/mdbook-core" }
43-
mdbook-driver = { path = "crates/mdbook-driver" }
44-
mdbook-html = { path = "crates/mdbook-html" }
45-
mdbook-markdown = { path = "crates/mdbook-markdown" }
46-
mdbook-preprocessor = { path = "crates/mdbook-preprocessor" }
47-
mdbook-renderer = { path = "crates/mdbook-renderer" }
48-
mdbook-summary = { path = "crates/mdbook-summary" }
42+
mdbook-core = { path = "crates/mdbook-core", version = "0.5.0-alpha.1" }
43+
mdbook-driver = { path = "crates/mdbook-driver", version = "0.5.0-alpha.1" }
44+
mdbook-html = { path = "crates/mdbook-html", version = "0.5.0-alpha.1" }
45+
mdbook-markdown = { path = "crates/mdbook-markdown", version = "0.5.0-alpha.1" }
46+
mdbook-preprocessor = { path = "crates/mdbook-preprocessor", version = "0.5.0-alpha.1" }
47+
mdbook-renderer = { path = "crates/mdbook-renderer", version = "0.5.0-alpha.1" }
48+
mdbook-summary = { path = "crates/mdbook-summary", version = "0.5.0-alpha.1" }
4949
memchr = "2.7.5"
5050
notify = "8.1.0"
5151
notify-debouncer-mini = "0.6.0"

examples/remove-emphasis/mdbook-remove-emphasis/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
name = "mdbook-remove-emphasis"
33
version = "0.1.0"
44
edition.workspace = true
5+
publish = false
56

67
[dependencies]
78
mdbook-preprocessor.workspace = true

0 commit comments

Comments
 (0)