@catladder/cli 0.0.0-next-883523ef → 0.0.0-next-5b3ef3ac
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/dist/apps/cli/src/catci.js +12 -0
- package/dist/apps/cli/src/catci.js.map +1 -1
- package/dist/apps/cli/src/release/changesetCheck.d.ts +35 -0
- package/dist/apps/cli/src/release/changesetCheck.js +31 -0
- package/dist/apps/cli/src/release/changesetCheck.js.map +1 -0
- package/dist/apps/cli/src/release/changesetCheckJob.d.ts +2 -0
- package/dist/apps/cli/src/release/changesetCheckJob.js +169 -0
- package/dist/apps/cli/src/release/changesetCheckJob.js.map +1 -0
- package/dist/apps/cli/src/release/changesetsReleaseJob.d.ts +2 -0
- package/dist/apps/cli/src/release/changesetsReleaseJob.js +43 -52
- package/dist/apps/cli/src/release/changesetsReleaseJob.js.map +1 -1
- package/dist/apps/cli/src/release/releaseGit.d.ts +9 -0
- package/dist/apps/cli/src/release/releaseGit.js +49 -0
- package/dist/apps/cli/src/release/releaseGit.js.map +1 -0
- package/dist/bundles/catci/index.js +4 -4
- package/dist/bundles/catenv/index.js +109 -4
- package/dist/bundles/cli/index.js +109 -4
- package/dist/bundles/runner-images/changesets/scripts/changesetCheck +23 -0
- package/dist/bundles/skills/catladder-releases/SKILL.md +31 -2
- package/dist/packages/pipeline/src/backends/github/GithubBackend.js +3 -0
- package/dist/packages/pipeline/src/backends/github/GithubBackend.js.map +1 -1
- package/dist/packages/pipeline/src/backends/github/githubReleaseJobs.d.ts +7 -0
- package/dist/packages/pipeline/src/backends/github/githubReleaseJobs.js +75 -4
- package/dist/packages/pipeline/src/backends/github/githubReleaseJobs.js.map +1 -1
- package/dist/packages/pipeline/src/backends/gitlab/gitlabReleaseJobs.d.ts +26 -4
- package/dist/packages/pipeline/src/backends/gitlab/gitlabReleaseJobs.js +29 -0
- package/dist/packages/pipeline/src/backends/gitlab/gitlabReleaseJobs.js.map +1 -1
- package/dist/packages/pipeline/src/release/index.d.ts +12 -0
- package/dist/packages/pipeline/src/release/index.js +2 -0
- package/dist/packages/pipeline/src/release/index.js.map +1 -1
- package/dist/packages/pipeline/src/types/github-types.d.ts +1 -0
- package/dist/runner-images/changesets/scripts/changesetCheck +23 -0
- package/dist/skills/catladder-releases/SKILL.md +31 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/catci.ts +14 -0
- package/src/release/__tests__/changesetCheck.test.ts +69 -0
- package/src/release/changesetCheck.ts +82 -0
- package/src/release/changesetCheckJob.ts +199 -0
- package/src/release/changesetsReleaseJob.ts +36 -48
- package/src/release/releaseGit.ts +47 -0
|
@@ -2452,6 +2452,9 @@ class GithubBackend {
|
|
|
2452
2452
|
}
|
|
2453
2453
|
}
|
|
2454
2454
|
manualDispatchOptions.push(...leafIds);
|
|
2455
|
+
if (trigger === "mr") {
|
|
2456
|
+
Object.assign(jobs, (0, githubReleaseJobs_1.getGithubReleaseCheckJobs)(config, images));
|
|
2457
|
+
}
|
|
2455
2458
|
if (trigger === "mainBranch") {
|
|
2456
2459
|
const releaseJobs = (0, githubReleaseJobs_1.getGithubReleaseJobs)(config, Object.keys(jobs), images);
|
|
2457
2460
|
Object.assign(jobs, releaseJobs.main);
|
|
@@ -3004,10 +3007,10 @@ exports.getUploadProviderIds = getUploadProviderIds;
|
|
|
3004
3007
|
"use strict";
|
|
3005
3008
|
|
|
3006
3009
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
3007
|
-
exports.getGithubReleaseJobs = void 0;
|
|
3010
|
+
exports.getGithubReleaseCheckJobs = exports.getGithubReleaseJobs = void 0;
|
|
3008
3011
|
const createGithubJobs_1 = __nccwpck_require__(57877);
|
|
3009
3012
|
const release_1 = __nccwpck_require__(38904);
|
|
3010
|
-
const createReleaseJob = (config, images, needs) => {
|
|
3013
|
+
const createReleaseJob = (config, images, needs, extraEnv) => {
|
|
3011
3014
|
const method = (0, release_1.getReleaseMethod)(config);
|
|
3012
3015
|
const resolved = images.resolveRef({ catladderImage: method.image });
|
|
3013
3016
|
const imageNeeds = resolved.need && typeof resolved.need === "object"
|
|
@@ -3042,6 +3045,7 @@ const createReleaseJob = (config, images, needs) => {
|
|
|
3042
3045
|
...(allNeeds.length > 0 ? { needs: allNeeds } : {}),
|
|
3043
3046
|
env: {
|
|
3044
3047
|
GITHUB_TOKEN: "${{ github.token }}",
|
|
3048
|
+
...extraEnv,
|
|
3045
3049
|
},
|
|
3046
3050
|
steps: [
|
|
3047
3051
|
{
|
|
@@ -3070,20 +3074,90 @@ const createReleaseJob = (config, images, needs) => {
|
|
|
3070
3074
|
*/
|
|
3071
3075
|
const getGithubReleaseJobs = (config, mainWorkflowJobIds, images) => {
|
|
3072
3076
|
var _a;
|
|
3077
|
+
const method = (0, release_1.getReleaseMethod)(config);
|
|
3073
3078
|
if (((_a = config.releases) === null || _a === void 0 ? void 0 : _a.when) === "auto") {
|
|
3074
3079
|
return {
|
|
3075
3080
|
main: {
|
|
3076
3081
|
"create-release": createReleaseJob(config, images, mainWorkflowJobIds),
|
|
3077
3082
|
},
|
|
3078
|
-
manual: {
|
|
3083
|
+
manual: {
|
|
3084
|
+
"force-create-release": createReleaseJob(config, images, undefined, method.forceReleaseVariables),
|
|
3085
|
+
},
|
|
3079
3086
|
};
|
|
3080
3087
|
}
|
|
3081
3088
|
return {
|
|
3082
3089
|
main: {},
|
|
3083
|
-
manual: {
|
|
3090
|
+
manual: {
|
|
3091
|
+
"create-release": createReleaseJob(config, images),
|
|
3092
|
+
// an explicit force option wherever the method distinguishes it
|
|
3093
|
+
// (e.g. changesets: release a patch bump without changesets)
|
|
3094
|
+
...(method.forceReleaseVariables
|
|
3095
|
+
? {
|
|
3096
|
+
"force-create-release": createReleaseJob(config, images, undefined, method.forceReleaseVariables),
|
|
3097
|
+
}
|
|
3098
|
+
: {}),
|
|
3099
|
+
},
|
|
3084
3100
|
};
|
|
3085
3101
|
};
|
|
3086
3102
|
exports.getGithubReleaseJobs = getGithubReleaseJobs;
|
|
3103
|
+
/**
|
|
3104
|
+
* the informational MR/PR check job of the release method (e.g. the
|
|
3105
|
+
* changeset check), added to the mr workflow. continue-on-error keeps
|
|
3106
|
+
* a missing changeset from blocking the PR — the sticky PR comment is
|
|
3107
|
+
* the visible surface on github.
|
|
3108
|
+
*/
|
|
3109
|
+
const getGithubReleaseCheckJobs = (config, images) => {
|
|
3110
|
+
const method = (0, release_1.getReleaseMethod)(config);
|
|
3111
|
+
if (!method.checkScript) {
|
|
3112
|
+
return {};
|
|
3113
|
+
}
|
|
3114
|
+
const resolved = images.resolveRef({ catladderImage: method.image });
|
|
3115
|
+
const imageNeeds = resolved.need && typeof resolved.need === "object"
|
|
3116
|
+
? [(0, createGithubJobs_1.githubGlobalJobId)(resolved.need.job)]
|
|
3117
|
+
: [];
|
|
3118
|
+
return {
|
|
3119
|
+
"changeset-check": {
|
|
3120
|
+
name: "changeset check",
|
|
3121
|
+
"runs-on": "ubuntu-latest",
|
|
3122
|
+
container: {
|
|
3123
|
+
image: resolved.image,
|
|
3124
|
+
...(resolved.fromRepoRegistry
|
|
3125
|
+
? {
|
|
3126
|
+
credentials: {
|
|
3127
|
+
username: "${{ github.actor }}",
|
|
3128
|
+
password: "${{ github.token }}",
|
|
3129
|
+
},
|
|
3130
|
+
}
|
|
3131
|
+
: {}),
|
|
3132
|
+
},
|
|
3133
|
+
permissions: {
|
|
3134
|
+
contents: "read",
|
|
3135
|
+
"pull-requests": "write",
|
|
3136
|
+
...(resolved.fromRepoRegistry ? { packages: "read" } : {}),
|
|
3137
|
+
},
|
|
3138
|
+
...(imageNeeds.length > 0 ? { needs: imageNeeds } : {}),
|
|
3139
|
+
"continue-on-error": true,
|
|
3140
|
+
env: {
|
|
3141
|
+
GITHUB_TOKEN: "${{ github.token }}",
|
|
3142
|
+
},
|
|
3143
|
+
steps: [
|
|
3144
|
+
{
|
|
3145
|
+
name: "Checkout",
|
|
3146
|
+
uses: "actions/checkout@v4",
|
|
3147
|
+
// full history: the check derives the next version from the
|
|
3148
|
+
// last v* tag
|
|
3149
|
+
with: { "fetch-depth": 0 },
|
|
3150
|
+
},
|
|
3151
|
+
{
|
|
3152
|
+
name: "changeset check",
|
|
3153
|
+
run: method.checkScript,
|
|
3154
|
+
shell: "bash",
|
|
3155
|
+
},
|
|
3156
|
+
],
|
|
3157
|
+
},
|
|
3158
|
+
};
|
|
3159
|
+
};
|
|
3160
|
+
exports.getGithubReleaseCheckJobs = getGithubReleaseCheckJobs;
|
|
3087
3161
|
//# sourceMappingURL=githubReleaseJobs.js.map
|
|
3088
3162
|
|
|
3089
3163
|
/***/ }),
|
|
@@ -3953,6 +4027,11 @@ const getGitlabReleaseJobs = (config, images) => {
|
|
|
3953
4027
|
script: [method.script],
|
|
3954
4028
|
after_script: [EXPIRED_TOKEN_HELP],
|
|
3955
4029
|
needs: [],
|
|
4030
|
+
// force semantics of the method's script (e.g. changesets:
|
|
4031
|
+
// release a patch bump even without pending changesets)
|
|
4032
|
+
...(method.forceReleaseVariables
|
|
4033
|
+
? { variables: method.forceReleaseVariables }
|
|
4034
|
+
: {}),
|
|
3956
4035
|
rules: [
|
|
3957
4036
|
...baseReleaseRules,
|
|
3958
4037
|
{
|
|
@@ -3965,6 +4044,30 @@ const getGitlabReleaseJobs = (config, images) => {
|
|
|
3965
4044
|
},
|
|
3966
4045
|
],
|
|
3967
4046
|
},
|
|
4047
|
+
// informational MR check of the release method (e.g. the changeset
|
|
4048
|
+
// check): warns via allow_failure, the report lands in the MR
|
|
4049
|
+
// widget as an exposed artifact
|
|
4050
|
+
...(method.checkScript
|
|
4051
|
+
? {
|
|
4052
|
+
["🦋 changeset check"]: {
|
|
4053
|
+
stage: "test",
|
|
4054
|
+
image: releaseImage,
|
|
4055
|
+
script: [method.checkScript],
|
|
4056
|
+
allow_failure: true,
|
|
4057
|
+
artifacts: {
|
|
4058
|
+
paths: ["changeset-report.md"],
|
|
4059
|
+
expose_as: "changeset report",
|
|
4060
|
+
// the report must survive the warning exit
|
|
4061
|
+
when: "always",
|
|
4062
|
+
},
|
|
4063
|
+
rules: [
|
|
4064
|
+
rules_1.RULE_NEVER_ON_AGENT_TRIGGER,
|
|
4065
|
+
rules_1.RULE_NEVER_ON_SCHEDULE,
|
|
4066
|
+
rules_1.RULE_IS_MERGE_REQUEST,
|
|
4067
|
+
],
|
|
4068
|
+
},
|
|
4069
|
+
}
|
|
4070
|
+
: {}),
|
|
3968
4071
|
};
|
|
3969
4072
|
};
|
|
3970
4073
|
exports.getGitlabReleaseJobs = getGitlabReleaseJobs;
|
|
@@ -10699,6 +10802,8 @@ exports.RELEASE_METHODS = {
|
|
|
10699
10802
|
changesets: {
|
|
10700
10803
|
image: "changesets",
|
|
10701
10804
|
script: "changesetsRelease",
|
|
10805
|
+
checkScript: "changesetCheck",
|
|
10806
|
+
forceReleaseVariables: { CATLADDER_FORCE_RELEASE: "true" },
|
|
10702
10807
|
},
|
|
10703
10808
|
};
|
|
10704
10809
|
const getReleaseMethod = (config) => { var _a, _b; return exports.RELEASE_METHODS[(_b = (_a = config.releases) === null || _a === void 0 ? void 0 : _a.method) !== null && _b !== void 0 ? _b : "semantic-release"]; };
|
|
@@ -8445,6 +8445,9 @@ class GithubBackend {
|
|
|
8445
8445
|
}
|
|
8446
8446
|
}
|
|
8447
8447
|
manualDispatchOptions.push(...leafIds);
|
|
8448
|
+
if (trigger === "mr") {
|
|
8449
|
+
Object.assign(jobs, (0, githubReleaseJobs_1.getGithubReleaseCheckJobs)(config, images));
|
|
8450
|
+
}
|
|
8448
8451
|
if (trigger === "mainBranch") {
|
|
8449
8452
|
const releaseJobs = (0, githubReleaseJobs_1.getGithubReleaseJobs)(config, Object.keys(jobs), images);
|
|
8450
8453
|
Object.assign(jobs, releaseJobs.main);
|
|
@@ -8997,10 +9000,10 @@ exports.getUploadProviderIds = getUploadProviderIds;
|
|
|
8997
9000
|
"use strict";
|
|
8998
9001
|
|
|
8999
9002
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
9000
|
-
exports.getGithubReleaseJobs = void 0;
|
|
9003
|
+
exports.getGithubReleaseCheckJobs = exports.getGithubReleaseJobs = void 0;
|
|
9001
9004
|
const createGithubJobs_1 = __nccwpck_require__(57877);
|
|
9002
9005
|
const release_1 = __nccwpck_require__(38904);
|
|
9003
|
-
const createReleaseJob = (config, images, needs) => {
|
|
9006
|
+
const createReleaseJob = (config, images, needs, extraEnv) => {
|
|
9004
9007
|
const method = (0, release_1.getReleaseMethod)(config);
|
|
9005
9008
|
const resolved = images.resolveRef({ catladderImage: method.image });
|
|
9006
9009
|
const imageNeeds = resolved.need && typeof resolved.need === "object"
|
|
@@ -9035,6 +9038,7 @@ const createReleaseJob = (config, images, needs) => {
|
|
|
9035
9038
|
...(allNeeds.length > 0 ? { needs: allNeeds } : {}),
|
|
9036
9039
|
env: {
|
|
9037
9040
|
GITHUB_TOKEN: "${{ github.token }}",
|
|
9041
|
+
...extraEnv,
|
|
9038
9042
|
},
|
|
9039
9043
|
steps: [
|
|
9040
9044
|
{
|
|
@@ -9063,20 +9067,90 @@ const createReleaseJob = (config, images, needs) => {
|
|
|
9063
9067
|
*/
|
|
9064
9068
|
const getGithubReleaseJobs = (config, mainWorkflowJobIds, images) => {
|
|
9065
9069
|
var _a;
|
|
9070
|
+
const method = (0, release_1.getReleaseMethod)(config);
|
|
9066
9071
|
if (((_a = config.releases) === null || _a === void 0 ? void 0 : _a.when) === "auto") {
|
|
9067
9072
|
return {
|
|
9068
9073
|
main: {
|
|
9069
9074
|
"create-release": createReleaseJob(config, images, mainWorkflowJobIds),
|
|
9070
9075
|
},
|
|
9071
|
-
manual: {
|
|
9076
|
+
manual: {
|
|
9077
|
+
"force-create-release": createReleaseJob(config, images, undefined, method.forceReleaseVariables),
|
|
9078
|
+
},
|
|
9072
9079
|
};
|
|
9073
9080
|
}
|
|
9074
9081
|
return {
|
|
9075
9082
|
main: {},
|
|
9076
|
-
manual: {
|
|
9083
|
+
manual: {
|
|
9084
|
+
"create-release": createReleaseJob(config, images),
|
|
9085
|
+
// an explicit force option wherever the method distinguishes it
|
|
9086
|
+
// (e.g. changesets: release a patch bump without changesets)
|
|
9087
|
+
...(method.forceReleaseVariables
|
|
9088
|
+
? {
|
|
9089
|
+
"force-create-release": createReleaseJob(config, images, undefined, method.forceReleaseVariables),
|
|
9090
|
+
}
|
|
9091
|
+
: {}),
|
|
9092
|
+
},
|
|
9077
9093
|
};
|
|
9078
9094
|
};
|
|
9079
9095
|
exports.getGithubReleaseJobs = getGithubReleaseJobs;
|
|
9096
|
+
/**
|
|
9097
|
+
* the informational MR/PR check job of the release method (e.g. the
|
|
9098
|
+
* changeset check), added to the mr workflow. continue-on-error keeps
|
|
9099
|
+
* a missing changeset from blocking the PR — the sticky PR comment is
|
|
9100
|
+
* the visible surface on github.
|
|
9101
|
+
*/
|
|
9102
|
+
const getGithubReleaseCheckJobs = (config, images) => {
|
|
9103
|
+
const method = (0, release_1.getReleaseMethod)(config);
|
|
9104
|
+
if (!method.checkScript) {
|
|
9105
|
+
return {};
|
|
9106
|
+
}
|
|
9107
|
+
const resolved = images.resolveRef({ catladderImage: method.image });
|
|
9108
|
+
const imageNeeds = resolved.need && typeof resolved.need === "object"
|
|
9109
|
+
? [(0, createGithubJobs_1.githubGlobalJobId)(resolved.need.job)]
|
|
9110
|
+
: [];
|
|
9111
|
+
return {
|
|
9112
|
+
"changeset-check": {
|
|
9113
|
+
name: "changeset check",
|
|
9114
|
+
"runs-on": "ubuntu-latest",
|
|
9115
|
+
container: {
|
|
9116
|
+
image: resolved.image,
|
|
9117
|
+
...(resolved.fromRepoRegistry
|
|
9118
|
+
? {
|
|
9119
|
+
credentials: {
|
|
9120
|
+
username: "${{ github.actor }}",
|
|
9121
|
+
password: "${{ github.token }}",
|
|
9122
|
+
},
|
|
9123
|
+
}
|
|
9124
|
+
: {}),
|
|
9125
|
+
},
|
|
9126
|
+
permissions: {
|
|
9127
|
+
contents: "read",
|
|
9128
|
+
"pull-requests": "write",
|
|
9129
|
+
...(resolved.fromRepoRegistry ? { packages: "read" } : {}),
|
|
9130
|
+
},
|
|
9131
|
+
...(imageNeeds.length > 0 ? { needs: imageNeeds } : {}),
|
|
9132
|
+
"continue-on-error": true,
|
|
9133
|
+
env: {
|
|
9134
|
+
GITHUB_TOKEN: "${{ github.token }}",
|
|
9135
|
+
},
|
|
9136
|
+
steps: [
|
|
9137
|
+
{
|
|
9138
|
+
name: "Checkout",
|
|
9139
|
+
uses: "actions/checkout@v4",
|
|
9140
|
+
// full history: the check derives the next version from the
|
|
9141
|
+
// last v* tag
|
|
9142
|
+
with: { "fetch-depth": 0 },
|
|
9143
|
+
},
|
|
9144
|
+
{
|
|
9145
|
+
name: "changeset check",
|
|
9146
|
+
run: method.checkScript,
|
|
9147
|
+
shell: "bash",
|
|
9148
|
+
},
|
|
9149
|
+
],
|
|
9150
|
+
},
|
|
9151
|
+
};
|
|
9152
|
+
};
|
|
9153
|
+
exports.getGithubReleaseCheckJobs = getGithubReleaseCheckJobs;
|
|
9080
9154
|
//# sourceMappingURL=githubReleaseJobs.js.map
|
|
9081
9155
|
|
|
9082
9156
|
/***/ }),
|
|
@@ -9946,6 +10020,11 @@ const getGitlabReleaseJobs = (config, images) => {
|
|
|
9946
10020
|
script: [method.script],
|
|
9947
10021
|
after_script: [EXPIRED_TOKEN_HELP],
|
|
9948
10022
|
needs: [],
|
|
10023
|
+
// force semantics of the method's script (e.g. changesets:
|
|
10024
|
+
// release a patch bump even without pending changesets)
|
|
10025
|
+
...(method.forceReleaseVariables
|
|
10026
|
+
? { variables: method.forceReleaseVariables }
|
|
10027
|
+
: {}),
|
|
9949
10028
|
rules: [
|
|
9950
10029
|
...baseReleaseRules,
|
|
9951
10030
|
{
|
|
@@ -9958,6 +10037,30 @@ const getGitlabReleaseJobs = (config, images) => {
|
|
|
9958
10037
|
},
|
|
9959
10038
|
],
|
|
9960
10039
|
},
|
|
10040
|
+
// informational MR check of the release method (e.g. the changeset
|
|
10041
|
+
// check): warns via allow_failure, the report lands in the MR
|
|
10042
|
+
// widget as an exposed artifact
|
|
10043
|
+
...(method.checkScript
|
|
10044
|
+
? {
|
|
10045
|
+
["🦋 changeset check"]: {
|
|
10046
|
+
stage: "test",
|
|
10047
|
+
image: releaseImage,
|
|
10048
|
+
script: [method.checkScript],
|
|
10049
|
+
allow_failure: true,
|
|
10050
|
+
artifacts: {
|
|
10051
|
+
paths: ["changeset-report.md"],
|
|
10052
|
+
expose_as: "changeset report",
|
|
10053
|
+
// the report must survive the warning exit
|
|
10054
|
+
when: "always",
|
|
10055
|
+
},
|
|
10056
|
+
rules: [
|
|
10057
|
+
rules_1.RULE_NEVER_ON_AGENT_TRIGGER,
|
|
10058
|
+
rules_1.RULE_NEVER_ON_SCHEDULE,
|
|
10059
|
+
rules_1.RULE_IS_MERGE_REQUEST,
|
|
10060
|
+
],
|
|
10061
|
+
},
|
|
10062
|
+
}
|
|
10063
|
+
: {}),
|
|
9961
10064
|
};
|
|
9962
10065
|
};
|
|
9963
10066
|
exports.getGitlabReleaseJobs = getGitlabReleaseJobs;
|
|
@@ -16692,6 +16795,8 @@ exports.RELEASE_METHODS = {
|
|
|
16692
16795
|
changesets: {
|
|
16693
16796
|
image: "changesets",
|
|
16694
16797
|
script: "changesetsRelease",
|
|
16798
|
+
checkScript: "changesetCheck",
|
|
16799
|
+
forceReleaseVariables: { CATLADDER_FORCE_RELEASE: "true" },
|
|
16695
16800
|
},
|
|
16696
16801
|
};
|
|
16697
16802
|
const getReleaseMethod = (config) => { var _a, _b; return exports.RELEASE_METHODS[(_b = (_a = config.releases) === null || _a === void 0 ? void 0 : _a.method) !== null && _b !== void 0 ? _b : "semantic-release"]; };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
set -e
|
|
3
|
+
|
|
4
|
+
# MR/PR pipelines only: reports which changesets this merge request
|
|
5
|
+
# adds, what is pending and what version merging would release; exits 1
|
|
6
|
+
# (the job runs with allow_failure) when no changeset is added
|
|
7
|
+
|
|
8
|
+
if [ "$GITHUB_ACTIONS" = "true" ]; then
|
|
9
|
+
# github container jobs: the workspace volume is owned by the host
|
|
10
|
+
# runner user while this step runs as the container user, and the
|
|
11
|
+
# safe.directory entry actions/checkout writes goes to a temporary
|
|
12
|
+
# HOME that is gone by now — git would refuse the repo ("dubious
|
|
13
|
+
# ownership")
|
|
14
|
+
git config --global --add safe.directory "$(pwd)"
|
|
15
|
+
fi
|
|
16
|
+
|
|
17
|
+
CATCI=".catladder-generated/catci/index.js"
|
|
18
|
+
if [ ! -f "$CATCI" ]; then
|
|
19
|
+
echo "$CATCI not found — regenerate the pipeline with a current catladder version (catenv)"
|
|
20
|
+
exit 1
|
|
21
|
+
fi
|
|
22
|
+
|
|
23
|
+
node "$CATCI" release changeset-check
|
|
@@ -28,7 +28,10 @@ are generated, never hand-edited.
|
|
|
28
28
|
pipeline (it still no-ops when there is nothing to release).
|
|
29
29
|
|
|
30
30
|
There is always also a manual **`⚠️ force create release`** job as an
|
|
31
|
-
escape hatch.
|
|
31
|
+
escape hatch. With `method: "changesets"` it has an extra meaning: it
|
|
32
|
+
releases **even when no changesets are pending** (patch bump with a
|
|
33
|
+
generic changelog entry) — the recovery path when a change was merged
|
|
34
|
+
without a changeset and must ship now.
|
|
32
35
|
|
|
33
36
|
## `method` — how the version is decided
|
|
34
37
|
|
|
@@ -56,6 +59,31 @@ Add a changeset by creating `.changeset/<name>.md`:
|
|
|
56
59
|
Add the new export endpoint.
|
|
57
60
|
```
|
|
58
61
|
|
|
62
|
+
**When you (an agent) make a user-facing change in a changesets
|
|
63
|
+
project, add a changeset file in the same MR** — bump level `major`
|
|
64
|
+
(breaking) / `minor` (feature) / `patch` (fix), and a one-to-two
|
|
65
|
+
sentence summary written for the changelog reader. Docs/chore-only
|
|
66
|
+
changes need none. The package name in the frontmatter is ignored
|
|
67
|
+
(versions come from git tags); only the bump counts.
|
|
68
|
+
|
|
69
|
+
### The changeset check (MR/PR pipelines)
|
|
70
|
+
|
|
71
|
+
Changesets projects get a **`🦋 changeset check`** job in every
|
|
72
|
+
merge-request pipeline. It reports what merging would do — the
|
|
73
|
+
changesets this MR adds, everything pending, and the version the next
|
|
74
|
+
release would get (with a changelog preview) — and **warns without
|
|
75
|
+
blocking** (`allow_failure`) when the MR adds no changeset:
|
|
76
|
+
|
|
77
|
+
- **GitLab**: report in the job log and as an exposed artifact
|
|
78
|
+
(`changeset-report.md`) in the MR widget. If the project makes
|
|
79
|
+
`GL_TOKEN` available to MR pipelines it also maintains a sticky MR
|
|
80
|
+
comment (opt-in — an api-scope token in MR pipelines is a security
|
|
81
|
+
trade-off).
|
|
82
|
+
- **GitHub**: maintains a sticky PR comment via the workflow token.
|
|
83
|
+
|
|
84
|
+
A yellow changeset-check job on an MR is a prompt to ask: is this
|
|
85
|
+
change user-facing? If yes, add a changeset; if not, ignore it.
|
|
86
|
+
|
|
59
87
|
## The security-audit gate
|
|
60
88
|
|
|
61
89
|
**Both methods gate on a dependency security audit before releasing.**
|
|
@@ -69,7 +97,8 @@ the `security` commands in the `catladder-cli` reference.
|
|
|
69
97
|
|
|
70
98
|
- Fails immediately on the audit → handle the security-audit gate above.
|
|
71
99
|
- `changesets` released nothing → no `.changeset/*.md` files were
|
|
72
|
-
pending.
|
|
100
|
+
pending. To ship anyway, run `⚠️ force create release` (patch bump),
|
|
101
|
+
or merge an MR adding a changeset describing the accumulated work.
|
|
73
102
|
- Wrong version bump → check commit types (semantic-release) or the bump
|
|
74
103
|
levels in the changeset files (changesets).
|
|
75
104
|
- Inspect the job with `yarn catladder project ci job-log` (see the
|
|
@@ -185,6 +185,9 @@ class GithubBackend {
|
|
|
185
185
|
}
|
|
186
186
|
}
|
|
187
187
|
manualDispatchOptions.push(...leafIds);
|
|
188
|
+
if (trigger === "mr") {
|
|
189
|
+
Object.assign(jobs, (0, githubReleaseJobs_1.getGithubReleaseCheckJobs)(config, images));
|
|
190
|
+
}
|
|
188
191
|
if (trigger === "mainBranch") {
|
|
189
192
|
const releaseJobs = (0, githubReleaseJobs_1.getGithubReleaseJobs)(config, Object.keys(jobs), images);
|
|
190
193
|
Object.assign(jobs, releaseJobs.main);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GithubBackend.js","sourceRoot":"","sources":["../../../../../../../../packages/pipeline/src/backends/github/GithubBackend.ts"],"names":[],"mappings":";;;AAAA,0CAAkD;AAClD,+BAA4B;AAC5B,gEAA6D;AAE7D,+CAA2D;AAI3D,+CAA6D;AAC7D,oCAA8C;AAC9C,yDAK4B;AAC5B,oEAAiE;AACjE,uDAAuE;AACvE,2DAAkE;AAClE,uCAAqC;AACrC,
|
|
1
|
+
{"version":3,"file":"GithubBackend.js","sourceRoot":"","sources":["../../../../../../../../packages/pipeline/src/backends/github/GithubBackend.ts"],"names":[],"mappings":";;;AAAA,0CAAkD;AAClD,+BAA4B;AAC5B,gEAA6D;AAE7D,+CAA2D;AAI3D,+CAA6D;AAC7D,oCAA8C;AAC9C,yDAK4B;AAC5B,oEAAiE;AACjE,uDAAuE;AACvE,2DAAkE;AAClE,uCAAqC;AACrC,2DAG6B;AAC7B,+CAAyE;AAEzE,MAAM,gBAAgB,GAAG,mBAAmB,CAAC;AAE7C;;;GAGG;AACH,MAAM,qBAAqB,GAAG,YAAY,CAAC;AAE3C,MAAM,iBAAiB,GAGnB;IACF,EAAE,EAAE;QACF,IAAI,EAAE,kBAAkB;QACxB,EAAE,EAAE,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,CAAC,QAAQ,EAAE,aAAa,EAAE,UAAU,CAAC,EAAE,EAAE;QACtE,WAAW,EAAE;YACX,KAAK,EAAE,6CAA6C;YACpD,oBAAoB,EAAE,IAAI;SAC3B;KACF;IACD,UAAU,EAAE;QACV,IAAI,EAAE,gBAAgB;QACtB,6CAA6C;QAC7C,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAC,MAAM,CAAC,EAAE,EAAE;KACrC;IACD,aAAa,EAAE;QACb,IAA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AQ,CAAA;CAAA,CAAC;AAE3C;;;;GAIG;AACH,MAAM,eAAe,GAAG,CAAC,GAAiB,EAAE,EAAE,CAC5C,GAAG,CAAC,KAAK,KAAK,MAAM,IAAI,GAAG,CAAC,KAAK,KAAK,UAAU,CAAC"}
|
|
@@ -14,3 +14,10 @@ export declare const getGithubReleaseJobs: (config: Config, mainWorkflowJobIds:
|
|
|
14
14
|
main: Record<string, GithubJob>;
|
|
15
15
|
manual: Record<string, GithubJob>;
|
|
16
16
|
};
|
|
17
|
+
/**
|
|
18
|
+
* the informational MR/PR check job of the release method (e.g. the
|
|
19
|
+
* changeset check), added to the mr workflow. continue-on-error keeps
|
|
20
|
+
* a missing changeset from blocking the PR — the sticky PR comment is
|
|
21
|
+
* the visible surface on github.
|
|
22
|
+
*/
|
|
23
|
+
export declare const getGithubReleaseCheckJobs: (config: Config, images: JobImagesPlan) => Record<string, GithubJob>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getGithubReleaseJobs = void 0;
|
|
3
|
+
exports.getGithubReleaseCheckJobs = exports.getGithubReleaseJobs = void 0;
|
|
4
4
|
const createGithubJobs_1 = require("./createGithubJobs");
|
|
5
5
|
const release_1 = require("../../release");
|
|
6
|
-
const createReleaseJob = (config, images, needs) => {
|
|
6
|
+
const createReleaseJob = (config, images, needs, extraEnv) => {
|
|
7
7
|
const method = (0, release_1.getReleaseMethod)(config);
|
|
8
8
|
const resolved = images.resolveRef({ catladderImage: method.image });
|
|
9
9
|
const imageNeeds = resolved.need && typeof resolved.need === "object"
|
|
@@ -38,6 +38,7 @@ const createReleaseJob = (config, images, needs) => {
|
|
|
38
38
|
...(allNeeds.length > 0 ? { needs: allNeeds } : {}),
|
|
39
39
|
env: {
|
|
40
40
|
GITHUB_TOKEN: "${{ github.token }}",
|
|
41
|
+
...extraEnv,
|
|
41
42
|
},
|
|
42
43
|
steps: [
|
|
43
44
|
{
|
|
@@ -66,18 +67,88 @@ const createReleaseJob = (config, images, needs) => {
|
|
|
66
67
|
*/
|
|
67
68
|
const getGithubReleaseJobs = (config, mainWorkflowJobIds, images) => {
|
|
68
69
|
var _a;
|
|
70
|
+
const method = (0, release_1.getReleaseMethod)(config);
|
|
69
71
|
if (((_a = config.releases) === null || _a === void 0 ? void 0 : _a.when) === "auto") {
|
|
70
72
|
return {
|
|
71
73
|
main: {
|
|
72
74
|
"create-release": createReleaseJob(config, images, mainWorkflowJobIds),
|
|
73
75
|
},
|
|
74
|
-
manual: {
|
|
76
|
+
manual: {
|
|
77
|
+
"force-create-release": createReleaseJob(config, images, undefined, method.forceReleaseVariables),
|
|
78
|
+
},
|
|
75
79
|
};
|
|
76
80
|
}
|
|
77
81
|
return {
|
|
78
82
|
main: {},
|
|
79
|
-
manual: {
|
|
83
|
+
manual: {
|
|
84
|
+
"create-release": createReleaseJob(config, images),
|
|
85
|
+
// an explicit force option wherever the method distinguishes it
|
|
86
|
+
// (e.g. changesets: release a patch bump without changesets)
|
|
87
|
+
...(method.forceReleaseVariables
|
|
88
|
+
? {
|
|
89
|
+
"force-create-release": createReleaseJob(config, images, undefined, method.forceReleaseVariables),
|
|
90
|
+
}
|
|
91
|
+
: {}),
|
|
92
|
+
},
|
|
80
93
|
};
|
|
81
94
|
};
|
|
82
95
|
exports.getGithubReleaseJobs = getGithubReleaseJobs;
|
|
96
|
+
/**
|
|
97
|
+
* the informational MR/PR check job of the release method (e.g. the
|
|
98
|
+
* changeset check), added to the mr workflow. continue-on-error keeps
|
|
99
|
+
* a missing changeset from blocking the PR — the sticky PR comment is
|
|
100
|
+
* the visible surface on github.
|
|
101
|
+
*/
|
|
102
|
+
const getGithubReleaseCheckJobs = (config, images) => {
|
|
103
|
+
const method = (0, release_1.getReleaseMethod)(config);
|
|
104
|
+
if (!method.checkScript) {
|
|
105
|
+
return {};
|
|
106
|
+
}
|
|
107
|
+
const resolved = images.resolveRef({ catladderImage: method.image });
|
|
108
|
+
const imageNeeds = resolved.need && typeof resolved.need === "object"
|
|
109
|
+
? [(0, createGithubJobs_1.githubGlobalJobId)(resolved.need.job)]
|
|
110
|
+
: [];
|
|
111
|
+
return {
|
|
112
|
+
"changeset-check": {
|
|
113
|
+
name: "changeset check",
|
|
114
|
+
"runs-on": "ubuntu-latest",
|
|
115
|
+
container: {
|
|
116
|
+
image: resolved.image,
|
|
117
|
+
...(resolved.fromRepoRegistry
|
|
118
|
+
? {
|
|
119
|
+
credentials: {
|
|
120
|
+
username: "${{ github.actor }}",
|
|
121
|
+
password: "${{ github.token }}",
|
|
122
|
+
},
|
|
123
|
+
}
|
|
124
|
+
: {}),
|
|
125
|
+
},
|
|
126
|
+
permissions: {
|
|
127
|
+
contents: "read",
|
|
128
|
+
"pull-requests": "write",
|
|
129
|
+
...(resolved.fromRepoRegistry ? { packages: "read" } : {}),
|
|
130
|
+
},
|
|
131
|
+
...(imageNeeds.length > 0 ? { needs: imageNeeds } : {}),
|
|
132
|
+
"continue-on-error": true,
|
|
133
|
+
env: {
|
|
134
|
+
GITHUB_TOKEN: "${{ github.token }}",
|
|
135
|
+
},
|
|
136
|
+
steps: [
|
|
137
|
+
{
|
|
138
|
+
name: "Checkout",
|
|
139
|
+
uses: "actions/checkout@v4",
|
|
140
|
+
// full history: the check derives the next version from the
|
|
141
|
+
// last v* tag
|
|
142
|
+
with: { "fetch-depth": 0 },
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
name: "changeset check",
|
|
146
|
+
run: method.checkScript,
|
|
147
|
+
shell: "bash",
|
|
148
|
+
},
|
|
149
|
+
],
|
|
150
|
+
},
|
|
151
|
+
};
|
|
152
|
+
};
|
|
153
|
+
exports.getGithubReleaseCheckJobs = getGithubReleaseCheckJobs;
|
|
83
154
|
//# sourceMappingURL=githubReleaseJobs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"githubReleaseJobs.js","sourceRoot":"","sources":["../../../../../../../../packages/pipeline/src/backends/github/githubReleaseJobs.ts"],"names":[],"mappings":";;;AACA,yDAAuD;AACvD,2CAAiD;AAIjD,MAAM,gBAAgB,GAAG,CACvB,MAAc,EACd,MAAqB,EACrB,KAAgB,
|
|
1
|
+
{"version":3,"file":"githubReleaseJobs.js","sourceRoot":"","sources":["../../../../../../../../packages/pipeline/src/backends/github/githubReleaseJobs.ts"],"names":[],"mappings":";;;AACA,yDAAuD;AACvD,2CAAiD;AAIjD,MAAM,gBAAgB,GAAG,CACvB,MAAc,EACd,MAAqB,EACrB,KAAgB,EAChB,QAAiC,EACtB,EAAE;IACb,MAAM,MAAM,GAAG,IAAA,0BAAgB,EAAC,MAAM,CAAC,CAAC;IACxC,MAAM,QAAQ,GAAG,MAAM,CAAC,UAAU,CAAC,EAAE,cAAc,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;IACrE,MAAM,UAAU,GACd,QAAQ,CAAC,IAAI,IAAI,OAAO,QAAQ,CAAC,IAAI,KAAK,QAAQ;QAChD,CAAC,CAAC,CAAC,IAAA,oCAAiB,EAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACxC,CAAC,CAAC,EAAE,CAAC;IACT,MAAM,QAAQ,GAAG,CAAC,GAAG,UAAU,EAAE,GAAG,CAAC,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,EAAE,CAAC,CAAC,CAAC;IACnD,OAAO;QACL,IAAI,EAAE,gBAAgB;QACtB,SAAS,EAAE,eAAe;QAC1B,SAAS,EAAE;YACT,KAAK,EAAE,QAAQ,CAAC,KAAK;YACrB,GAAG,CAAC,QAAQ,CAAC,gBAAgB;gBAC3B,CAAC,CAAC;oBACE,WAAW,EAAE;wBACX,QAAQ,EAAE,qBAAqB;wBAC/B,QAAQ,EAAE,qBAAqB;qBAChC;iBACF;gBACH,CAAC,CAAC,EAAE,CAAC;SACR;QACD,gEAAgE;QAChE,kEAAkE;QAClE,6DAA6D;QAC7D,+DAA+D;QAC/D,mEAAm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