autorel 2.5.1 → 2.5.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.
Files changed (2) hide show
  1. package/README.md +21 -239
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -41,14 +41,14 @@ Use Autorel to save time, prevent broken releases, and ship with confidence.
41
41
  ## Table of Contents
42
42
 
43
43
  - [Example Usage (CLI)](#example-usage-cli)
44
- - [Example Usage (Library)](#example-usage-library)
44
+ - [Example Usage (Library)](docs/usage-library.md)
45
45
  - [System Requirements](#system-requirements)
46
46
  - [Commit Messages](#commit-messages)
47
47
  - [Usage with GitHub Actions](#usage-with-github-actions)
48
48
  - [Usage with Other Repositories (not GitHub)](#usage-with-other-repositories-not-github)
49
49
  - [Usage with Other Languages (not Node.js)](#usage-with-other-languages-not-nodejs)
50
- - [Configuration](#configuration)
51
- - [Sample YAML Configuration](#sample-yaml-configuration)
50
+ - [Configuration](docs/configuration.md)
51
+ - [Sample YAML Configuration](docs/configuration.md#sample-yaml-configuration)
52
52
  - [Types](#types)
53
53
  - [Debug Mode](#debug-mode)
54
54
  - [About package.json versions](#about-packagejson-versions)
@@ -125,263 +125,45 @@ You can find more examples in the [Conventional Commits](https://www.conventiona
125
125
 
126
126
  ## Usage with GitHub Actions
127
127
 
128
- You can use `autorel` with GitHub Actions to automate your releases (recommended).
129
-
130
- > ❗️ You must set `fetch-depth: 0` and `fetch-tags: true` in `actions/checkout@v4` (or later) or autorel will not work correctly.
131
-
132
- > ❗️ You must be authenticated with NPM to publish. To do so via GitHub Actions, see [this](https://docs.github.com/en/actions/guides/publishing-nodejs-packages#publishing-packages-to-the-npm-registry).
133
-
134
- Here is a sample configuration:
135
-
136
- ```yaml
137
- name: Release
138
- on:
139
- push:
140
- branches: [main, alpha, beta]
141
- jobs:
142
- release:
143
- name: Release
144
- runs-on: ubuntu-latest
145
- steps:
146
- - uses: actions/checkout@v4
147
- with:
148
- fetch-depth: 0
149
- fetch-tags: true
150
- - uses: actions/setup-node@v4
151
- with:
152
- node-version: latest
153
- registry-url: "https://registry.npmjs.org"
154
- cache: 'npm'
155
- - run: npx autorel@^2
156
- env:
157
- GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
158
- NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
159
- ```
160
-
161
- It's also recommended you create a `.autorel.yaml` file in the root of your project to [configure](#configuration) `autorel`.
162
-
163
- ## Usage with Other Repositories (not GitHub)
164
-
165
- `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.
166
-
167
- Simply use the `--skip-release` flag (arg: `skipRelease: true`) 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 version bump with the new version number available as an environment variable [see below](#run).
168
-
169
- If you're interested in contributing built-in support for other systems, please open an issue or PR.
170
-
171
- ## Usage with Other Languages (not Node.js)
172
-
173
- `autorel` is designed to work with any language or platform. You can use it with Python, Ruby, Go, Java, or any other language.
174
-
175
- Simply omit the `--publish` flag (arg: `publish: false`, which is default) to skip publishing to NPM. Then, you can use either the `--run` flag (arg: `run: string`) or `runScript: string` arg to run any command or script after the version bump with the new version number available as an environment variable [see below](#run).
176
-
177
- If you're interested in contributing built-in support for other systems, please open an issue or PR.
128
+ Autorel 💜 GitHub Actions. See [Using `autorel` with GitHub Actions](/docs/github-actions.md)
178
129
 
179
130
  ## Configuration
180
131
 
181
- When run in CLI mode, `autorel` can be configured via CLI arguments or a `yaml` file. CLI arguments take precedence over the `yaml` file. All parameters are optional.
182
-
183
- However, omitting optional binary flags, such as the `--publish`, `--dry-run`, `--skip-release`, and `--verbose` flags will still publish to NPM if set in the `yaml` file.
184
-
185
- When used as a library, you pass the configuration directly to the `autorel` function. When used this way, it will not automatically load any default configuration—you can use the `defaultConfig` object to get the default configuration:
186
-
187
- ```typescript
188
- import {autorel, defaultConfig} from 'autorel';
189
-
190
- const autorelConfig = {
191
- ...defaultConfig,
192
- publish: true,
193
- };
194
- ```
195
-
196
- > ❗️ The `yaml` configuration file must be named `.autorel.yaml` and be in the root of your project.
197
-
198
- [See sample YAML configuration](#sample-yaml-configuration)
199
-
200
- ### publish
132
+ See [Configuration](docs/configuration.md) for reference and examples.
201
133
 
202
- Whether to publish the release to NPM. If `true`, you must be authenticated with NPM. To do so via GitHub Actions, see [this](https://docs.github.com/en/actions/guides/publishing-nodejs-packages#publishing-packages-to-the-npm-registry).
203
-
204
- - CLI: `--publish`
205
- - Argument: `publish: boolean`
206
- - Default: `false`
207
-
208
- ### dryRun
209
-
210
- Whether to run in dry-run mode. This will not push the tag, create the release, publish to NPM, or run the command.
211
-
212
- - CLI: `--dry-run`
213
- - Argument: `dryRun: boolean`
214
- - Default: `false`
215
-
216
- ### verbose
217
-
218
- Whether to run in verbose mode. This will output more information about the release process.
219
-
220
- - CLI: `--verbose`
221
- - Argument: `verbose: boolean`
222
- - Default: `false`
223
-
224
- ### skipRelease
225
-
226
- 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.
227
-
228
- - CLI: `--skip-release`
229
- - Argument: `skipRelease: boolean`
230
- - Default: `false`
231
-
232
- ### run
233
-
234
- A `bash` command/script to run after the release is complete. All scripts are run in "-e" mode, meaning they will exit on the first error.
134
+ ## Types
235
135
 
236
- The following environment variables are available:
136
+ You can find the types defined at [src/index.ts](src/index.ts).
237
137
 
238
- | Variable | Description |
239
- | --- | --- |
240
- | `NEXT_VERSION` | The new version number (without the `v`) |
241
- | `NEXT_TAG` | The new tag, ie. v3.1.0 |
138
+ ## Verbose Mode (Debug Mode)
242
139
 
243
- Example CLI usage:
140
+ To enable verbose mode, set `--verbose (verbose: true)` or environment variable `AUTOREL_DEBUG=1`:
244
141
 
245
142
  ```bash
246
- npx autorel --run 'echo "Next version is ${NEXT_VERSION}"'
247
- ```
248
-
249
- Example YAML usage:
250
-
251
- ```yaml
252
- run: echo "Next version is ${NEXT_VERSION}"
253
- ```
254
-
255
- You can use the multi-line string syntax in YAML to write a script:
256
-
257
- ```yaml
258
- run: |
259
- echo "$(date +"%Y-%m-%d") ${NEXT_VERSION}" >> versions.txt
260
- aws s3 sync . s3://my-bucket
143
+ npx autorel --verbose
261
144
  ```
262
145
 
263
- - CLI: `--run`
264
- - Argument: `run: string`
265
- - Default: `undefined`
266
-
267
- ### preRun
268
-
269
- A `bash` command/script to run before the release is started. All scripts are run in "-e" mode, meaning they will exit on the first error. Here's where you can do things like run tests or do build steps.
270
-
271
- This could save you time and money by not running unnecessary steps in your CI/CD pipeline. It will not run if no release is determined to be necessary, and it will not run in dry-run mode.
272
-
273
- This is run *after* determining the new version number but *before* pushing tags, creating the release on GitHub, updating the package.json, or publishing to NPM.
274
-
275
- Example YAML usage:
276
-
277
- ```yaml
278
- preRun: |
279
- npm ci
280
- npm run build
281
- npm run test
282
- npm run lint
283
- ```
284
-
285
- - CLI: `--pre-run`
286
- - Argument: `preRun: string`
287
- - Default: `undefined`
288
-
289
- ### preRelease
290
-
291
- > ❗️ This is typically set via the `branches` configuration (recommended), but can be overridden here.
292
-
293
- 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.
294
-
295
- - CLI: `--pre-release`
296
- - Argument: `preRelease: string`
297
- - Default: `undefined`
298
-
299
- ### breakingChangeTitle (YAML/library only)
300
-
301
- The title to use for the breaking changes section in the release notes.
302
-
303
- - Argument: `breakingChangeTitle: string`
304
- - Default: `"🚨 Breaking Changes 🚨"`
305
-
306
- ### commitTypes (YAML/library only)
307
-
308
- The commit types to use for both the release notes and version bumping.
309
-
310
- - Argument: `commitTypes: CommitType[]`
311
- - Defaults: [src/defaults.ts](src/defaults.ts)
312
-
313
- ### branches (YAML/library only)
314
-
315
- The branches to use for the release along with their pre-release channel. If not provided, the default is:
316
-
317
- ```yaml
318
- - {name: 'main'}
319
- ```
320
-
321
- 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:
322
-
323
- ```yaml
324
- branches:
325
- - {name: 'main'}
326
- - {name: 'develop', prereleaseChannel: 'alpha'}
327
- - {name: 'staging', prereleaseChannel: 'beta'}
328
- ```
329
-
330
- 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.
331
-
332
- - Argument: `branches: ReleaseBranch[]`
333
-
334
- ### useVersion
335
-
336
- The version to use for the release INSTEAD of the version being generated. Always results in a release being created unless `noRelease` is `true`. **Advanced usage only, not recommended for most users.**
337
-
338
- - CLI: `--use-version`
339
- - Argument: `useVersion: string`
340
- - Default: `undefined`
341
-
342
- > ❗️ Must be a valid SemVer version, without the `v`.
343
-
344
- ### githubToken
345
-
346
- The GitHub token to use for creating the release. If not provided, it will use the `GITHUB_TOKEN` environment variable. This is only used if `skipRelease` is `false`.
347
-
348
- ## Sample YAML Configuration
349
-
350
- <sub>_.autorel.yaml_</sub>
351
- ```yaml
352
- # Define the branches and their respective channels
353
- branches:
354
- - {name: 'main'}
355
- - {name: 'next', prereleaseChannel: 'next'}
356
-
357
- # Enable publishing to NPM
358
- publish: true
146
+ ## About package.json versions
359
147
 
360
- # Run custom script after publish
361
- run: |
362
- echo "$(date +"%Y-%m-%d") ${NEXT_VERSION}" >> versions.txt
363
- aws s3 sync . s3://my-bucket
364
- ```
148
+ If using our npm publishing feature, the package.json file's version will be updated in memory before being pushed to npm, as this is the only place where it's actually required. The change will not be pushed to the repository, as it is not necessary and could cause conflicts. See [this post](https://semantic-release.gitbook.io/semantic-release/support/faq)
365
149
 
366
- ## Types
150
+ If you need access to the new version number in your CI/CD pipeline, you can use the `NEXT_VERSION` or `NEXT_TAG` environment variables.
367
151
 
368
- You can find the types defined at [src/index.ts](src/index.ts).
152
+ ## Usage with Other Repositories (not GitHub)
369
153
 
370
- ## Debug Mode
154
+ `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.
371
155
 
372
- To enable debug mode, set `AUTOREL_DEBUG=1`:
156
+ Simply use the `--skip-release` flag (arg: `skipRelease: true`) 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 version bump with the new version number available as an environment variable [see below](#run).
373
157
 
374
- ```bash
375
- AUTOREL_DEBUG=1 npx autorel
376
- ```
158
+ If you're interested in contributing built-in support for other systems, please open an issue or PR.
377
159
 
378
- This will output configuration and other debug information.
160
+ ## Usage with Other Languages (not Node.js)
379
161
 
380
- ## About package.json versions
162
+ `autorel` is designed to work with any language or platform. You can use it with Python, Ruby, Go, Java, or any other language.
381
163
 
382
- If using our npm publishing feature, the package.json file's version will be updated in memory before being pushed to npm, as this is the only place where it's actually required. The change will not be pushed to the repository, as it is not necessary and could cause conflicts. See [this post](https://semantic-release.gitbook.io/semantic-release/support/faq)
164
+ Simply omit the `--publish` flag (arg: `publish: false`, which is default) to skip publishing to NPM. Then, you can use either the `--run` flag (arg: `run: string`) or `runScript: string` arg to run any command or script after the version bump with the new version number available as an environment variable [see below](#run).
383
165
 
384
- If you need access to the new version number in your CI/CD pipeline, you can use the `NEXT_VERSION` or `NEXT_TAG` environment variables.
166
+ If you're interested in contributing built-in support for other systems, please open an issue or PR.
385
167
 
386
168
  ## Contributing
387
169
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "autorel",
3
- "version": "2.5.1",
3
+ "version": "2.5.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)",