@cmflow/cli 2.0.0-alpha.13 → 2.0.0-alpha.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Binary file
package/README.md CHANGED
@@ -89,7 +89,7 @@ export default defineConfig({
89
89
  {
90
90
  // when: (context) => context.branch.type === "release" // default condition to run the task
91
91
  run: [
92
- '@cmflow/cli/semantic/core/publish/sync-repository',
92
+ '@cmflow/cli/semantic/core/sync-repository',
93
93
  '@semantic-release/github'
94
94
  ] // only run if the conditional rule is true
95
95
  }
@@ -98,7 +98,7 @@ export default defineConfig({
98
98
  '@cmflow/cli/semantic/core/conditional', // run process.exit(0) if the branch is not a release branch - legacy: maybe not necessary now all task are conditional
99
99
  {
100
100
  when: (context) => context.branch.type !== 'release',
101
- run: '@cmflow/cli/semantic/core/publish/exit'
101
+ run: '@cmflow/cli/semantic/core/exit'
102
102
  }
103
103
  ]
104
104
  ],
@@ -172,6 +172,26 @@ Example:
172
172
  }
173
173
  }
174
174
  ```
175
+ Then:
176
+
177
+ ```javascript
178
+ export default defineConfig({
179
+ prepare: [
180
+ [
181
+ '@cmflow/cli/semantic/core/run',
182
+ {
183
+ command: 'build'
184
+ }
185
+ ],
186
+ [
187
+ '@cmflow/cli/semantic/core/run',
188
+ {
189
+ command: 'test_e2e'
190
+ }
191
+ ]
192
+ ]
193
+ })
194
+ ```
175
195
 
176
196
  ### Generate release.info file
177
197
 
@@ -202,33 +222,21 @@ import { defineConfig } from '@cmflow/cli'
202
222
 
203
223
  export default defineConfig({
204
224
  publish: [
205
- [
206
- '@cmflow/cli/semantic/conditional',
207
- {
208
- run: '@semantic-release/github'
209
- }
210
- ],
211
225
  '@cmflow/cli/semantic/docker/publish'
212
226
  ]
213
227
  });
214
228
  ```
215
229
 
216
- ### Clean docker tags
230
+ ### Publish & Clean docker tags
217
231
 
218
232
  ```js
219
233
  import { defineConfig } from '@cmflow/cli'
220
234
 
221
235
  export default defineConfig({
222
236
  success: [
223
- [
224
- '@cmflow/cli/semantic/success',
225
- {
226
- runAfter: '@semantic-release/github' // only run if the conditional rule is true
227
- }
228
- ],
229
- '@cmflow/cli/semantic/docker/publish'
237
+ '@cmflow/cli/semantic/docker/success'
230
238
  ]
231
- });
239
+ })
232
240
  ```
233
241
 
234
242
  ### Configure CI
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cmflow/cli",
3
- "version": "2.0.0-alpha.13",
3
+ "version": "2.0.0-alpha.14",
4
4
  "description": "An awesome Git Flow",
5
5
  "author": "camfou",
6
6
  "license": "MIT",
@@ -31,7 +31,7 @@ export default defineConfig({
31
31
  ]
32
32
  ],
33
33
  prepare: ["./src/semantic/core/prepare/bump-version.js", "./src/semantic/core/prepare/commit.js"],
34
- publish: ["./src/semantic/core/publish/sync-repository.js", "@semantic-release/github"],
34
+ publish: ["./src/semantic/core/sync-repository.js", "@semantic-release/github"],
35
35
  success: ["@semantic-release/github"],
36
36
  fail: ["@semantic-release/github"],
37
37
  npmPublish: false
@@ -0,0 +1,8 @@
1
+ import { getConfig } from "../../common/index.js";
2
+
3
+ export default async function exit(_, context) {
4
+ context.config = getConfig();
5
+ // avoid next semantic-release steps when is a prerelease or release branch with SKIP_GITHUB_PUBLISH
6
+ context.logger.success("Skip next semantic-release steps");
7
+ process.exit(0);
8
+ }
@@ -1,11 +1,11 @@
1
- import { getConfig, npm, yarn } from "../../../common/index.js";
1
+ import { getConfig, npm, yarn } from "../../common/index.js";
2
2
 
3
3
  /**
4
4
  * @param pluginConfig {{command: string}}
5
5
  * @param context
6
6
  * @return {Promise<void>}
7
7
  */
8
- export async function prepare(pluginConfig, context) {
8
+ export default async function runCommand(pluginConfig, context) {
9
9
  context.config = getConfig();
10
10
  const {
11
11
  config: { HAS_YARN },
@@ -1,6 +1,6 @@
1
- import { getConfig, git } from "../../../common/index.js";
1
+ import { getConfig, git } from "../../common/index.js";
2
2
 
3
- export async function publish(pluginConfig, context) {
3
+ export default async function syncRepository(pluginConfig, context) {
4
4
  context.config = getConfig();
5
5
 
6
6
  const {
@@ -1,7 +0,0 @@
1
- import { getConfig } from "../../../common/index.js";
2
-
3
- export async function prepare(pluginConfig, context) {
4
- context.config = getConfig();
5
- // avoid next semantic-release steps when is a prerelease or release branch with SKIP_GITHUB_PUBLISH
6
- process.exit(0);
7
- }