From b5c199026705859077d0ad1a117d545dc7e4a2ef Mon Sep 17 00:00:00 2001 From: Shing Lyu Date: Tue, 4 Dec 2018 21:11:18 +0100 Subject: [PATCH] CI build and deploy demo page on master branch --- .travis.yml | 42 ++++++++++++++++++++++++++++++++---------- wasm/release.sh | 8 ++++++++ 2 files changed, 40 insertions(+), 10 deletions(-) create mode 100644 wasm/release.sh diff --git a/.travis.yml b/.travis.yml index ea6c5b4c8..df4abc9c7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -67,21 +67,43 @@ matrix: cache: cargo script: - cargo doc --no-deps --all + if: branch = release env: - REGULAR_TEST=false - PUBLISH_DOC=true + - name: WASM online demo + language: rust + rust: nightly + cache: cargo + script: + - cd wasm + - bash release.sh + if: branch = release + env: + - REGULAR_TEST=false + - PUBLISH_DEMO=true allow_failures: - rust: nightly env: REGULAR_TEST=true deploy: - provider: pages - repo: RustPython/website - target-branch: master - local-dir: target/doc - skip-cleanup: true - github-token: $WEBSITE_GITHUB_TOKEN # Set in the settings page of your repository, as a secure variable - keep-history: true - on: - branch: master - condition: $PUBLISH_DOC = true + - provider: pages + repo: RustPython/website + target-branch: master + local-dir: target/doc + skip-cleanup: true + github-token: $WEBSITE_GITHUB_TOKEN # Set in the settings page of your repository, as a secure variable + keep-history: true + on: + branch: release + condition: $PUBLISH_DOC = true + - provider: pages + repo: RustPython/demo + target-branch: master + local-dir: wasm/app/dist + skip-cleanup: true + github-token: $WEBSITE_GITHUB_TOKEN # Set in the settings page of your repository, as a secure variable + keep-history: true + on: + branch: release + condition: $PUBLISH_DEMO = true diff --git a/wasm/release.sh b/wasm/release.sh new file mode 100644 index 000000000..bfc4b5fa4 --- /dev/null +++ b/wasm/release.sh @@ -0,0 +1,8 @@ +wasm-pack build && \ +cd pkg && \ +npm link && \ +cd ../app && \ +npm install && \ +npm link rustpython_wasm && \ +webpack --mode production && \ +echo "Output saved to app/dist"