Skip to content

Commit

Permalink
feat: release examples automatically
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed Jan 27, 2018
1 parent 77cbc91 commit 6c95bd9
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 22 deletions.
62 changes: 40 additions & 22 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,30 +126,48 @@ jobs:
- run: ./node_modules/.bin/nps release
- save_cache: *save_cache

example-multi-cli-typescript: &example
<<: *test
steps:
- add_ssh_keys
- checkout
- restore_cache: *restore_cache
- run: .circleci/greenkeeper
- run: .circleci/setup_git
- run: .circleci/release_example
- save_cache: *save_cache

workflows:
version: 2
"create-dxcli":
create-dxcli:
jobs:
- lint
- node-latest-base
- node-latest-single
- node-latest-plugin
- node-latest-multi
- node-8-base
- node-8-single
- node-8-plugin
- node-8-multi
- release:
# - lint
# - node-latest-base
# - node-latest-single
# - node-latest-plugin
# - node-latest-multi
# - node-8-base
# - node-8-single
# - node-8-plugin
# - node-8-multi
# - release:
# context: org-global
# filters:
# branches: {only: master}
# requires:
# - lint
# - node-latest-base
# - node-latest-single
# - node-latest-plugin
# - node-latest-multi
# - node-8-base
# - node-8-single
# - node-8-plugin
# - node-8-multi
- example-multi-cli-typescript: &example_workflow
context: org-global
filters:
branches: {only: master}
requires:
- lint
- node-latest-base
- node-latest-single
- node-latest-plugin
- node-latest-multi
- node-8-base
- node-8-single
- node-8-plugin
- node-8-multi
- release
# - example-multi-cli-javascript: *example_workflow
# - example-single-cli-typescript: *example_workflow
# - example-single-cli-javascript: *example_workflow
17 changes: 17 additions & 0 deletions .circleci/release_example
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env node

const sh = require('shelljs')

sh.set('-ev')

const example = process.env.CIRCLE_JOB
const [, type,, format] = example.split('-')

console.dir({type, format})

const options = format === 'typescript' ?
'--options=typescript,mocha,semantic-release' :
'--options=mocha,semantic-release'

sh.cd(`examples/${example}`)
sh.exec(`yarn create dxcli ${type} --defaults ${options}`)

0 comments on commit 6c95bd9

Please sign in to comment.