aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/publish.yml
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-06-16 06:25:44 +0000
committerGitHub <noreply@github.com>2020-06-16 06:25:44 +0000
commit8a4f9c6b8ae91bebeea0791680f89375a78bffc6 (patch)
treea561c52f5f32e64ba2a496fb736dfd555fcac854 /.github/workflows/publish.yml
parentcfd5f4785e9c2ae88e666d1fb94a3488904a87f5 (diff)
parent68e45815b9d088fb4d5f2302ac404a81095f00e5 (diff)
Merge #330
330: Combine publish, docs and build into one workflow, do not test on nightly r=korken89 a=AfoHT Streamline the Github Actions workflow a bit, currently it does not play well with multiple workflows since dependencies needs to be within the same workflow. This combines the previous docs and publish workflows into one larger build workflow. If pushing to master branch, and all jobs succeed, then the deploy is also done. No testing on nightly except for multi-core which requires nightly. Co-authored-by: Henrik Tjäder <henrik@tjaders.com>
Diffstat (limited to '.github/workflows/publish.yml')
-rw-r--r--.github/workflows/publish.yml94
1 files changed, 0 insertions, 94 deletions
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
deleted file mode 100644
index 5c534fc..0000000
--- a/.github/workflows/publish.yml
+++ /dev/null
@@ -1,94 +0,0 @@
-name: Publish
-
-on:
- push:
- branches:
- - master
-
-jobs:
- deploy:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v2
-
- - name: Set up Python 3.x
- uses: actions/setup-python@v2
- with:
- # Semantic version range syntax or exact version of a Python version
- python-version: '3.x'
- # Optional - x64 or x86 architecture, defaults to x64
- architecture: 'x64'
-
- # You can test your matrix by printing the current Python version
- - name: Display Python version
- run: python -c "import sys; print(sys.version)"
-
- - name: mdBook Action
- uses: peaceiris/actions-mdbook@v1.1.11
- with:
- mdbook-version: '0.3.1'
- # mdbook-version: 'latest'
-
- - name: Remove cargo-config
- run: rm -f .cargo/config
-
- - name: Build docs
- run: cargo doc
-
- - name: Build books
- run: |
- langs=( en ru )
- latest=0.5
- vers=( 0.4.x )
-
- # Create directories
- td=$(mktemp -d)
- mkdir -p $td/$latest/book/
- cp -r target/doc $td/$latest/api
-
- # sed fixes
- sed 's|URL|rtic/index.html|g' redirect.html > $td/$latest/api/index.html
- sed 's|URL|0.5|g' redirect.html > $td/index.html
- sed 's|URL|book/en|g' redirect.html > $td/$latest/index.html
-
- # Build books
- for lang in ${langs[@]}; do
- ( cd book/$lang && mdbook build )
- cp -r book/$lang/book $td/$latest/book/$lang
- cp LICENSE-* $td/$latest/book/$lang/
- done
-
- # Build older versions
- root=$(pwd)
- for ver in ${vers[@]}; do
- prefix=${ver%.*}
-
- mkdir -p $td/$prefix/book
- src=$(mktemp -d)
- curl -L https://github.com/rtic-rs/cortex-m-rtic/archive/v${ver}.tar.gz | tar xz --strip-components 1 -C $src
-
- pushd $src
- rm -f .cargo/config
- cargo doc || cargo doc --features timer-queue
- cp -r target/doc $td/$prefix/api
- sed 's|URL|rtic/index.html|g' $root/redirect.html > $td/$prefix/api/index.html
- for lang in ${langs[@]}; do
- ( cd book/$lang && mdbook build )
- cp -r book/$lang/book $td/$prefix/book/$lang
- cp LICENSE-* $td/$prefix/book/$lang/
- done
- sed 's|URL|book/en|g' $root/redirect.html > $td/$prefix/index.html
- popd
-
- rm -rf $src
- done
-
- # Forward CNAME file
- cp CNAME $td/
- mv $td/ bookstodeploy
-
- - name: Deploy
- uses: peaceiris/actions-gh-pages@v3
- with:
- github_token: ${{ secrets.GITHUB_TOKEN }}
- publish_dir: ./bookstodeploy