760: Add Publish_Docs stage, make it push to a fake gh-pages branch for testing whenever master is updated. r=syrusakbary a=nlewycky

bors r-

Co-authored-by: Nick Lewycky <nick@wasmer.io>
Co-authored-by: Syrus <me@syrusakbary.com>
Co-authored-by: Azure Pipelines <azuredevops@microsoft.com>
This commit is contained in:
bors[bot] 2020-01-15 12:58:13 +00:00 committed by GitHub
commit 6514e57b6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 67 additions and 19 deletions

2
.gitignore vendored
View File

@ -5,3 +5,5 @@
.idea
**/.vscode
install/
api-docs/
api-docs-repo/

View File

@ -157,10 +157,8 @@ test-rest:
--exclude wasmer-emscripten-tests \
--exclude wasmer-runtime-core-tests
circleci-clean:
@if [ ! -z "${CIRCLE_JOB}" ]; then rm -f /home/circleci/project/target/debug/deps/libcranelift_wasm* && rm -f /Users/distiller/project/target/debug/deps/libcranelift_wasm*; fi;
test: spectests emtests middleware wasitests circleci-clean test-rest examples
test: spectests emtests middleware wasitests test-rest examples
# Integration tests
@ -303,7 +301,21 @@ dep-graph:
cargo deps --optional-deps --filter wasmer-wasi wasmer-wasi-tests wasmer-kernel-loader wasmer-dev-utils wasmer-llvm-backend wasmer-emscripten wasmer-emscripten-tests wasmer-runtime-core wasmer-runtime wasmer-middleware-common wasmer-middleware-common-tests wasmer-singlepass-backend wasmer-clif-backend wasmer --manifest-path Cargo.toml | dot -Tpng > wasmer_depgraph.png
docs:
cargo doc --features=backend-singlepass,backend-cranelift,backend-llvm,docs,wasi,managed
cargo doc --features=backend-singlepass,backend-cranelift,backend-llvm,docs,wasi,managed --all --no-deps
cd lib/runtime-c-api/ && doxygen doxyfile && cd ..
mkdir -p api-docs
mkdir -p api-docs/c
cp -R target/doc api-docs/crates
cp -R lib/runtime-c-api/doc/html api-docs/c/runtime-c-api
echo '<!-- Build $(SOURCE_VERSION) --><meta http-equiv="refresh" content="0; url=rust/wasmer_runtime/index.html">' > api-docs/index.html
echo '<!-- Build $(SOURCE_VERSION) --><meta http-equiv="refresh" content="0; url=wasmer_runtime/index.html">' > api-docs/crates/index.html
docs-publish:
git clone -b "gh-pages" --depth=1 https://wasmerbot:$(GITHUB_DOCS_TOKEN)@github.com/wasmerio/wasmer.git api-docs-repo
cp -R api-docs/* api-docs-repo/
cd api-docs-repo && git add index.html crates/* c/*
cd api-docs-repo && (git diff-index --quiet HEAD || git commit -m "Publishing GitHub Pages")
cd api-docs-repo && git push origin gh-pages
wapm:
cargo build --release --manifest-path wapm-cli/Cargo.toml --features "telemetry update-notifications"

View File

@ -210,6 +210,29 @@ jobs:
- publish: $(System.DefaultWorkingDirectory)/artifacts
artifact: library-$(Agent.OS)
- job: Build_Docs
pool:
vmImage: "ubuntu-16.04"
variables:
rust_toolchain: nightly-2019-08-15
condition: in(variables['Build.SourceBranch'], 'refs/heads/master', 'refs/heads/staging', 'refs/heads/trying')
steps:
- checkout: self
submodules: true
- template: .azure/install-rust.yml
- template: .azure/install-llvm.yml
- template: .azure/install-sccache.yml
- template: .azure/install-cmake.yml
- bash: |
sudo apt-get install doxygen graphviz
displayName: Install doxygen
- bash: |
make docs
displayName: Build docs
- publish: $(System.DefaultWorkingDirectory)/api-docs
artifact: api-docs
displayName: Save Docs artifact
- job: Publish
dependsOn:
- Build_CLI
@ -259,27 +282,33 @@ jobs:
isPreRelease: false
assets: '$(Build.ArtifactStagingDirectory)/**'
- job: Docs
- job: Publish_Docs
dependsOn:
- Build_Docs
displayName: Deploy API Documentation to GitHub
pool:
vmImage: "ubuntu-16.04"
variables:
rust_toolchain: nightly-2019-12-19
condition: in(variables['Build.SourceBranch'], 'refs/heads/master')
steps:
- checkout: self
submodules: true
- template: .azure/install-rust.yml
- template: .azure/install-llvm.yml
- template: .azure/install-sccache.yml
- template: .azure/install-cmake.yml
- task: DownloadPipelineArtifact@2
inputs:
artifactName: api-docs
targetPath: $(System.DefaultWorkingDirectory)/api-docs
- bash: |
make docs
displayName: Build documentation
git config --global user.email "bot@wasmer.io"
git config --global user.name "wasmerbot"
make docs-publish
env:
RUST_DOCS_DIR: $(Pipeline.Workspace)/api-docs
GITHUB_DOCS_TOKEN: $(GITHUB_DOCS_TOKEN)
SOURCE_VERSION: $(Build.SourceVersion)
# We only run the pipelines on PRs to Master
pr:
- master
# Otherwise, we test in any of this branches (master or bors related)
# Otherwise, we test in any of these branches (master or bors related)
trigger:
- master
- staging

1
index.html Normal file
View File

@ -0,0 +1 @@
<meta http-equiv="refresh" content="0; url=rust/wasmer_runtime/index.html">

View File

@ -17,8 +17,8 @@
<a href="https://crates.io/crates/wasmer-runtime-c-api">
<img src="https://img.shields.io/crates/d/wasmer-runtime-c-api.svg?style=flat-square" alt="Number of downloads from crates.io">
</a>
<a href="https://docs.rs/wasmer-runtime-c-api">
<img src="https://docs.rs/wasmer-runtime-c-api/badge.svg" alt="Read our API documentation">
<a href="https://wasmerio.github.io/wasmer/c/runtime-c-api/">
<img src="https://img.shields.io/badge/Docs-Wasmer%20C%20API-blue?style=flat-square" alt="Wasmer C API Documentation">
</a>
</p>
@ -38,6 +38,9 @@ crate, respectively [`wasmer.h`][wasmer_h] and
up-to-date in this repository.
The runtime shared library (so, dll, dylib) can also be downloaded in Wasmer [release page](https://github.com/wasmerio/wasmer/releases).
You can find the full C API documentation here:
https://wasmerio.github.io/wasmer/c/runtime-c-api/
Here is a simple example to use the C API:
```c

View File

@ -305,7 +305,7 @@ EXTERNAL_PAGES = YES
CLASS_DIAGRAMS = YES
DIA_PATH =
HIDE_UNDOC_RELATIONS = YES
HAVE_DOT = YES
HAVE_DOT = NO
DOT_NUM_THREADS = 0
DOT_FONTNAME = Helvetica
DOT_FONTSIZE = 10
@ -324,7 +324,7 @@ GRAPHICAL_HIERARCHY = YES
DIRECTORY_GRAPH = YES
DOT_IMAGE_FORMAT = svg
INTERACTIVE_SVG = YES
DOT_PATH =
DOT_PATH = ${DOXYGEN_DOT_PATH}
DOTFILE_DIRS =
MSCFILE_DIRS =
DIAFILE_DIRS =

View File

@ -2,6 +2,7 @@
name = "wasmer-runtime"
version = "0.12.0"
description = "Wasmer runtime library"
documentation = "https://wasmerio.github.io/wasmer/c/runtime-c-api/"
license = "MIT"
authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"]
repository = "https://github.com/wasmerio/wasmer"