Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
chore(deps): update actions/checkout action to v4 (googleapis#2060)

docs: check `autorelease: pending` or `autorelease: triggered` in an old PR (googleapis#1930)

* docs: check `autorelease: pending` or `autorelease: triggered` in an old PR

In googleapis/java-logging-logback#1050, I had to remove the "autorelease: pending " label to create a release pull request.

* Update README.md

fix mismerge

---------

Co-authored-by: Jeff Ching <chingor@google.com>

test: also test on node 18 (googleapis#2063)

* test: also test on node 18

* ci: enable no-experimental-fetch for tests

* ci: set NODE_OPTIONS for node 18

* set NODE_OPTIONS for windows build

* set NODE_OPTIONS for windows build

ci: only require node 18 tests (googleapis#2065)

feat!: require node 18+ (googleapis#2069)

fix(deps): bump semver dependency version (googleapis#2068)

feat: Support pnpm workspaces (googleapis#2058)

fix(deps): replace lerna dependency with lerna-lite

Co-authored-by: Jeff Ching <chingor@google.com>

fix(deps): upgrade http-proxy-agent to v7 (googleapis#2071)

fix(deps): upgrade https-proxy-agent to v7

feat: fallback to root package version if package ignores github release (googleapis#1935)

Co-authored-by: Jeff Ching <chingor@google.com>

chore(deps): update dependency sinon to v16 (googleapis#2079)

feat: Use default updaters based on file extension (googleapis#2072)

* feat: Use default updaters based on file extension

* use CompositeUpdater

* improve things

---------

Co-authored-by: Jeff Ching <chingor@google.com>

chore(main): release 16.0.0 (googleapis#2070)

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>

config

docs
  • Loading branch information
kalosisz committed Sep 19, 2023
1 parent af22aea commit 3e11950
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 9 deletions.
2 changes: 2 additions & 0 deletions docs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ Extra options:
| `--versioning-strategy` | [`VersioningStrategyType`](/docs/customizing.md#versioning-strategies) | Override method of determining SemVer version bumps based on commits. Defaults to `default` |
| `--bump-minor-pre-major` | `boolean` | Configuration option for the versioning strategy. If set, will bump the minor version for breaking changes for versions < 1.0.0 |
| `--bump-patch-for-minor-pre-major` | `boolean` | Configuration option for the versioning strategy. If set, will bump the patch version for features for versions < 1.0.0 |
| `--prerelease-type` | `string` | Configuration option for the prerelese versioning strategy. If prerelease strategy used and type set, will set the prerelese part of the version to the provided value in case prerelease part is not present. |
| `--draft` | `boolean` | If set, create releases as drafts |
| `--prerelease` | `boolean` | If set, create releases that are pre-major or pre-release version marked as pre-release on Github|
| `--draft-pull-request` | `boolean` | If set, create pull requests as drafts |
Expand Down Expand Up @@ -101,6 +102,7 @@ need to specify your release options:
| `--versioning-strategy` | VersioningStrategy | Override method of determining SemVer version bumps based on commits. Defaults to `default` |
| `--bump-minor-pre-major` | boolean | Configuration option for the versioning strategy. If set, will bump the minor version for breaking changes for versions < 1.0.0 |
| `--bump-patch-for-minor-pre-major` | boolean | Configuration option for the versioning strategy. If set, will bump the patch version for features for versions < 1.0.0 |
| `--prerelease-type` | `string` | Configuration option for the prerelese versioning strategy. If prerelease strategy used and type set, will set the prerelese part of the version to the provided value in case prerelease part is not present. |
| `--draft-pull-request` | boolean | If set, create pull requests as drafts |
| `--label` | string | Comma-separated list of labels to apply to the release pull requests. Defaults to `autorelease: pending` |`autorelease: tagged` |
| `--changelog-path` | `string` | Override the path to the managed CHANGELOG. Defaults to `CHANGELOG.md` |
Expand Down
2 changes: 2 additions & 0 deletions docs/customizing.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ version given a list of parsed commits.
| `always-bump-major` | Always bump major version |
| `service-pack` | Designed for Java backport fixes. Uses Maven's specification for service pack versions (e.g. 1.2.3-sp.1) |

| `prerelease` | Bumping prerelease number (eg. 1.2.0-beta01 to 1.2.0-beta02) or if prerelease type is set, using that in the prerelease part (eg. 1.2.1 to 1.3.0-beta) |

### Adding additional versioning strategy types

To add a new versioning strategy, create a new class that implements the
Expand Down
3 changes: 3 additions & 0 deletions docs/manifest-releaser.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,9 @@ defaults (those are documented in comments)
// absence defaults to false
"bump-patch-for-minor-pre-major": true,

// setting the type of prerelease in case of prerelease strategy
"prerelease-type": true,

// set default conventional commit => changelog sections mapping/appearance.
// absence defaults to https://git.io/JqCZL
"changelog-sections": [...],
Expand Down
10 changes: 9 additions & 1 deletion schemas/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
"description": "Feature changes only bump semver patch if version < 1.0.0",
"type": "boolean"
},
"prerelease-type": {
"description": "Configuration option for the prerelese versioning strategy. If prerelease strategy used and type set, will set the prerelese part of the version to the provided value in case prerelease part is not present.",
"type": "boolean"
},
"versioning": {
"description": "Versioning strategy. Defaults to `default`",
"type": "string"
Expand Down Expand Up @@ -290,7 +294,11 @@
"type": {
"description": "The name of the plugin.",
"type": "string",
"enum": ["cargo-workspace", "maven-workspace", "node-workspace"]
"enum": [
"cargo-workspace",
"maven-workspace",
"node-workspace"
]
},
"updateAllPackages": {
"description": "Whether to force updating all packages regardless of the dependency tree. Defaults to `false`.",
Expand Down
1 change: 0 additions & 1 deletion src/strategies/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,6 @@ export abstract class BaseStrategy implements Strategy {
}

isPublishedVersion(_version: Version): boolean {
// todo: skip pre-releases
return true;
}

Expand Down
17 changes: 16 additions & 1 deletion src/versioning-strategies/prerelease.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ interface PrereleaseVersioningStrategyOptions
prereleaseType?: string;
}

/**
* Regex to match the last set of numbers in a string
* Example: 1.2.3-beta01-01 -> 01
*/
const PRERELEASE_NUMBER = /(?<number>\d+)(?=\D*$)/;

abstract class AbstractPrereleaseVersionUpdate implements VersionUpdater {
Expand All @@ -39,10 +43,21 @@ abstract class AbstractPrereleaseVersionUpdate implements VersionUpdater {
this.prereleaseType = prereleaseType;
}

/**
* Returns the new bumped prerelease version
*
* That is, if the current version is 1.2.3-beta01, the next prerelease version
* will be 1.2.3-beta02. If no number is found, the prerelease version will be
* 1.2.3-beta. If multiple numbers are found, the last set of numbers will be
* incremented, e.g. 1.2.3-beta01-01 -> 1.2.3-beta01-02.
*
* @param {prerelease} string The current version
* @returns {Version} The bumped version
*/
protected bumpPrerelease(prerelease: string): string {
const match = prerelease.match(PRERELEASE_NUMBER);

let nextPrerelease = `${prerelease}.0`;
let nextPrerelease = `${prerelease}.1`;

if (match?.groups) {
const numberLength = match.groups.number.length;
Expand Down
16 changes: 10 additions & 6 deletions test/versioning-strategies/prerelease.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,9 @@ describe('PrereleaseVersioningStrategy', () => {
const expectedBumps: Record<string, string> = {
'1.2.3': '2.0.0-beta',
'0.1.2': '1.0.0-beta',
'1.0.0-beta': '1.0.0-beta.0',
'2.0.0-beta': '2.0.0-beta.0',
'1.0.0-alpha': '1.0.0-alpha.1',
'1.0.0-beta': '1.0.0-beta.1',
'2.0.0-beta': '2.0.0-beta.1',
'1.0.1-beta': '2.0.0-beta',
'1.1.0-beta': '2.0.0-beta',
'1.1.1-beta': '2.0.0-beta',
Expand Down Expand Up @@ -195,10 +196,12 @@ describe('PrereleaseVersioningStrategy', () => {
const expectedBumps: Record<string, string> = {
'1.2.3': '1.3.0-beta',
'0.1.2': '0.2.0-beta',
'1.0.0-beta': '1.0.0-beta.0',
'2.0.0-beta': '2.0.0-beta.0',
'1.0.0-alpha': '1.0.0-alpha.1',
'1.0.0-beta': '1.0.0-beta.1',
'2.0.0-beta': '2.0.0-beta.1',
'1.0.1-beta': '1.1.0-beta',
'1.1.0-beta': '1.1.0-beta.0',
'1.1.0-alpha': '1.1.0-alpha.1',
'1.1.0-beta': '1.1.0-beta.1',
'1.1.1-beta': '1.2.0-beta',
'1.0.0-beta01': '1.0.0-beta02',
'2.0.0-beta01': '2.0.0-beta02',
Expand Down Expand Up @@ -284,7 +287,8 @@ describe('PrereleaseVersioningStrategy', () => {
describe('with prerelease type', () => {
const expectedBumps: Record<string, string> = {
'1.2.3': '1.2.4-beta',
'1.2.4-beta': '1.2.4-beta.0',
'1.2.4-alpha': '1.2.4-alpha.1',
'1.2.4-beta': '1.2.4-beta.1',
'1.0.0-beta01': '1.0.0-beta02',
'2.0.0-beta01': '2.0.0-beta02',
'1.0.1-beta01': '1.0.1-beta02',
Expand Down

0 comments on commit 3e11950

Please sign in to comment.