Skip to content

Commit

Permalink
Deploy v0.4 documentation next to main documentation
Browse files Browse the repository at this point in the history
Make a link from the Main documentation to the docs for v0.4.
This allows us to keep the main documentation up-to-date
while allowing users to still view a prebuilt version of the
v0.4 docs.
  • Loading branch information
jschwe committed Sep 10, 2023
1 parent d4f82e7 commit 244eb76
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 12 deletions.
40 changes: 28 additions & 12 deletions .github/workflows/gh-pages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,28 +18,41 @@ concurrency:
cancel-in-progress: true

jobs:
# Build and deploy the documentation of master and the stable/v0.4 branch
deploy:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@v3
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Install mdbook
env:
MDBOOK_VERSION: 'v0.4.27'
run: |
mkdir mdbook
curl -sSL https://github.com/rust-lang/mdBook/releases/download/${MDBOOK_VERSION}/mdbook-${MDBOOK_VERSION}-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=./mdbook
echo `pwd`/mdbook >> $GITHUB_PATH
- name: Build mdbook
run: |
cd doc
mdbook build
- name: Checkout master
uses: actions/checkout@v4
with:
path: main
- name: Checkout stable/v0.4
uses: actions/checkout@v4
with:
path: stable-v0.4
ref: 'stable/v0.4'
- name: Copy documentation for v0.4 into mdbook subdirectory
run: mkdir main/doc/v0.4 && cp -r stable-v0.4/doc/src/ main/doc/v0.4
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Build mdbook for main branch
working-directory: 'main/doc'
run: mdbook build
- name: Build mdbook for stable/v0.4 branch
working-directory: 'stable-v0.4/doc'
run: mdbook build
# Override mdbooks default highlight.js with a custom version containing CMake support.
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
repository: 'highlightjs/highlight.js'
# mdbook currently (as of v0.4.27) does not support v11 yet.
Expand All @@ -52,11 +65,14 @@ jobs:
working-directory: highlightjs
- name: Override highlightjs
run: |
cp highlightjs/build/highlight.min.js doc/book/highlight.js
cp highlightjs/build/highlight.min.js main/doc/book/highlight.js
cp highlightjs/build/highlight.min.js stable-v0.4/doc/book/highlight.js
- name: Copy stable doc into main
run: mkdir main/doc/book/v0.4 && cp -r stable-v0.4/doc/book/ main/doc/book/v0.4
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
uses: actions/upload-pages-artifact@v2
with:
path: 'doc/book'
path: 'main/doc/book'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
uses: actions/deploy-pages@v2
6 changes: 6 additions & 0 deletions doc/src/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,10 @@ For rust executables and dynamic libraries corrosion provides a `corrosion_link_
helper function to conveniently add the necessary flags to link C/C++ libraries into
the rust target.

## Requirements

- Corrosion supports CMake 3.15 and newer with the v0.4 release. If you are using the v0.4 release, please
view [the documentation here](./v0.4/introduction.md)
- The master branch of Corrosion currently requires CMake 3.22 or newer.

[`target_link_libraries()`]: https://cmake.org/cmake/help/latest/command/target_link_libraries.html

0 comments on commit 244eb76

Please sign in to comment.