Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
poliha committed Apr 23, 2020
2 parents 7fb7492 + a3cf304 commit 6f5b230
Showing 1 changed file with 25 additions and 12 deletions.
37 changes: 25 additions & 12 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ commands:
install_deps:
steps:
- checkout
- attach_workspace:
at: ~/saza-repo
- restore_cache: # special step to restore the dependency cache
# Read about caching dependencies: https://circleci.com/docs/2.0/caching/
key: dependency-cache-{{ checksum "package-lock.json" }}
Expand All @@ -15,56 +17,65 @@ commands:
run_linter:
steps:
- checkout
- attach_workspace:
at: ~/saza-repo
- run: npm run lint
run_test:
steps:
- checkout
- attach_workspace:
at: ~/saza-repo
- run: npm test -- --no-watch --no-progress --browsers=ChromeHeadlessCI
build_electron_pkg:
steps:
- checkout
- attach_workspace:
at: ~/saza-repo
- run:
name: build electron package
command: ./scripts/electron-build.sh

executors:
my-executor:
docker:
- image: 'circleci/node:erbium'
working_directory: /tmp

jobs:
lint-and-test:
docker:
- image: circleci/node:erbium-browsers
working_directory: ~/saza-repo
steps:
- install_deps
- run_linter
- run_test
build_packages:
docker:
- image: circleci/node:erbium
working_directory: ~/saza-repo
steps:
- install_deps
- run_linter
- build_electron_pkg
- persist_to_workspace:
root: ~/
root: .
paths:
- project/dist
- dist

publish-github-release:
docker:
- image: cibuilds/github:0.10
working_directory: ~/saza-repo
steps:
- attach_workspace:
at: ~/project/dist
at: ~/saza-repo
- run:
name: list directory content
command: ls -alh .
- run:
name: list dist directory content
command: ls -alh ./dist/
- run:
name: 'Publish Release on GitHub'
command: |
if [ "$(ls -A ~/project/dist/)" ]
if [ "$(ls -A ./dist/)" ]
then
ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} ${CIRCLE_TAG} ~/project/dist/
ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -delete ${CIRCLE_TAG} ./dist/
else
echo "No files found"
fi
Expand All @@ -77,8 +88,10 @@ workflows:
jobs:
- build_packages:
filters:
branches:
ignore: /.*/
tags:
only: /.*/
only: /^saza-v.*/
- publish-github-release:
requires:
- build_packages
Expand Down

0 comments on commit 6f5b230

Please sign in to comment.