v2.1.0 #375
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Docs | |
on: | |
push: | |
branches: | |
- main-v1 | |
- main-v2 | |
jobs: | |
build-api-docs: | |
name: Build API docs | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
components: rust-docs | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.9" | |
- name: Setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
check-latest: true | |
- name: Install JDK | |
uses: actions/setup-java@v3 | |
with: | |
java-version: "11" | |
distribution: "temurin" | |
- name: Install Doxygen | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y doxygen | |
- name: Build Rust doc | |
run: cargo doc -p longport --no-deps | |
- name: Build Python wheels | |
uses: PyO3/maturin-action@v1 | |
with: | |
target: "x86_64" | |
args: -i python3.9 --out dist -m python/Cargo.toml | |
- name: Install built wheel | |
run: | | |
pip install longport --no-index --find-links dist --force-reinstall | |
python -c "import longport" | |
- name: Build Python docs | |
run: | | |
pip install -r docs/requirements.txt | |
mkdocs build | |
working-directory: ./python | |
- name: Build Node.js docs | |
run: | | |
npm install -g typedoc | |
typedoc | |
working-directory: ./nodejs | |
- name: Build Java docs | |
working-directory: ./java/javasrc | |
run: mvn javadoc:javadoc | |
- name: Build C docs | |
working-directory: ./c | |
run: doxygen | |
- name: Build C++ docs | |
working-directory: ./cpp | |
run: doxygen | |
- name: Doc version | |
run: echo DOC_VERSION=$(echo ${{ github.ref }} | sed 's/^refs\/heads\/main-//') >> $GITHUB_ENV | |
- name: Copy to gh-pages | |
run: | | |
mkdir -p gh-pages/$DOC_VERSION | |
mv -f target/doc gh-pages/$DOC_VERSION/rust | |
mv -f python/site gh-pages/$DOC_VERSION/python | |
mv -f nodejs/docs gh-pages/$DOC_VERSION/nodejs | |
mv -f java/javasrc/target/reports/apidocs gh-pages/$DOC_VERSION/java | |
mv -f c/html gh-pages/$DOC_VERSION/c | |
mv -f cpp/html gh-pages/$DOC_VERSION/cpp | |
cp .github/misc/templates/docs.html gh-pages/index.html | |
- name: Deploy | |
uses: peaceiris/actions-gh-pages@v2.5.1 | |
with: | |
emptyCommits: true | |
keepFiles: true | |
env: | |
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }} | |
PUBLISH_BRANCH: gh-pages | |
PUBLISH_DIR: gh-pages |