You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+27-19Lines changed: 27 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,18 +2,18 @@
2
2
3
3
Automate the monotonous tasks when it comes to releasing new versions of your project. The features include:
4
4
5
-
-Bump the version in `package.json` (and `package-lock.json`)
6
-
-Update the changelog headline with the new version and release date whenever a release is made
7
-
-Move old changelog entries into another file
8
-
-Add the changelog to the release commit and create a tag for it.
9
-
-Support for monorepos managed with `lerna` or `yarn workspaces` (using additional `yarn` plugins)
10
-
-Support for custom scripts during the release lifecycle
11
-
-Check licenses for outdated copyrights
12
-
-Dry runs and checking for errors
13
-
-**ioBroker only**:
14
-
-Bump the version in `io-package.json`
15
-
-Update the `news` in `io-package.json` and auto-translate the changelog to the other languages
16
-
-Remove old `news`
5
+
- Bump the version in `package.json` (and `package-lock.json`)
6
+
- Update the changelog headline with the new version and release date whenever a release is made
7
+
- Move old changelog entries into another file
8
+
- Add the changelog to the release commit and create a tag for it.
9
+
- Support for monorepos managed with `lerna` or `yarn workspaces` (using additional `yarn` plugins)
10
+
- Support for custom scripts during the release lifecycle
11
+
- Check licenses for outdated copyrights
12
+
- Dry runs and checking for errors
13
+
-**ioBroker only**:
14
+
- Bump the version in `io-package.json`
15
+
- Update the `news` in `io-package.json` and auto-translate the changelog to the other languages
16
+
- Remove old `news`
17
17
18
18
Together with the corresponding **Github Actions** workflow (more on that below) this enables auto-publishing on `npm` and `Github Releases` if the build was successful.
19
19
@@ -72,8 +72,8 @@ In order to use this script, you need to maintain the changelog in either `READM
72
72
73
73
## **WORK IN PROGRESS**
74
74
75
-
- Did some changes
76
-
- Did some more changes
75
+
- Did some changes
76
+
- Did some more changes
77
77
78
78
## v0.0.1 (2020-01-01)
79
79
@@ -166,8 +166,8 @@ Instead of manually providing all options, you can configure the release process
166
166
"plugins": ["iobroker", "lerna"],
167
167
// Objects
168
168
"exec": {
169
-
"before_commit": "echo Hello World!"
170
-
}
169
+
"before_commit": "echo Hello World!",
170
+
},
171
171
}
172
172
```
173
173
@@ -291,7 +291,7 @@ or to `.releaseconfig.json` if you're using that:
291
291
```jsonc
292
292
{
293
293
// ... other options
294
-
"plugins": ["iobroker", "license"]
294
+
"plugins": ["iobroker", "license"],
295
295
}
296
296
```
297
297
@@ -342,6 +342,14 @@ When this option is set, nothing will be pushed to the remote. This option can b
342
342
npm run release patch -- --noPush
343
343
```
344
344
345
+
#### Configure branches from which releases can be created (`--branchPattern`)
346
+
347
+
By default, the release script only allows creating releases from the repository's default branch (usually `main` or `master`). If you want to allow releases from other branches, you can use this option. It supports `*` as a wildcard, e.g. `release/*` to allow releases from all branches starting with `release/`. Can be specified multiple times.
348
+
349
+
```bash
350
+
npm run release patch -- --branchPattern main --branchPattern release/*
351
+
```
352
+
345
353
### `changelog` plugin options
346
354
347
355
#### Limit the number of entries in README.md (`--numChangelogEntries` or `-n`)
@@ -402,8 +410,8 @@ To run custom scripts, you can use these options. They accept an object defining
402
410
// Run "echo 1", "echo 2", "echo 3" after the "push" stage
Current branch: ${context.cli.colors.red(currentBranch)}
130
+
131
+
Note: Use the --branch-pattern option to customize this behavior.`;
132
+
context.cli.fatal(message);
133
+
}
134
+
}
135
+
70
136
classGitPluginimplementsPlugin{
71
137
publicreadonlyid="git";
72
138
publicreadonlystages=[
@@ -103,6 +169,12 @@ class GitPlugin implements Plugin {
103
169
description: "Do not push anything to the remote",
104
170
default: false,
105
171
},
172
+
branchPattern: {
173
+
type: "string",
174
+
array: true,
175
+
description:
176
+
"On which git branches a release may be created. Supports '*' as a wildcard. Defaults to the repository's default branch, or ['main', 'master'] if it cannot be determined.",
177
+
},
106
178
});
107
179
}
108
180
@@ -128,6 +200,10 @@ Note: If the current folder belongs to a different user than ${colors.bold(
0 commit comments