bkper 4.11.2 → 4.11.4
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
|
@@ -912,3 +912,13 @@ Bkper.setConfig({
|
|
|
912
912
|
oauthTokenProvider: async () => getOAuthToken(),
|
|
913
913
|
});
|
|
914
914
|
```
|
|
915
|
+
|
|
916
|
+
## Release process (maintainers)
|
|
917
|
+
|
|
918
|
+
Releases are published by GitHub Actions (Trusted Publisher with OIDC), not from local machines.
|
|
919
|
+
|
|
920
|
+
- Add one release label to a PR targeting `main`: `release:patch`, `release:minor`, or `release:major`
|
|
921
|
+
- Before merge, the PR version bump workflow updates `package.json` on the PR branch to the next version derived from the latest release tag
|
|
922
|
+
- On each `main` push, the delivery workflow checks the merged PR label, verifies `package.json` already contains the expected next version, publishes to npm, and pushes the new tag
|
|
923
|
+
- Without a release label, publish is skipped
|
|
924
|
+
- Dependabot Pi update PRs are automatically labeled `release:patch` and set to GitHub native auto-merge when repo auto-merge and required checks are enabled
|
|
@@ -912,3 +912,13 @@ Bkper.setConfig({
|
|
|
912
912
|
oauthTokenProvider: async () => getOAuthToken(),
|
|
913
913
|
});
|
|
914
914
|
```
|
|
915
|
+
|
|
916
|
+
## Release process (maintainers)
|
|
917
|
+
|
|
918
|
+
Releases are published by GitHub Actions (Trusted Publisher with OIDC), not from local machines.
|
|
919
|
+
|
|
920
|
+
- Add one release label to a PR targeting `main`: `release:patch`, `release:minor`, or `release:major`
|
|
921
|
+
- Before merge, the PR version bump workflow updates `package.json` on the PR branch to the next version derived from the latest release tag
|
|
922
|
+
- On each `main` push, the delivery workflow checks the merged PR label, verifies `package.json` already contains the expected next version, publishes to npm, and pushes the new tag
|
|
923
|
+
- Without a release label, publish is skipped
|
|
924
|
+
- Dependabot Pi update PRs are automatically labeled `release:patch` and set to GitHub native auto-merge when repo auto-merge and required checks are enabled
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export type ReleaseLevel = 'patch' | 'minor' | 'major';
|
|
2
|
+
export declare function normalizeTagVersion(versionOrTag: string): string;
|
|
3
|
+
export declare function bumpVersion(currentVersion: string, level: ReleaseLevel): string;
|
|
4
|
+
export declare function resolveNextVersion(latestTag: string | null, packageVersion: string, level: ReleaseLevel): string;
|
|
5
|
+
//# sourceMappingURL=versioning.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"versioning.d.ts","sourceRoot":"","sources":["../../src/release/versioning.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,CAAC;AAIvD,wBAAgB,mBAAmB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAQhE;AAED,wBAAgB,WAAW,CAAC,cAAc,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,GAAG,MAAM,CAqB/E;AAED,wBAAgB,kBAAkB,CAC9B,SAAS,EAAE,MAAM,GAAG,IAAI,EACxB,cAAc,EAAE,MAAM,EACtB,KAAK,EAAE,YAAY,GACpB,MAAM,CAGR"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
const SEMVER_PATTERN = /^(\d+)\.(\d+)\.(\d+)$/;
|
|
2
|
+
export function normalizeTagVersion(versionOrTag) {
|
|
3
|
+
const normalized = versionOrTag.startsWith('v') ? versionOrTag.slice(1) : versionOrTag;
|
|
4
|
+
if (!SEMVER_PATTERN.test(normalized)) {
|
|
5
|
+
throw new Error(`Invalid semver version: ${versionOrTag}`);
|
|
6
|
+
}
|
|
7
|
+
return normalized;
|
|
8
|
+
}
|
|
9
|
+
export function bumpVersion(currentVersion, level) {
|
|
10
|
+
const normalized = normalizeTagVersion(currentVersion);
|
|
11
|
+
const match = normalized.match(SEMVER_PATTERN);
|
|
12
|
+
if (!match) {
|
|
13
|
+
throw new Error(`Invalid semver version: ${currentVersion}`);
|
|
14
|
+
}
|
|
15
|
+
const [, majorText, minorText, patchText] = match;
|
|
16
|
+
const major = Number(majorText);
|
|
17
|
+
const minor = Number(minorText);
|
|
18
|
+
const patch = Number(patchText);
|
|
19
|
+
switch (level) {
|
|
20
|
+
case 'major':
|
|
21
|
+
return `${major + 1}.0.0`;
|
|
22
|
+
case 'minor':
|
|
23
|
+
return `${major}.${minor + 1}.0`;
|
|
24
|
+
case 'patch':
|
|
25
|
+
return `${major}.${minor}.${patch + 1}`;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
export function resolveNextVersion(latestTag, packageVersion, level) {
|
|
29
|
+
const currentVersion = latestTag ? normalizeTagVersion(latestTag) : normalizeTagVersion(packageVersion);
|
|
30
|
+
return bumpVersion(currentVersion, level);
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=versioning.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"versioning.js","sourceRoot":"","sources":["../../src/release/versioning.ts"],"names":[],"mappings":"AAEA,MAAM,cAAc,GAAG,uBAAuB,CAAC;AAE/C,MAAM,UAAU,mBAAmB,CAAC,YAAoB;IACpD,MAAM,UAAU,GAAG,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC;IAEvF,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC;QACnC,MAAM,IAAI,KAAK,CAAC,2BAA2B,YAAY,EAAE,CAAC,CAAC;IAC/D,CAAC;IAED,OAAO,UAAU,CAAC;AACtB,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,cAAsB,EAAE,KAAmB;IACnE,MAAM,UAAU,GAAG,mBAAmB,CAAC,cAAc,CAAC,CAAC;IACvD,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;IAE/C,IAAI,CAAC,KAAK,EAAE,CAAC;QACT,MAAM,IAAI,KAAK,CAAC,2BAA2B,cAAc,EAAE,CAA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