Skip to content

Build a book for each tag version (including master) #53

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 13, 2018
Merged

Conversation

ptersilie
Copy link
Member

PR in progress: We should test this build script once this repo has tags.

This PR changes the book building script so that it creates and
publishes a book for each tag as well as the master branch.

doc/build.sh Outdated
do
git checkout $tag
mdbook build -d book/$tag
cargo doc --target-dir book/api/$tag
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it might be better to bundle everything under the version. So we'd have something like:

    mdbook build -d $tag/book
    cargo doc --target-dir $tag/api

@ptersilie
Copy link
Member Author

ptersilie commented Nov 26, 2018

There's one issue I just realised. If we build the docs for each release, then the more releases (i.e. tags) we have, the longer it will take for travis to complete. Luckily this only happens on master commits, but it will still take a long time once we have a couple of releases.

There is a way to tell travis to do incremental commits which don't force push. This would allow us to only build the latest tag + master which would leave the previous doc builds in the repo. But we'll have to see how well that works. Edit: The problem with this solution is that travis doesn't run if we only push a tag (I think), so to force the new tags being build and published we'd have to do an extra commit after we pushed a new tag, which is a bit inconvenient.

@ptersilie
Copy link
Member Author

As discussed offline I changed the PR to only generated docs for the master branch and use docs.rs for the releases. Books still get created for the master branch and each release tag and will be hosted on softdevteam.github.io/grmtools.

One problem with cargo doc at the moment is that it doesn't create an index page of the available crates. However this was fixed in rust-lang/rust#54543 and will hopefully be part of a release soon.

@ltratt
Copy link
Member

ltratt commented Nov 27, 2018

Just to check: the thought here is to wait until rust 1.31 is out before merging this?

@ptersilie
Copy link
Member Author

ptersilie commented Nov 27, 2018

Given it will be part of the release then, yes. The alternative is to provide our own index page.

@ltratt
Copy link
Member

ltratt commented Dec 13, 2018

Since 1.31 is out, we think this PR might now be mergeable. @ptersilie If things work for you locally, please rebase against master and force push so that I can merge. If it doesn't work then... we think again :)

@ptersilie
Copy link
Member Author

It appears the index-page feature is still unstable. I tried using it as described here (https://github.com/rust-lang/rust/blob/e53a5ffd6b1c28903b4ad9a4c433fd554802cd9c/src/doc/rustdoc/src/unstable-features.md#--index-page-provide-a-top-level-landing-page-for-docs) but couldn't get it to work at all.

Back to the drawing board, I guess.

@ltratt
Copy link
Member

ltratt commented Dec 13, 2018

I'm a bit out of thoughts on this one TBH...

@ptersilie
Copy link
Member Author

I managed to get the default index-page working and also adjusted the travis deploy script to pick up the new folder.

@ltratt
Copy link
Member

ltratt commented Dec 13, 2018

You probably want to cherry-pick b0182a9 into this branch?

@ptersilie
Copy link
Member Author

Addressed your comment and merged in master. Let's wait for the tests and then we can rebase and merge.

@ltratt
Copy link
Member

ltratt commented Dec 13, 2018

If the tests succeed, please squash and merge without waiting for me to say so.

This commit changes the book building script so that it creates and publishes a
book for each tag as well as the master branch. It also builds the documentation
(cargo doc) for the master branch for and publishes it to grmtools/api.
@ptersilie
Copy link
Member Author

Squashed and rebased!

@ltratt ltratt merged commit e9c4cde into master Dec 13, 2018
@ltratt ltratt deleted the tag_books branch December 13, 2018 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants