Skip to content

Commit

Permalink
Use ci workspace (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
poliha authored Apr 22, 2020
1 parent f704e4b commit 7fb7492
Showing 1 changed file with 46 additions and 6 deletions.
52 changes: 46 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,14 @@ commands:
install_deps:
steps:
- checkout
- node/with-cache:
steps:
- run: npm install
- 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" }}
- run: npm install
- save_cache: # special step to save the dependency cache
key: dependency-cache-{{ checksum "package-lock.json" }}
paths:
- ./node_modules
run_linter:
steps:
- checkout
Expand All @@ -22,8 +27,12 @@ commands:
name: build electron package
command: ./scripts/electron-build.sh

orbs:
node: circleci/[email protected]
executors:
my-executor:
docker:
- image: 'circleci/node:erbium'
working_directory: /tmp

jobs:
lint-and-test:
docker:
Expand All @@ -39,11 +48,42 @@ jobs:
- install_deps
- run_linter
- build_electron_pkg
- persist_to_workspace:
root: ~/
paths:
- project/dist

publish-github-release:
docker:
- image: cibuilds/github:0.10
steps:
- attach_workspace:
at: ~/project/dist
- run:
name: 'Publish Release on GitHub'
command: |
if [ "$(ls -A ~/project/dist/)" ]
then
ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} ${CIRCLE_TAG} ~/project/dist/
else
echo "No files found"
fi
workflows:
lint-and-test:
jobs:
- lint-and-test
build-and-release:
jobs:
- build_packages
- build_packages:
filters:
tags:
only: /.*/
- publish-github-release:
requires:
- build_packages
filters:
branches:
ignore: /.*/
tags:
only: /^saza-v.*/

0 comments on commit 7fb7492

Please sign in to comment.