Skip to content

Commit 82ec681

Browse files
authored
Merge pull request #2127 from ehuss/auto-publish
Automatically publish to crates.io on new release
2 parents 49ba919 + 0f25db6 commit 82ec681

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,14 @@ jobs:
5656
curl -LsSf https://raw.githubusercontent.com/rust-lang/simpleinfra/master/setup-deploy-keys/src/deploy.rs | rustc - -o /tmp/deploy
5757
cd guide/book
5858
/tmp/deploy
59+
publish:
60+
name: Publish to crates.io
61+
runs-on: ubuntu-latest
62+
steps:
63+
- uses: actions/checkout@master
64+
- name: Install Rust (rustup)
65+
run: rustup update stable --no-self-update && rustup default stable
66+
- name: Publish
67+
env:
68+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
69+
run: cargo publish --no-verify

CONTRIBUTING.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,3 +153,23 @@ The following are instructions for updating [highlight.js](https://highlightjs.o
153153
1. Copy `build/highlight.min.js` to mdbook's directory [`highlight.js`](https://github.com/rust-lang/mdBook/blob/master/src/theme/highlight.js).
154154
1. Be sure to check the highlight.js [CHANGES](https://github.com/highlightjs/highlight.js/blob/main/CHANGES.md) for any breaking changes. Breaking changes that would affect users will need to wait until the next major release.
155155
1. Build mdbook with the new file and build some books with the new version and compare the output with a variety of languages to see if anything changes. The [test_book](https://github.com/rust-lang/mdBook/tree/master/test_book) contains a chapter with many languages to examine.
156+
157+
## Publishing new releases
158+
159+
Instructions for mdBook maintainers to publish a new release:
160+
161+
1. Create a PR to update the version and update the CHANGELOG:
162+
1. Update the version in `Cargo.toml`
163+
2. Run `cargo test` to verify that everything is passing, and to update `Cargo.lock`.
164+
3. Double-check for any SemVer breaking changes.
165+
Try [`cargo-semver-checks`](https://crates.io/crates/cargo-semver-checks), though beware that the current version of mdBook isn't properly adhering to SemVer due to the lack of `#[non_exhaustive]` and other issues. See https://github.com/rust-lang/mdBook/issues/1835.
166+
4. Update `CHANGELOG.md` with any changes that users may be interested in.
167+
5. Update `continuous-integration.md` to update the version number for the installation instructions.
168+
6. Commit the changes, and open a PR.
169+
2. After the PR has been merged, create a release in GitHub. This can either be done in the GitHub web UI, or on the command-line:
170+
```bash
171+
MDBOOK_VERS="`cargo read-manifest | jq -r .version`" ; \
172+
gh release create -R rust-lang/mdbook v$MDBOOK_VERS \
173+
--title v$MDBOOK_VERS \
174+
--notes "See https://github.com/rust-lang/mdBook/blob/master/CHANGELOG.md#mdbook-${MDBOOK_VERS//.} for a complete list of changes."
175+
```

0 commit comments

Comments
 (0)