@cmflow/cli 2.0.0-alpha.2 → 2.0.0-alpha.4

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
@@ -95,7 +95,6 @@ export default defineConfig({
95
95
  ]
96
96
  ],
97
97
  success: [
98
- '@cmflow/cli/semantic/success',
99
98
  [
100
99
  '@cmflow/cli/semantic/conditional',
101
100
  {
@@ -106,6 +105,7 @@ export default defineConfig({
106
105
  ],
107
106
  fail: [
108
107
  [
108
+ "@cmflow/cli/semantic/conditional",
109
109
  {
110
110
  // when: (context) => context.branch.type === "release" // default condition to run the task
111
111
  run: '@semantic-release/github' // only run if the conditional rule is true
@@ -165,6 +165,26 @@ Example:
165
165
  }
166
166
  ```
167
167
 
168
+ ### Generate release.info file
169
+
170
+ CmFlow release generate a `release.info` file in the root of your project. This file contains the branch name.
171
+
172
+ ```js
173
+ import { defineConfig } from '@cmflow/cli'
174
+
175
+ export default defineConfig({
176
+ prepare: [
177
+ '@cmflow/cli/semantic/prepare/bump-version',
178
+ [
179
+ '@cmflow/cli/semantic/prepare/release-info',
180
+ {
181
+ path: './resources/release.info'
182
+ }
183
+ ]
184
+ ]
185
+ })
186
+ ```
187
+
168
188
  ### Deploy on Docker Hub
169
189
 
170
190
  Add the following configuration to your `release.config.js`:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cmflow/cli",
3
- "version": "2.0.0-alpha.2",
3
+ "version": "2.0.0-alpha.4",
4
4
  "description": "An awesome Git Flow",
5
5
  "author": "camfou",
6
6
  "license": "MIT",
@@ -26,10 +26,10 @@
26
26
  "cmstart": "bin/cm-start.js"
27
27
  },
28
28
  "exports": {
29
- ".": "./index.js",
30
- "./semantic/prepare/*": "./src/semantic-release/core/prepare/*.js",
31
- "./semantic/*": "./src/semantic-release/core/*.js",
32
- "./semantic/docker/*": "./src/semantic-release/docker/*.js"
29
+ ".": "./src/index.js",
30
+ "./semantic/prepare/*": "./src/semantic/core/prepare/*.js",
31
+ "./semantic/*": "./src/semantic/core/*.js",
32
+ "./semantic/docker/*": "./src/semantic/docker/*.js"
33
33
  },
34
34
  "dependencies": {
35
35
  "@semantic-release/release-notes-generator": ">=14.0.3",
@@ -1,4 +1,9 @@
1
1
  import { getConfig } from "../../common/index.js";
2
+
3
+ export function prepare(pluginConfig, context) {
4
+ return runAll(pluginConfig, context, context.branch?.type === "release");
5
+ }
6
+
2
7
  export function success(pluginConfig, context) {
3
8
  return runAll(pluginConfig, context, context.branch?.type === "release");
4
9
  }
@@ -0,0 +1,5 @@
1
+ import { writeFile } from "fs:node/promises";
2
+
3
+ export function prepare(pluginConfig, context) {
4
+ return writeFile(pluginConfig.path, context.branch.name, { encoding: "utf-8" });
5
+ }