autorel 1.1.2 → 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**
@@ -36,6 +39,7 @@ Autorel automatically does the following, if appropriate:
36
39
  - [Example Usage (Library)](#example-usage-library)
37
40
  - [Usage with GitHub Actions](#usage-with-github-actions)
38
41
  - [Example Commit Messages](#example-commit-messages)
42
+ - [Usage with Anything Other Than GitHub](#usage-with-anything-other-than-github)
39
43
  - [Configuration](#configuration)
40
44
  - [Sample YAML Configuration](#sample-yaml-configuration)
41
45
  - [Types](#types)
@@ -51,9 +55,9 @@ npx autorel --publish --run 'echo "Next version is ${NEXT_VERSION}"'
51
55
 
52
56
  This will:
53
57
 
54
- 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
55
59
  2. Create a new release on GitHub with Release Notes
56
- 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)
57
61
  4. Run the command `echo "Next version is ${NEXT_VERSION}"`
58
62
 
59
63
  You can also install `autorel` globally and run it directly:
@@ -82,7 +86,7 @@ autorel --publish
82
86
 
83
87
  console.log(`Next version is ${nextVersion}`);
84
88
  ```
85
-
89
+
86
90
  # Usage with GitHub Actions
87
91
 
88
92
  You can use `autorel` with GitHub Actions to automate your releases (recommended).
@@ -128,7 +132,9 @@ jobs:
128
132
 
129
133
  It's also recommended you create a `.autorel.yaml` file in the root of your project to [configure](#configuration) `autorel`.
130
134
 
131
- # 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.
132
138
 
133
139
  Here are some examples of commit messages and the resulting version bump (default configuration):
134
140
 
@@ -138,6 +144,12 @@ Here are some examples of commit messages and the resulting version bump (defaul
138
144
 
139
145
  You can find more examples in the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) documentation.
140
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
+
141
153
  # Configuration
142
154
 
143
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.2",
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;