autorel 1.1.6 → 2.0.1
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.
- package/README.md +12 -12
- package/dist/cli.js +10 -4
- package/dist/config.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +17 -2
package/README.md
CHANGED
|
@@ -181,16 +181,16 @@ Whether to publish the release to NPM. If `true`, you must be authenticated with
|
|
|
181
181
|
|
|
182
182
|
Whether to run in dry-run mode. This will not push the tag, create the release, publish to NPM, or run the command.
|
|
183
183
|
|
|
184
|
-
- CLI: `--dry`
|
|
184
|
+
- CLI: `--dry-run`
|
|
185
185
|
- Argument: `dryRun: boolean`
|
|
186
186
|
- Default: `false`
|
|
187
187
|
|
|
188
|
-
##
|
|
188
|
+
## skipRelease
|
|
189
189
|
|
|
190
190
|
Whether to skip creating a release on GitHub. If `true`, the release will not be created, but the tag will still be pushed and the package on npm will still be updated, if applicable.
|
|
191
191
|
|
|
192
|
-
- CLI: `--
|
|
193
|
-
- Argument: `
|
|
192
|
+
- CLI: `--skip-release`
|
|
193
|
+
- Argument: `skipRelease: boolean`
|
|
194
194
|
- Default: `false`
|
|
195
195
|
|
|
196
196
|
## run
|
|
@@ -223,11 +223,11 @@ runScript: |
|
|
|
223
223
|
- Argument: `runScript: string`
|
|
224
224
|
- Default: `undefined`
|
|
225
225
|
|
|
226
|
-
##
|
|
226
|
+
## preRelease
|
|
227
227
|
|
|
228
|
-
|
|
228
|
+
> ❗️ This is typically set via the `branches` configuration (recommended), but can be overridden here.
|
|
229
229
|
|
|
230
|
-
This
|
|
230
|
+
The pre-release channel to use. This will be appended to the version number. For example, if the version is `1.0.0` and the pre-release is `alpha`, the version will be `1.0.0-alpha.1`. For "production" releases, the "latest" tag will be used for NPM.
|
|
231
231
|
|
|
232
232
|
- CLI: `--pre-release`
|
|
233
233
|
- Argument: `preRelease: string`
|
|
@@ -248,19 +248,19 @@ The commit types to use for both the release notes and version bumping. If not p
|
|
|
248
248
|
|
|
249
249
|
## branches (YAML only)
|
|
250
250
|
|
|
251
|
-
The branches to use for the release along with their channel. If not provided, the default is:
|
|
251
|
+
The branches to use for the release along with their pre-release channel. If not provided, the default is:
|
|
252
252
|
|
|
253
253
|
```yaml
|
|
254
254
|
- {name: 'main'}
|
|
255
255
|
```
|
|
256
256
|
|
|
257
|
-
The above will release to the `latest` channel on NPM. If you want to release to a different channel, you can specify it like so:
|
|
257
|
+
The above will release to the `latest` channel on NPM. If you want to release to a different channel (making it a pre-release), you can specify it like so:
|
|
258
258
|
|
|
259
259
|
```yaml
|
|
260
260
|
branches:
|
|
261
261
|
- {name: 'main'}
|
|
262
|
-
- {name: 'develop',
|
|
263
|
-
- {name: 'staging',
|
|
262
|
+
- {name: 'develop', prereleaseChannel: 'alpha'}
|
|
263
|
+
- {name: 'staging', prereleaseChannel: 'beta'}
|
|
264
264
|
```
|
|
265
265
|
|
|
266
266
|
The above will release to the `latest` channel (production) on NPM for the `main` branch, the `alpha` pre-release channel for the `develop` branch, and the `beta` pre-release channel for the `staging` branch.
|
|
@@ -284,7 +284,7 @@ The version to use for the release INSTEAD of the version being generated. Alway
|
|
|
284
284
|
# Define the branches and their respective channels
|
|
285
285
|
branches:
|
|
286
286
|
- {name: 'main'}
|
|
287
|
-
- {name: 'next',
|
|
287
|
+
- {name: 'next', prereleaseChannel: 'next'}
|
|
288
288
|
|
|
289
289
|
# Enable publishing to NPM
|
|
290
290
|
publish: true
|
package/dist/cli.js
CHANGED
|
@@ -17,23 +17,29 @@ console.log('----------------------------');
|
|
|
17
17
|
program
|
|
18
18
|
.version(packageJson.version, '-v, --version')
|
|
19
19
|
.description('An example CLI for managing a directory')
|
|
20
|
-
.option('--
|
|
20
|
+
.option('--dryRun', 'Do a dry run (arg: dryRun)')
|
|
21
21
|
.option('--pre-release <value>', 'Pre-release channel. If specified, the release will be marked as a pre-release. Overrides branches configuration. (arg: preRelease)')
|
|
22
22
|
.option('--use-version <value>', 'Specify a version to be used instead of calculating it from commit analysis. Must be a valid SemVer version, with no \'v\'. Overrides --pre-release, commitType, and branches configuration. (arg: useVersion)')
|
|
23
23
|
.option('--run <value>', 'Command to run after the release is successful. (arg: run)')
|
|
24
|
-
.option('--
|
|
24
|
+
.option('--skip-release', 'Skips creating a release on GitHub. (arg: skipRelease)')
|
|
25
25
|
.option('--publish', 'Publish the package to npm, requires passing --npm-token or NPM_TOKEN environment variable. (arg: publish)')
|
|
26
26
|
.parse(process.argv);
|
|
27
27
|
const options = program.opts();
|
|
28
28
|
const cliOptions = {
|
|
29
|
-
dryRun: options.
|
|
29
|
+
dryRun: options.dryRun,
|
|
30
30
|
run: options.run,
|
|
31
31
|
prereleaseChannel: options.preRelease,
|
|
32
32
|
useVersion: options.useVersion,
|
|
33
33
|
publish: options.publish,
|
|
34
|
-
|
|
34
|
+
skipRelease: options.skipRelease,
|
|
35
35
|
};
|
|
36
36
|
const config = (0, config_1.getConfig)(cliOptions);
|
|
37
|
+
// remove falsy values from the overrides
|
|
38
|
+
if (config) {
|
|
39
|
+
Object.keys(config).forEach((key) => (
|
|
40
|
+
// @ts-ignore
|
|
41
|
+
!config[key] && delete config[key]));
|
|
42
|
+
}
|
|
37
43
|
output_1.default.debug(`CLI Options: ${JSON.stringify(cliOptions, null, 2)}`);
|
|
38
44
|
output_1.default.debug(`Config: ${JSON.stringify(config, null, 2)}`);
|
|
39
45
|
(0, _1.autorel)(config);
|
package/dist/config.js
CHANGED
|
@@ -39,7 +39,7 @@ const validateConfig = rtype_1.predicates.object({
|
|
|
39
39
|
runScript: rtype_1.predicates.optional(rtype_1.predicates.string()),
|
|
40
40
|
prereleaseChannel: rtype_1.predicates.optional(rtype_1.predicates.string()),
|
|
41
41
|
useVersion: rtype_1.predicates.optional(rtype_1.predicates.string()),
|
|
42
|
-
|
|
42
|
+
skipRelease: rtype_1.predicates.optional(rtype_1.predicates.boolean()),
|
|
43
43
|
publish: rtype_1.predicates.optional(rtype_1.predicates.boolean()),
|
|
44
44
|
breakingChangeTitle: rtype_1.predicates.optional(rtype_1.predicates.string()),
|
|
45
45
|
commitTypes: rtype_1.predicates.optional(rtype_1.predicates.array(rtype_1.predicates.object({
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -103,7 +103,7 @@ async function autorel(args) {
|
|
|
103
103
|
return;
|
|
104
104
|
git.createAndPushTag(nextTag);
|
|
105
105
|
const { owner, repository } = git.getRepo();
|
|
106
|
-
!args.
|
|
106
|
+
!args.skipRelease && github.createRelease({
|
|
107
107
|
token: process.env.GITHUB_TOKEN,
|
|
108
108
|
owner,
|
|
109
109
|
repository,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "autorel",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "Automate semantic releases based on conventional commits. Similar to semantic-release but much simpler.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Marc H. Weiner <mhweiner234@gmail.com> (https://mhweiner.com)",
|
|
@@ -28,7 +28,22 @@
|
|
|
28
28
|
"build": "rm -rf ./dist && tsc"
|
|
29
29
|
},
|
|
30
30
|
"homepage": "https://github.com/mhweiner/autorel/blob/main/README.md",
|
|
31
|
-
"keywords": [
|
|
31
|
+
"keywords": [
|
|
32
|
+
"semantic-release",
|
|
33
|
+
"semantic commits",
|
|
34
|
+
"conventional commits",
|
|
35
|
+
"semantic versioning",
|
|
36
|
+
"automatic release",
|
|
37
|
+
"automatic builds",
|
|
38
|
+
"builds",
|
|
39
|
+
"ci/cid",
|
|
40
|
+
"ci-cd",
|
|
41
|
+
"continuous integration",
|
|
42
|
+
"continuous deployment",
|
|
43
|
+
"automation",
|
|
44
|
+
"release automation",
|
|
45
|
+
"release-please"
|
|
46
|
+
],
|
|
32
47
|
"devDependencies": {
|
|
33
48
|
"@types/js-yaml": "^4.0.9",
|
|
34
49
|
"@types/node": "^17.0.0",
|