Skip to content

Commit

Permalink
Integrate Travis (#33)
Browse files Browse the repository at this point in the history
* Added travis.yml

* Adjust config

* Add deployment

* Build PR different than master branch

* test new config

* 1.0.1

* wip

* Should hopefully work
  • Loading branch information
UnchartedBull authored Jul 16, 2019
1 parent 4d7e25f commit 13f21eb
Show file tree
Hide file tree
Showing 6 changed files with 101 additions and 21 deletions.
55 changes: 55 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
dist: trusty
sudo: false

language: node_js
node_js:
- "10"

before_deploy:
- git config --global user.email "[email protected]"
- git config --global user.name "UnchartedBull"
- git config --global push.default matching
- git config credential.helper "store --file=.git/credentials"
- echo "https://${GITHUB_API_KEY}:@github.com" > .git/credentials
- mv $TRAVIS_BUILD_DIR/package/*armv7l.deb $TRAVIS_BUILD_DIR/OctoDash_$(git describe --tags $(git rev-list --tags --max-count=1))_armv7l.deb
- mv $TRAVIS_BUILD_DIR/package/*arm64.deb $TRAVIS_BUILD_DIR/OctoDash_$(git describe --tags $(git rev-list --tags --max-count=1))_arm64.deb

cache:
directories:
- ./node_modules

install:
- npm install

jobs:
include:
- stage: lint
name: "Linting Angular Application ..."
script: ng lint
- stage: build
if: type = pull_request
name: "Building Angular Application ..."
script: npm run ng:build
- stage: build
if: type = push
name: "Packaging Electron App ..."
script: npm run pack
- stage: deploy
if: type = push
name: "Deploying the GitHub Releases ..."
deploy:
provider: script
skip_cleanup: true
script: .travis/bump_version.sh
on:
branch: master
tags: false
deploy:
provider: releases
api_key: $GITHUB_TOKEN
skip_cleanup: true
draft: true
file_glob: true
file:
- "OctoDash_*_armv7l.deb"
- "OctoDash_*_arm64.deb"
25 changes: 25 additions & 0 deletions .travis/bump_version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/sh

make_version() {
git checkout -- .
git status
COMMIT=$(git log -1 --pretty=%B)
VERSION_BUMP="patch"
if [[ $COMMIT == *"version:major"* ]]; then
VERSION_BUMP="major"
fi
if [[ $COMMIT == *"version:minor"* ]]; then
VERSION_BUMP="minor"
fi
echo "commit message: "$COMMIT
echo "will execute npm version "$VERSION_BUMP
npm version $VERSION_BUMP -m "bump version to %s [skip ci]"
}

upload_files() {
git push origin HEAD:$TRAVIS_BRANCH
git push --tags
}

make_version
upload_files
2 changes: 1 addition & 1 deletion angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
"tsConfig": [
"tsconfig.app.json",
"tsconfig.spec.json",
"e2e/tsconfig.json"
"tsconfig.json"
],
"exclude": [
"**/node_modules/**"
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 1 addition & 19 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,24 +39,6 @@
]
}],
"category": "Utility"
},
"mac": {
"target": [{
"target": "dmg",
"arch": [
"x64"
]
}],
"category": "public.app-category.utilities"
},
"win": {
"target": [{
"target": "portable",
"arch": [
"x64",
"ia32"
]
}]
}
},
"scripts": {
Expand All @@ -70,7 +52,7 @@
"electron": "electron .",
"electron:serve": "wait-on http-get://localhost:4200/ && electron . --serve",
"electron:serve:big": "wait-on http-get://localhost:4200/ && electron . --serve --big",
"pack": "npm run ng:build && electron-builder build -lmw",
"pack": "npm run ng:build && electron-builder build -l",
"ng:serve": "ng serve",
"ng:build": "ng build --prod"
},
Expand Down
18 changes: 18 additions & 0 deletions tsconfig.spec.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./out-tsc/spec",
"types": [
"jasmine",
"node"
]
},
"files": [
"src/test.ts",
"src/polyfills.ts"
],
"include": [
"src/**/*.spec.ts",
"src/**/*.d.ts"
]
}

0 comments on commit 13f21eb

Please sign in to comment.