autorel 1.1.1 → 1.1.3

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 CHANGED
@@ -17,12 +17,15 @@ Autorel automatically does the following, if appropriate:
17
17
  - Publishes the package to NPM
18
18
  - Runs any arbitrary command or bash script
19
19
 
20
+ _Currently only comes with built-in support for `GitHub` and `NPM`, but you can write your own scripts to support other systems._
21
+
20
22
  **✅ Conventional Commit and SemVer Compliant**
21
23
  - 100% compliant with Conventional Commits and SemVer out of the box, including "!" for breaking changes
22
24
 
23
25
  **😃 Simple & Easy to Use**
24
26
  - No confusing configuration files or complex setup
25
27
  - Works with any CI/CD system, including GitHub Actions
28
+ - Works with any language or platform
26
29
  - Built-in bash script support
27
30
 
28
31
  **🚀 Fast & Lightweight**
@@ -34,9 +37,9 @@ Autorel automatically does the following, if appropriate:
34
37
 
35
38
  - [Example Usage (CLI)](#example-usage-cli)
36
39
  - [Example Usage (Library)](#example-usage-library)
37
- - [Quick Start](#quick-start)
38
40
  - [Usage with GitHub Actions](#usage-with-github-actions)
39
41
  - [Example Commit Messages](#example-commit-messages)
42
+ - [Usage with Anything Other Than GitHub](#usage-with-anything-other-than-github)
40
43
  - [Configuration](#configuration)
41
44
  - [Sample YAML Configuration](#sample-yaml-configuration)
42
45
  - [Types](#types)
@@ -52,9 +55,9 @@ npx autorel --publish --run 'echo "Next version is ${NEXT_VERSION}"'
52
55
 
53
56
  This will:
54
57
 
55
- 1. Bump the version based on the commit messages since the last release (including pushing the tag and updating package.json)
58
+ 1. Bump the version based on the commit messages since the last release
56
59
  2. Create a new release on GitHub with Release Notes
57
- 3. Publish the release to NPM
60
+ 3. Update package.json and publish the release to NPM (does not commit the change to the repository, see below)
58
61
  4. Run the command `echo "Next version is ${NEXT_VERSION}"`
59
62
 
60
63
  You can also install `autorel` globally and run it directly:
@@ -83,27 +86,6 @@ autorel --publish
83
86
 
84
87
  console.log(`Next version is ${nextVersion}`);
85
88
  ```
86
- # Quick Start
87
-
88
- There are many ways to use `autorel`. Here are a few common scenarios:
89
-
90
- 1. **CLI**: Run `autorel` directly from the command line
91
- 2. **Library**: Import `autorel` into your project and use it as a library
92
- 3. **CI/CD pipeline**: Use `autorel` with GitHub Actions, CircleCI, Jenkins, etc. to automate your releases
93
-
94
- You can also use `autorel` with other languages, not just Node.js. Just make sure you have Node.js installed on the system.
95
-
96
- If you want to use GitHub Actions to automate your releases, [see here](#usage-with-github-actions) for setup and sample configuration.
97
-
98
- It's also recommended you create a `.autorel.yaml` file in the root of your project to [configure](#configuration) `autorel`. Example:
99
-
100
- ```yaml
101
- branches:
102
- - {name: 'main'}
103
- - {name: 'alpha', channel: 'alpha'}
104
- - {name: 'beta', channel: 'beta'}
105
- publish: true
106
- ```
107
89
 
108
90
  # Usage with GitHub Actions
109
91
 
@@ -150,7 +132,9 @@ jobs:
150
132
 
151
133
  It's also recommended you create a `.autorel.yaml` file in the root of your project to [configure](#configuration) `autorel`.
152
134
 
153
- # Example Commit Messages
135
+ # Commit Messages
136
+
137
+ Commit messages are parsed to determine the version bump. They must follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification for automatic version bumping according to semantic versioning.
154
138
 
155
139
  Here are some examples of commit messages and the resulting version bump (default configuration):
156
140
 
@@ -160,6 +144,12 @@ Here are some examples of commit messages and the resulting version bump (defaul
160
144
 
161
145
  You can find more examples in the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) documentation.
162
146
 
147
+ # Usage with Anything Other Than GitHub
148
+
149
+ `autorel` is designed to work with any CI/CD system, not just GitHub Actions. You can use it with GitLab, Bitbucket, Jenkins, or any other system that supports running shell commands.
150
+
151
+ Simply use the `--no-release` flag (arg: `noRelease: boolean`) to skip creating a release on GitHub. Then, you can use the `--run` flag (arg: `run: string`) to run any command or script after the release is complete.
152
+
163
153
  # Configuration
164
154
 
165
155
  When run in CLI mode, `autorel` can be configured via CLI arguments or a `yaml` file. CLI arguments take precedence over the `yaml` file.
package/dist/index.js CHANGED
@@ -36,7 +36,7 @@ const color = __importStar(require("./lib/colors"));
36
36
  const changelog_1 = require("./changelog");
37
37
  const github = __importStar(require("./services/github"));
38
38
  const output_1 = __importDefault(require("./lib/output"));
39
- const versionBump_1 = require("./versionBump");
39
+ const updatePackageJsonVersion_1 = require("./updatePackageJsonVersion");
40
40
  const sh_1 = require("./lib/sh");
41
41
  function getPrereleaseChannel(config) {
42
42
  if (config.prereleaseChannel)
@@ -111,10 +111,11 @@ async function autorel(args) {
111
111
  name: nextTag,
112
112
  body: changelog,
113
113
  });
114
- // update package.json
115
- (0, versionBump_1.versionBump)(nextTag);
116
- // publish package
117
- args.publish && npm.publishPackage(prereleaseChannel);
114
+ // publish to npm
115
+ if (args.publish) {
116
+ (0, updatePackageJsonVersion_1.updatePackageJsonVersion)(nextTag);
117
+ npm.publishPackage(prereleaseChannel);
118
+ }
118
119
  process.env.NEXT_VERSION = nextTag.replace('v', '');
119
120
  process.env.NEXT_TAG = nextTag;
120
121
  // run post-release script
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Bump the version of the package.json file
3
+ */
4
+ export declare function updatePackageJsonVersion(newVersion: string): void;
@@ -26,7 +26,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
26
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.versionBump = void 0;
29
+ exports.updatePackageJsonVersion = void 0;
30
30
  const output_1 = __importDefault(require("./lib/output"));
31
31
  const fs_1 = require("fs");
32
32
  const fs = __importStar(require("fs"));
@@ -45,7 +45,7 @@ function readPackageJson() {
45
45
  /**
46
46
  * Bump the version of the package.json file
47
47
  */
48
- function versionBump(newVersion) {
48
+ function updatePackageJsonVersion(newVersion) {
49
49
  const packageJson = readPackageJson();
50
50
  (0, fs_1.writeFileSync)('./package.json', JSON.stringify({
51
51
  ...packageJson,
@@ -53,5 +53,5 @@ function versionBump(newVersion) {
53
53
  }, null, 2));
54
54
  output_1.default.log('Successfully updated package.json locally');
55
55
  }
56
- exports.versionBump = versionBump;
57
- //# sourceMappingURL=versionBump.js.map
56
+ exports.updatePackageJsonVersion = updatePackageJsonVersion;
57
+ //# sourceMappingURL=updatePackageJsonVersion.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "autorel",
3
- "version": "1.1.1",
3
+ "version": "1.1.3",
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)",
@@ -1,4 +0,0 @@
1
- /**
2
- * Bump the version of the package.json file
3
- */
4
- export declare function versionBump(newVersion: string): void;