From 11f0497375005cf406e8cb1de27d5b2e18128711 Mon Sep 17 00:00:00 2001 From: Emily Toop Date: Thu, 23 Aug 2018 10:50:00 +0100 Subject: [PATCH 1/3] build and deploy swiftdoc using jazzy Skip tests on deploy stage push to specific pages api branch --- .travis.yml | 14 ++++++++++++-- scripts/build-doc.sh | 7 +++++++ 2 files changed, 19 insertions(+), 2 deletions(-) create mode 100755 scripts/build-doc.sh diff --git a/.travis.yml b/.travis.yml index 54b08bde2..2eadd7f7c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,9 +18,19 @@ jobs: - stage: "Test iOS" rust: 1.25.0 script: ./scripts/test-ios.sh - - stage: "Docs" + - stage: deploy rust: 1.25.0 - script: ./scripts/cargo-doc.sh + script: ./scripts/build-doc.sh + deploy: + provider: pages + skip-cleanup: true + github-token: $GITHUB_TOKEN # Set in the settings page of your repository, as a secure variable + keep-history: true + local-dir: docs/apis/latest + target-branch: gh-pages-api-docs + verbose: true + on: + branch: master script: - cargo test --verbose --all - cargo test --features edn/serde_support --verbose --all diff --git a/scripts/build-doc.sh b/scripts/build-doc.sh new file mode 100755 index 000000000..acd7d8513 --- /dev/null +++ b/scripts/build-doc.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +# if [[ "$TRAVIS_PULL_REQUEST" = "false" && "$TRAVIS_BRANCH" == "master" ]]; then +cargo doc --all --no-deps --release && cp -r target/doc/* docs/apis/latest/rust +gem install jazzy +jazzy --source-directory sdks/swift/Mentat/ -o docs/apis/latest/swift +# fi From 8948c8436a1aa7d84682a342beb88c09f7a4dae0 Mon Sep 17 00:00:00 2001 From: Emily Toop Date: Thu, 23 Aug 2018 15:38:22 +0100 Subject: [PATCH 2/3] Remove unused script --- scripts/cargo-doc.sh | 8 -------- 1 file changed, 8 deletions(-) delete mode 100755 scripts/cargo-doc.sh diff --git a/scripts/cargo-doc.sh b/scripts/cargo-doc.sh deleted file mode 100755 index 52942bea7..000000000 --- a/scripts/cargo-doc.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -if [[ "$TRAVIS_PULL_REQUEST" = "false" && "$TRAVIS_BRANCH" == "master" ]]; then - cargo doc && - echo "" > target/doc/index.html && - git clone https://github.com/davisp/ghp-import.git && - ./ghp-import/ghp_import.py -n -p -f -r https://"$GH_TOKEN"@github.com/"$TRAVIS_REPO_SLUG.git" target/doc -fi From 4b82693e205efde1a896a57c8633058f30bc5865 Mon Sep 17 00:00:00 2001 From: Emily Toop Date: Thu, 23 Aug 2018 16:56:10 +0100 Subject: [PATCH 3/3] Only run deplot on master branch --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 2eadd7f7c..198b8fb91 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,6 +19,7 @@ jobs: rust: 1.25.0 script: ./scripts/test-ios.sh - stage: deploy + if: branch = master rust: 1.25.0 script: ./scripts/build-doc.sh deploy: