73 Commits

Author SHA1 Message Date
Jakub Beránek
8f277a0d39 Add publish environment to deploy job 2025-11-25 09:41:27 +01:00
Eric Huss
63b159741b Disable update-dependencies on forks
This disables the update-dependencies cron job in forks. It's not
uncommon for people to leave GitHub Actions enabled in a fork (which in
my experience seems to be the default?), and this unfortunately means
that this job will run in all those forks which is probably not what
people want.
2025-11-07 10:06:38 -08:00
renovate[bot]
9799326590 Update cargo-semver-checks to v0.45.0 2025-11-01 20:40:49 +00:00
Eric Huss
33c9b4063e Merge pull request #2919 from rust-lang/renovate/node-24.x
Update dependency node to v24
2025-11-01 04:14:10 +00:00
renovate[bot]
6cc40cb5f7 Update dependency node to v24 2025-11-01 00:33:10 +00:00
renovate[bot]
37f8a79d4d Update actions/setup-node action to v6 2025-11-01 00:33:06 +00:00
Eric Huss
8e9697bd8b Merge pull request #2870 from rust-lang/renovate/actions-checkout-5.x
Update actions/checkout action to v5
2025-09-28 16:46:48 +00:00
Eric Huss
dcf7ae45c2 Merge pull request #2872 from rust-lang/renovate/node-22.x
Update dependency node to v22
2025-09-28 16:43:35 +00:00
renovate[bot]
44cd371066 Update dependency node to v22 2025-09-28 16:17:55 +00:00
renovate[bot]
1c766160c3 Update actions/setup-node action to v5 2025-09-28 16:17:52 +00:00
renovate[bot]
2cb4093cc8 Update actions/checkout action to v5 2025-09-28 16:17:49 +00:00
Eric Huss
e15f80407d Merge pull request #2865 from ehuss/new-publish-workflow
Set up new workspace publish workflow
2025-09-27 00:46:02 +00:00
Eric Huss
4fc72e8d9f 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.
2025-09-26 17:40:34 -07:00
renovate[bot]
2011ddb479 Update cargo-semver-checks to v0.44.0 2025-09-26 17:48:43 +00:00
Eric Huss
4a28995641 Merge pull request #2858 from ehuss/add-semver-checks
Add cargo-semver-checks
2025-09-26 17:42:43 +00:00
Eric Huss
cd1b54f41f Merge pull request #2861 from ehuss/add-update-dependencies
Add job to automatically update dependencies
2025-09-24 23:13:53 +00:00
Eric Huss
83c307be3c Add job to automatically update dependencies
This adds a job to automatically update cargo dependencies once a month.
I've added this script instead of using Renovate because I couldn't get
Renovate to update versions in `Cargo.toml`. I also wanted to batch
transitive dependency updates all in one PR.
2025-09-24 16:05:14 -07:00
Eric Huss
7dee816838 Add Renovate configuration
This adds a configuration to enable Renovate to do some basic automated
updates.
2025-09-24 15:55:16 -07:00
Eric Huss
5b79ed4144 Add cargo-semver-checks
This adds cargo-semver-checks to CI to help catch any unintended
breaking changes to the API.
2025-09-20 18:19:48 -07:00
Eric Huss
2b242494b0 Add a new HTML rendering pipeline
This rewrites the HTML rendering pipeline to use a tree data structure,
and implements a custom HTML serializer. The intent is to make it easier
to make changes and to manipulate the output. This should make some
future changes much easier.

This is a large change, but I'll try to briefly summarize what's
changing:

- All of the HTML rendering support has been moved out of
  mdbook-markdown into mdbook-html. For now, all of the API surface is
  private, though we may consider ways to safely expose it in the
  future.
- Instead of using pulldown-cmark's html serializer, this takes the
  pulldown-cmark events and translates them into a tree data structure
  (using the ego-tree crate to define the tree). See `tree.rs`.
- HTML in the markdown document is parsed using html5ever, and then
  lives inside the same tree data structure. See `tokenizer.rs`.
- Transformations are then applied to the tree data structure. For
  example, adding header links or hiding code lines.
- Serialization is a simple process of writing out the nodes to a
  string. See `serialize.rs`.
- The search indexer works on the tree structure instead of re-rendering
  every chapter twice. See `html_handlebars/search.rs`.
- The print page now takes a very different approach of taking the
  same tree structure built for rendering the chapters, and applies
  transformations to it. This avoid re-parsing everything again. See
  `print.rs`.
    - I changed the linking behavior so that links on the print page
      link to items on the print page instead of outside the print page.
- There are a variety of small changes to how it serializes as can be
  seen in the changes to the tests. Some highlights:
	- Code blocks no longer have a second layer of `<pre>` tags wrapping
      it.
    - Fixed a minor issue where a rust code block with a specific
      edition was having the wrong classes when there was a default
      edition.
- Drops the ammonia dependency, which significantly reduces the number
  of dependencies. It was only being used for a very minor task, and
  we can handle it much more easily now.
- Drops `pretty_assertions`, they are no longer used (mostly being
  migrated to the testsuite).

There's obviously a lot of risk trying to parse everything to such a low
level, but I think the benefits are worth it. Also, the API isn't super
ergonomic compared to say javascript (there are no selectors), but it
works well enough so far.

I have not run this through rigorous benchmarking, but it does have a
very noticeable performance improvement, especially in a debug build.

I expect in the future that we'll want to expose some kind of
integration with extensions so they have access to this tree structure
(or some kind of tree structure).

Closes https://github.com/rust-lang/mdBook/issues/1736
2025-09-16 20:26:35 -07:00
Eric Huss
0dc65a1ac4 Support publishing a pre-release version of the guide
This changes the publishing process so that when publishing the guide
and the current version is a pre-release, it will be pushed to a
directory called `/pre-release/`.

This also switches from using simpleinfra's SSH-based script to a simple
push using normal git commands.
2025-09-04 17:08:49 -07:00
Eric Huss
d5a505e0c6 Update to Rust 2024 2025-07-23 17:29:12 -07:00
Eric Huss
0de13cf5a9 Update CI to test the whole workspace
This updates the CI jobs to ensure that all crates in the workspace are
tested. This will be needed when more crates are added.
2025-07-23 17:29:12 -07:00
Eric Huss
f38dc687e3 Update dependencies
Also bump MSRV to 1.82

Updating anstyle-wincon v3.0.7 -> v3.0.8
Updating backtrace v0.3.74 -> v0.3.75
Updating bitflags v2.9.0 -> v2.9.1
Updating cc v1.2.21 -> v1.2.24
Updating clap v4.5.37 -> v4.5.38
Updating clap_builder v4.5.37 -> v4.5.38
Updating clap_complete v4.5.48 -> v4.5.50
Updating errno v0.3.11 -> v0.3.12
Updating getrandom v0.3.2 -> v0.3.3
Updating icu_collections v1.5.0 -> v2.0.0
Adding icu_locale_core v2.0.0
Removing icu_locid v1.5.0
Removing icu_locid_transform v1.5.0
Removing icu_locid_transform_data v1.5.1
Updating icu_normalizer v1.5.0 -> v2.0.0
Updating icu_normalizer_data v1.5.1 -> v2.0.0
Updating icu_properties v1.5.1 -> v2.0.1
Updating icu_properties_data v1.5.1 -> v2.0.1
Updating icu_provider v1.5.0 -> v2.0.0
Removing icu_provider_macros v1.5.0
Updating idna_adapter v1.2.0 -> v1.2.1
Updating jiff v0.2.12 -> v0.2.14
Updating jiff-static v0.2.12 -> v0.2.14
Updating kqueue v1.0.8 -> v1.1.1
Updating litemap v0.7.5 -> v0.8.0
Adding once_cell_polyfill v1.70.1
Adding potential_utf v0.1.2
Updating rustversion v1.0.20 -> v1.0.21
Updating tempfile v3.19.1 -> v3.20.0
Updating tinystr v0.7.6 -> v0.8.1
Updating tokio v1.44.2 -> v1.45.0
Removing utf16_iter v1.0.5
Updating web_atoms v0.1.1 -> v0.1.2
Updating windows-core v0.61.0 -> v0.61.2
Updating windows-result v0.3.2 -> v0.3.4
Updating windows-strings v0.4.0 -> v0.4.2
Removing write16 v1.0.0
Updating writeable v0.5.5 -> v0.6.1
Updating yoke v0.7.5 -> v0.8.0
Updating yoke-derive v0.7.5 -> v0.8.0
Adding zerotrie v0.2.2
Updating zerovec v0.10.4 -> v0.11.2
Updating zerovec-derive v0.10.3 -> v0.11.1
2025-05-23 07:55:10 -07:00
Eric Huss
199efd0f2c Update dependencies
Updating ammonia v4.0.0 -> v4.1.0
Updating anyhow v1.0.95 -> v1.0.98
Updating bitflags v2.8.0 -> v2.9.0
Updating bstr v1.11.3 -> v1.12.0
Updating bumpalo v3.16.0 -> v3.17.0
Updating bytes v1.9.0 -> v1.10.1
Updating cc v1.2.10 -> v1.2.21
Updating chrono v0.4.39 -> v0.4.41
Updating clap v4.5.27 -> v4.5.37
Updating clap_builder v4.5.27 -> v4.5.37
Updating clap_complete v4.5.43 -> v4.5.48
  Adding cssparser v0.35.0
  Adding cssparser-macros v0.6.1
Updating darling v0.20.10 -> v0.20.11
Updating darling_core v0.20.10 -> v0.20.11
Updating darling_macro v0.20.10 -> v0.20.11
Updating data-encoding v2.7.0 -> v2.9.0
  Adding dtoa v1.0.10
  Adding dtoa-short v0.3.5
Updating env_logger v0.11.6 -> v0.11.8
Updating equivalent v1.0.1 -> v1.0.2
Updating errno v0.3.10 -> v0.3.11
Removing getrandom v0.2.15
  Adding getrandom v0.2.16
  Adding getrandom v0.3.2
Updating globset v0.4.15 -> v0.4.16
Updating handlebars v6.3.0 -> v6.3.2
Updating hashbrown v0.15.2 -> v0.15.3
Updating html5ever v0.27.0 -> v0.31.0
Updating http v1.2.0 -> v1.3.1
Updating httparse v1.10.0 -> v1.10.1
Removing humantime v2.1.0
Updating iana-time-zone v0.1.61 -> v0.1.63
Updating icu_locid_transform_data v1.5.0 -> v1.5.1
Updating icu_normalizer_data v1.5.0 -> v1.5.1
Updating icu_properties_data v1.5.0 -> v1.5.1
Updating indexmap v2.7.1 -> v2.9.0
Updating itoa v1.0.14 -> v1.0.15
  Adding jiff v0.2.12
  Adding jiff-static v0.2.12
Updating libc v0.2.169 -> v0.2.172
Updating linux-raw-sys v0.4.15 -> v0.9.4
Updating litemap v0.7.4 -> v0.7.5
Updating log v0.4.25 -> v0.4.27
Updating markup5ever v0.12.1 -> v0.16.1
  Adding match_token v0.1.0
Updating miniz_oxide v0.8.3 -> v0.8.8
Updating once_cell v1.20.2 -> v1.21.3
Updating pest v2.7.15 -> v2.8.0
Updating pest_derive v2.7.15 -> v2.8.0
Updating pest_generator v2.7.15 -> v2.8.0
Updating pest_meta v2.7.15 -> v2.8.0
  Adding phf_macros v0.11.3
Updating pin-project v1.1.8 -> v1.1.10
Updating pin-project-internal v1.1.8 -> v1.1.10
Updating pkg-config v0.3.31 -> v0.3.32
  Adding portable-atomic v1.11.0
  Adding portable-atomic-util v0.2.4
Updating ppv-lite86 v0.2.20 -> v0.2.21
Updating proc-macro2 v1.0.93 -> v1.0.95
Updating quote v1.0.38 -> v1.0.40
  Adding r-efi v5.2.0
Updating redox_syscall v0.5.8 -> v0.5.12
Updating rustix v0.38.44 -> v1.0.7
Updating rustversion v1.0.19 -> v1.0.20
Updating ryu v1.0.19 -> v1.0.20
Updating select v0.6.0 -> v0.6.1
Updating semver v1.0.25 -> v1.0.26
Updating serde v1.0.217 -> v1.0.219
Updating serde_derive v1.0.217 -> v1.0.219
Updating serde_json v1.0.137 -> v1.0.140
Updating sha2 v0.10.8 -> v0.10.9
Updating smallvec v1.13.2 -> v1.15.0
Updating socket2 v0.5.8 -> v0.5.9
Updating string_cache v0.8.7 -> v0.8.9
Updating string_cache_codegen v0.5.2 -> v0.5.4
Updating syn v2.0.96 -> v2.0.101
Updating synstructure v0.13.1 -> v0.13.2
Updating tempfile v3.15.0 -> v3.19.1
Updating terminal_size v0.4.1 -> v0.4.2
Updating thiserror v2.0.11 -> v2.0.12
Updating thiserror-impl v2.0.11 -> v2.0.12
Updating tokio v1.43.1 -> v1.44.2
Updating tokio-util v0.7.13 -> v0.7.15
Updating typenum v1.17.0 -> v1.18.0
Updating unicode-ident v1.0.16 -> v1.0.18
  Adding wasi v0.14.2+wasi-0.2.4
  Adding web_atoms v0.1.1
Updating windows-core v0.52.0 -> v0.61.0
  Adding windows-implement v0.60.0
  Adding windows-interface v0.59.1
  Adding windows-link v0.1.1
  Adding windows-result v0.3.2
  Adding windows-strings v0.4.0
  Adding wit-bindgen-rt v0.39.0
Updating zerocopy v0.7.35 -> v0.8.25
Updating zerocopy-derive v0.7.35 -> v0.8.25
Updating zerofrom v0.1.5 -> v0.1.6
Updating zerofrom-derive v0.1.5 -> v0.1.6
2025-05-05 13:44:40 -07:00
Eric Huss
6e143ce2a1 Add CI job to check API docs
This ensures that `cargo doc` does not generate any warnings.
2025-04-20 19:43:32 -07:00
Eric Huss
8181445d99 Add a restricted set of clippy lints, required to pass
This sets up CI to check clippy with a restricted set of clippy groups.
Some of the default groups have some excessive sets of lints that are
either wrong or style choices that I would prefer to not mess over at
this time. The lint groups can be adjusted later if it looks like
something that would be helpful.
2025-04-20 19:25:46 -07:00
Eric Huss
9d6fcc9afe Require all test jobs to pass 2025-04-17 09:46:17 -07:00
Eric Huss
b47d1cff33 Merge pull request #2554 from GuillaumeGomez/eslint
Fix eslint warnings and add eslint check in CI
2025-03-23 19:50:44 +00:00
Guillaume Gomez
9823246ecd Add eslint check in the CI 2025-03-23 10:06:12 +01:00
Gabor Szabo
7c6d47e8b6 add explanation I learned in #2606 2025-03-21 16:32:07 +02:00
Eric Huss
9b873e9d97 Bump rust-version to 1.77 2025-01-28 09:35:11 -08:00
Guillaume Gomez
d6720fc671 Update browser-ui-test version to 0.19.0 2025-01-23 13:58:35 +01:00
MarcoIeni
81d42f1c6e ci: move ubuntu-20 jobs to ubuntu-22 2025-01-15 10:21:10 +01:00
Eric Huss
618a2fa78b Merge pull request #2476 from GuillaumeGomez/gui-tests
Add base for GUI tests
2025-01-06 22:46:26 +00:00
Guillaume Gomez
cc8ce35b4d Run GUI tests as a separate testsuite 2024-12-18 11:25:11 +01:00
Guillaume Gomez
2a13ca2fbf Add base for GUI tests 2024-12-16 17:45:36 +01:00
Lucas Kent
4d9a455a27 Add aarch64-apple-darwin release target 2024-12-02 11:43:57 +11:00
Eric Huss
3dc40f1742 Update actions/checkout to v4 2024-05-16 17:29:23 -07:00
Eric Huss
5a366f5707 Test more targets. 2024-05-16 17:27:28 -07:00
Eric Huss
87213edf39 Raise msrv to 1.74 2024-05-14 11:38:13 -07:00
Eric Huss
93bd457a54 Update env_logger to 0.11 2024-02-05 14:22:21 -08:00
Eric Huss
847a582022 Update msrv to 1.70 2023-11-29 14:36:39 -08:00
Eric Huss
9340e6a78d Use a better merge-queue success check. 2023-07-29 09:13:55 -07:00
Eric Huss
0fbfc90bea Prepare CI workflows to support merge queues. 2023-07-24 20:16:07 -07:00
Eric Huss
e942d41c1d Merge pull request #2128 from ehuss/release-token-perms
deploy: Rewrite and update permissions
2023-07-16 17:38:21 -07:00
Eric Huss
9497354cfd Rewrite asset deploy.
This switches to `gh` which is the more modern CLI, and also
available by default which removes the old installer script.

This also tightens the scope where GITHUB_TOKEN is exposed to just
the step where `gh` is executed.

Finally, it tightens the permissions on the GITHUB_TOKEN (though
`contents: write` is extremely permissive, since that allows writing to
almost anything in the repo).
2023-07-16 17:16:15 -07:00
Eric Huss
baa936439d deploy: Set the default shell so it doesn't need to be repeated. 2023-07-16 17:12:55 -07:00
Eric Huss
394061d28d Rename make-release.sh to make-release-asset.sh
This is to better reflect what the script does.
2023-07-16 17:12:29 -07:00
Eric Huss
0f25db67dc Automatically publish to crates.io on new release 2023-07-16 16:29:45 -07:00