fix: release examples
MODIFY
.circleci/config.yml
.circleci/config.yml
@@ -9,16 +9,16 @@ jobs:
- checkout
- restore_cache: &restore_cache
keys:
- - v1-yarn-{{ .Environment.CIRCLE_JOB }}-{{checksum ".circleci/config.yml"}}-{{ .Branch }}-{{checksum "yarn.lock"}}
- - v1-yarn-{{ .Environment.CIRCLE_JOB }}-{{checksum ".circleci/config.yml"}}-{{ .Branch }}-
- - v1-yarn-{{ .Environment.CIRCLE_JOB }}-{{checksum ".circleci/config.yml"}}-master-
+ - v0-yarn-{{checksum ".circleci/config.yml"}}-{{ .Branch }}-{{checksum "yarn.lock"}}
+ - v0-yarn-{{checksum ".circleci/config.yml"}}-{{ .Branch }}-
+ - v0-yarn-{{checksum ".circleci/config.yml"}}-master-
- run: .circleci/yarn
- run: .circleci/setup_git
- run: yarn exec nps test.base
- store_test_results: &store_test_results
path: ~/cli/reports
- - save_cache: &save_cache
- key: v1-yarn-{{ .Environment.CIRCLE_JOB }}-{{checksum ".circleci/config.yml"}}-{{ .Branch }}-{{checksum "yarn.lock"}}
+ - save_cache:
+ key: v0-yarn-{{checksum ".circleci/config.yml"}}-{{ .Branch }}-{{checksum "yarn.lock"}}
paths:
- ~/cli/node_modules
- /usr/local/share/.cache/yarn
@@ -32,7 +32,6 @@ jobs:
- run: .circleci/setup_git
- run: yarn exec nps test.single
- store_test_results: *store_test_results
- - save_cache: *save_cache
node-latest-plugin:
<<: *test
steps:
@@ -42,7 +41,6 @@ jobs:
- run: .circleci/setup_git
- run: yarn exec nps test.plugin
- store_test_results: *store_test_results
- - save_cache: *save_cache
node-latest-multi:
<<: *test
steps:
@@ -52,7 +50,6 @@ jobs:
- run: .circleci/setup_git
- run: yarn exec nps test.multi
- store_test_results: *store_test_results
- - save_cache: *save_cache
node-8-base:
<<: *test
docker:
@@ -64,7 +61,6 @@ jobs:
- run: .circleci/setup_git
- run: yarn exec nps test.base
- store_test_results: *store_test_results
- - save_cache: *save_cache
node-8-single:
<<: *test
docker:
@@ -76,7 +72,6 @@ jobs:
- run: .circleci/setup_git
- run: yarn exec nps test.single
- store_test_results: *store_test_results
- - save_cache: *save_cache
node-8-plugin:
<<: *test
docker:
@@ -88,7 +83,6 @@ jobs:
- run: .circleci/setup_git
- run: yarn exec nps test.plugin
- store_test_results: *store_test_results
- - save_cache: *save_cache
node-8-multi:
<<: *test
docker:
@@ -100,7 +94,6 @@ jobs:
- run: .circleci/setup_git
- run: yarn exec nps test.multi
- store_test_results: *store_test_results
- - save_cache: *save_cache
lint:
<<: *test
@@ -113,7 +106,6 @@ jobs:
- run: .circleci/setup_git
- run: yarn exec nps lint
- store_test_results: *store_test_results
- - save_cache: *save_cache
release:
<<: *test
@@ -124,7 +116,6 @@ jobs:
- run: .circleci/yarn
- run: .circleci/setup_git
- run: ./node_modules/.bin/nps release
- - save_cache: *save_cache
example-multi-cli-typescript: &example
<<: *test
@@ -135,7 +126,6 @@ jobs:
- run: .circleci/yarn
- run: .circleci/setup_git
- run: .circleci/release_example
- - save_cache: *save_cache
workflows:
version: 2
@@ -168,6 +158,6 @@ workflows:
context: org-global
requires:
- release
- - example-multi-cli-javascript: *example_workflow
- - example-single-cli-typescript: *example_workflow
- - example-single-cli-javascript: *example_workflow
+ # - example-multi-cli-javascript: *example_workflow
+ # - example-single-cli-typescript: *example_workflow
+ # - example-single-cli-javascript: *example_workflow

MODIFY
.circleci/release_example
.circleci/release_example
@@ -5,7 +5,8 @@ const fs = require('fs-extra')
sh.set('-ev')
-const {version} = fs.readJSONSync('package.json')
+sh.exec('yarn link')
+const version = process.args[1]
const example = process.env.CIRCLE_JOB
const [, type,, format] = example.split('-')
@@ -25,16 +26,17 @@ sh.rm('-rf', [
'.eslintrc',
'.gitattributes',
'.gitignore',
+'README.md',
'appveyor.yml',
'bin',
+'lib',
'package-scripts.js',
-'README.md',
'src',
'test',
'tsconfig.json',
'tslint.json',
-'yarn.lock'
-].join(' '))
+'yarn.lock',
+])
const pjson = fs.readJSONSync('package.json')
fs.outputJSONSync('package.json', {
@@ -42,24 +44,10 @@ fs.outputJSONSync('package.json', {
repository: `dxcli/${example}`,
author: pjson.author,
version: pjson.version,
+ description: pjson.description,
})
-sh.exec(`yarn create dxcli ${type} --force --defaults ${options}`)
-sh.exec('git add .')
+sh.exec(`create-dxcli ${type} --force --defaults ${options}`)
+sh.exec('git add -A')
sh.exec(`git commit -m "fix: create-dxcli ${version}"`)
sh.exec('git push')
-sh.cd('../..')
-sh.exec(`git add examples/${example}`)
-sh.exec(`git commit -m "chore: ${example} updated [ci-skip]`)
-
-let retries = 4
-function push() {
- try {
- sh.exec('git pull --rebase origin master')
- sh.exec('git push')
- } catch (err) {
- retries--
- if (retries > 0) return push()
- throw err
- }
-}

MODIFY
examples/example-multi-cli-typescript
examples/example-multi-cli-typescript
-Subproject commit 6c717d1fc9d9bed1fc002d4b81337e617e2fbf02
+Subproject commit 1b6403b7bea6f2061d997a51cd4493089e224bcd

MODIFY
package.json
package.json
"devDependencies": {
"@dxcli/dev": "^2.0.2",
"@dxcli/dev-test": "^0.9.11",
+ "@semantic-release/exec": "^1.0.2",
"@types/shelljs": "^0.7.7",
"@types/yeoman-generator": "^2.0.1",
"@types/yosay": "^0.0.29",

ADD
release.config.js
+/* eslint-disable no-template-curly-in-string */
+
+module.exports = {
+ verifyConditions: [
+ '@semantic-release/changelog',
+ '@semantic-release/npm',
+ '@semantic-release/git',
+ '@semantic-release/github',
+ ],
+ publish: [
+ {
+ path: '@semantic-release/exec',
+ cmd: './.circleci/release_example ${nextRelease.version}',
+ },
+ '@semantic-release/changelog',
+ '@semantic-release/npm',
+ {
+ path: '@semantic-release/git',
+ assets: ['package.json', 'examples', 'CHANGELOG.md'],
+ },
+ '@semantic-release/github',
+ ],
+}

MODIFY
yarn.lock
yarn.lock
version "2.1.0"
resolved "https://registry.yarnpkg.com/@semantic-release/error/-/error-2.1.0.tgz#44771f676f5b148da309111285a97901aa95a6e0"
+"@semantic-release/exec@^1.0.2":
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/@semantic-release/exec/-/exec-1.0.2.tgz#655405003d7e694b66ffcb7658dfa59ce9b141bc"
+ dependencies:
+ "@semantic-release/error" "^2.1.0"
+ debug "^3.1.0"
+ execa "^0.9.0"
+ lodash "^4.17.4"
+ parse-json "^4.0.0"
+
"@semantic-release/git@^2.0.2":
version "2.0.3"
resolved "https://registry.yarnpkg.com/@semantic-release/git/-/git-2.0.3.tgz#4348a525ec6dfeb9c43ab4ee8d06813583d05644"

fix: release examples