diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..ff9e240a1 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,25 @@ +language: node_js +sudo: false +dist: trusty +node_js: + - 10.9.0 +addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - g++-4.8 + chrome: stable +branches: + except: + - g3 +cache: + yarn: true + directories: + - "./node_modules" +before_install: + - curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.13.0 + - export PATH="$HOME/.yarn/bin:$PATH" +script: + - "./scripts/deploy/publish-docs-content.sh" + - "./scripts/deploy/deploy-cn.sh" diff --git a/package.json b/package.json index 3a0560798..a7f146f62 100644 --- a/package.json +++ b/package.json @@ -104,7 +104,7 @@ "@types/marked": "^1.2.1", "@types/merge2": "^0.3.30", "@types/minimist": "^1.2.0", - "@types/node": "^12.11.1", + "@types/node": "^14.14.21", "@types/node-fetch": "^2.5.5", "@types/parse5": "^6.0.0", "@types/resize-observer-browser": "^0.1.3", diff --git a/scripts/deploy/deploy-cn.sh b/scripts/deploy/deploy-cn.sh new file mode 100755 index 000000000..01cbdaf05 --- /dev/null +++ b/scripts/deploy/deploy-cn.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +set -x +set -e + +git clone https://github.com/ng-docs/material.github.io.git + +cd ./material.github.io + +npm i + +./scripts/ci/deploy-cn.sh + +cd - + diff --git a/scripts/deploy/publish-docs-content.sh b/scripts/deploy/publish-docs-content.sh index 1a7de44bd..4c8e3a4b4 100755 --- a/scripts/deploy/publish-docs-content.sh +++ b/scripts/deploy/publish-docs-content.sh @@ -8,9 +8,9 @@ set -e cd "$(dirname $0)/../../" -if [ -z ${MATERIAL2_BUILDS_TOKEN} ]; then +if [ -z ${GITHUB_ACCESS_TOKEN} ]; then echo "Error: No access token for GitHub could be found." \ - "Please set the environment variable 'MATERIAL2_BUILDS_TOKEN'." + "Please set the environment variable 'GITHUB_ACCESS_TOKEN'." exit 1 fi @@ -28,13 +28,13 @@ docsContentPath="${projectPath}/tmp/material2-docs-content" examplesPackagePath="${projectPath}/dist/docs-content-pkg/" # Git clone URL for the material2-docs-content repository. -docsContentRepoUrl="https://github.com/angular/material2-docs-content" +docsContentRepoUrl="https://github.com/ng-docs/material2-docs-content" # Current version of Angular Material from the package.json file buildVersion=$(node -pe "require('./package.json').version") # Name of the branch that is currently being deployed. -branchName=${CIRCLE_BRANCH:-'master'} +branchName=${TRAVIS_BRANCH:-'master'} # Additional information about the last commit for docs-content commits. commitSha=$(git rev-parse --short HEAD) @@ -96,7 +96,7 @@ git config user.name "$commitAuthorName" git config user.email "$commitAuthorEmail" git config credential.helper "store --file=.git/credentials" -echo "https://${MATERIAL2_BUILDS_TOKEN}:@github.com" > .git/credentials +echo "https://${GITHUB_ACCESS_TOKEN}:@github.com" > .git/credentials echo "Credentials for docs-content repository are now set up. Publishing.." diff --git a/yarn.lock b/yarn.lock index 980512cad..202d6ed7e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1974,20 +1974,20 @@ "@types/node" "*" form-data "^3.0.0" -"@types/node@*", "@types/node@>= 8", "@types/node@^13.7.0": - version "13.13.34" - resolved "https://registry.yarnpkg.com/@types/node/-/node-13.13.34.tgz#c9300a1b6560d90817fb2bba650e250116a575f9" - integrity sha512-g8D1HF2dMDKYSDl5+79izRwRgNPsSynmWMbj50mj7GZ0b7Lv4p8EmZjbo3h0h+6iLr6YmVz9VnF6XVZ3O6V1Ug== +"@types/node@*", "@types/node@>= 8", "@types/node@^14.14.21": + version "14.14.21" + resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.21.tgz#d934aacc22424fe9622ebf6857370c052eae464e" + integrity sha512-cHYfKsnwllYhjOzuC5q1VpguABBeecUp24yFluHpn/BQaVxB1CuQ1FSRZCzrPxrkIfWISXV2LbeoBthLWg0+0A== "@types/node@10.17.13", "@types/node@^10.1.0": version "10.17.13" resolved "https://registry.yarnpkg.com/@types/node/-/node-10.17.13.tgz#ccebcdb990bd6139cd16e84c39dc2fb1023ca90c" integrity sha512-pMCcqU2zT4TjqYFrWtYHKal7Sl30Ims6ulZ4UFXxI4xbtQqK/qqKwkDoBFCfooRqqmRu9vY3xaJRwxSh673aYg== -"@types/node@^12.11.1": - version "12.11.1" - resolved "https://registry.yarnpkg.com/@types/node/-/node-12.11.1.tgz#1fd7b821f798b7fa29f667a1be8f3442bb8922a3" - integrity sha512-TJtwsqZ39pqcljJpajeoofYRfeZ7/I/OMUQ5pR4q5wOKf2ocrUvBAZUMhWsOvKx3dVc/aaV5GluBivt0sWqA5A== +"@types/node@^13.7.0": + version "13.13.34" + resolved "https://registry.yarnpkg.com/@types/node/-/node-13.13.34.tgz#c9300a1b6560d90817fb2bba650e250116a575f9" + integrity sha512-g8D1HF2dMDKYSDl5+79izRwRgNPsSynmWMbj50mj7GZ0b7Lv4p8EmZjbo3h0h+6iLr6YmVz9VnF6XVZ3O6V1Ug== "@types/normalize-package-data@^2.4.0": version "2.4.0"