File tree Expand file tree Collapse file tree 4 files changed +65
-0
lines changed Expand file tree Collapse file tree 4 files changed +65
-0
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,9 @@ before_script:
5252script :
5353 - ./scripts/ci/build-and-test.sh
5454
55+ after_success :
56+ - ./scripts/ci/after-success.sh
57+
5558cache :
5659 directories :
5760 - node_modules
Original file line number Diff line number Diff line change 8787 "strip-ansi" : " ^3.0.0" ,
8888 "stylelint" : " ^7.5.0" ,
8989 "symlink-or-copy" : " ^1.0.1" ,
90+ "travis-after-modes" : " 0.0.5" ,
9091 "ts-node" : " ^0.7.3" ,
9192 "tslint" : " ^3.13.0" ,
9293 "typedoc" : " ^0.5.1" ,
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ # Script which always runs when the current Travis mode succeeds.
4+ # Used to run the travis-after-modes script, which checks if all other modes finished.
5+
6+ # Go to the project root directory
7+ cd $( dirname $0 ) /../..
8+
9+ npmBin=$( npm bin)
10+ ciResult=$( $npmBin /travis-after-modes)
11+
12+ if [ " $ciResult " = " PASSED" ] && [ -z " $TRAVIS_PULL_REQUEST " ]; then
13+ echo " All travis modes passed. Publishing the build artifacts..."
14+ ./scripts/release/publish-build-artifacts.sh
15+ fi
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ # Script to publish the build artifacts to a GitHub repository.
4+ # Builds will be automatically published once new changes are made to the repository.
5+
6+ # Go to the project root directory
7+ cd $( dirname $0 ) /../..
8+
9+ buildDir=" dist/@angular/material"
10+ buildVersion=$( sed -nE ' s/^\s*"version": "(.*?)",$/\1/p' package.json)
11+
12+ commitSha=$( git rev-parse --short HEAD)
13+ commitAuthor=$( git --no-pager show -s --format=' %an <%ae>' HEAD)
14+ commitMessage=$( git log --oneline | head -n1)
15+
16+ repoName=" material-builds"
17+ repoUrl=" http://github.com/DevVersion/material-builds.git"
18+ repoDir=" tmp/$repoName "
19+
20+ # Create a release of the current repository.
21+ $( npm bin) /gulp build:release
22+
23+ # Prepare cloning the builds repository
24+ rm -rf $repoDir
25+ mkdir -p $repoDir
26+
27+ # Clone the repository
28+ git clone $repoUrl $repoDir
29+
30+ # Copy the build files to the repository
31+ rm -rf $repoDir /*
32+ cp -r $buildDir /* $repoDir
33+
34+ # Create the build commit and push the changes to the repository.
35+ cd $repoDir &&
36+
37+ # Setup the git repository authentication.
38+ git config credential.helper " store --file=.git/credentials" &&
39+ echo " $MATERIAL2_BUILDS_TOKEN " > .git/credentials
40+
41+ git add -A &&
42+ git commit -m " $commitMessage " --author " $commitAuthor " &&
43+ git tag " $buildVersion -$commitSha " &&
44+ git push origin master --tags
45+
46+ echo " Finished publishing build artifacts"
You can’t perform that action at this time.
0 commit comments