Skip to content

Commit

Permalink
Update travis build script
Browse files Browse the repository at this point in the history
Use new build script.
Move script into a new dir.
  • Loading branch information
ganlvtech committed Oct 26, 2018
1 parent 3547b97 commit a0b97f9
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 43 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ yarn-error.log*

/public/list.json
/php/origin.json
/dist.zip
/dist.zip
/gh-pages
61 changes: 25 additions & 36 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,25 @@
matrix:
include:
- language: node_js
node_js:
- "node"
branches:
only:
- master
script:
- chmod 777 ./build_release.sh
- ./build_release.sh
deploy:
provider: releases
api-key: $GITHUB_TOKEN
file: ./dist.zip
skip-cleanup: true
on:
tags: true

- language: node_js
node_js:
- "node"
branches:
only:
- master
script:
- chmod 777 ./build_github_pages.sh
- ./build_github_pages.sh
deploy:
provider: pages
local-dir: dist
skip-cleanup: true
github-token: $GITHUB_TOKEN
keep-history: true
on:
branch: master
language: node_js
node_js:
- "10"
branches:
only:
- master
script:
- chmod 777 ./build/build_release.sh
- ./build/build_release.sh
- chmod 777 ./build/build_github_pages.sh
- ./build/build_github_pages.sh
deploy:
- provider: releases
api-key: $GITHUB_TOKEN
file: ./dist.zip
skip-cleanup: true
on:
tags: true
- provider: pages
local-dir: gh-pages
skip-cleanup: true
github-token: $GITHUB_TOKEN
keep-history: true
on:
branch: master
8 changes: 8 additions & 0 deletions build_github_pages.sh → build/build_github_pages.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#!/usr/bin/env bash
pushd $(dirname $0)
cd ..

export BUILD_GITHUB_PAGES=true

npm install
npm run build

Expand All @@ -9,3 +13,7 @@ pushd php/
composer install
php crawl.php
popd

mv dist/ gh-pages/

popd
15 changes: 9 additions & 6 deletions build_release.sh → build/build_release.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
#!/usr/bin/env bash
pushd $(dirname $0)
cd ..

export USE_FANCY_INDEX=true
mkdir backup
cp public/index.html backup/index.html
sed -i "s/new Down52PojieCn({/& routerMode: 'history', requestType: 'jsonp' /g" public/index.html

rm -rf dist/

npm install
npm run build

sed -i "s/new Down52PojieCn({/& routerMode: 'history', requestType: 'jsonp' /g" dist/.fancyindex/footer.html

rm dist/index.html
cp LICENSE dist/
cp php/ dist/ -R
cp LICENSE dist/
cp README.md dist/
zip dist.zip -r dist
rm -rf dist/

cp backup/index.html public/index.html
rm -rf backup/
popd

0 comments on commit a0b97f9

Please sign in to comment.