feat: release examples automatically
MODIFY
.circleci/config.yml
.circleci/config.yml
@@ -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

ADD
.circleci/release_example
+#!/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}`)

feat: release examples automatically