@d-zero/release-automation 0.0.3 → 0.0.5
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.
|
@@ -249,7 +249,9 @@ async function publishIncomplete(git, line, mode) {
|
|
|
249
249
|
*/
|
|
250
250
|
async function pushRelease(input) {
|
|
251
251
|
const { git } = input;
|
|
252
|
-
|
|
252
|
+
// On a local branch named like the line, not detached: `lerna version`
|
|
253
|
+
// refuses a detached HEAD, and its `allowBranch` names the line's branch.
|
|
254
|
+
git.raw('checkout', '--force', '-B', input.line.branch, `origin/${input.line.branch}`);
|
|
253
255
|
runShell('yarn install --immutable', git.cwd);
|
|
254
256
|
const generated = generateRelease({
|
|
255
257
|
git,
|
|
@@ -261,7 +263,7 @@ async function pushRelease(input) {
|
|
|
261
263
|
now: input.now,
|
|
262
264
|
});
|
|
263
265
|
if (!generated.ok) {
|
|
264
|
-
git.raw('checkout', '--force', '
|
|
266
|
+
git.raw('checkout', '--force', '-B', input.line.branch, `origin/${input.line.branch}`);
|
|
265
267
|
return generated;
|
|
266
268
|
}
|
|
267
269
|
const appSlug = requireEnv('RELEASE_APP_SLUG');
|
|
@@ -83,7 +83,9 @@ export async function verifyReleasePrCommand(options) {
|
|
|
83
83
|
throw new Error(`Never published, so no trusted publisher can be set: ${never.join(', ')}. Publish a placeholder by hand and set its trusted publisher first`);
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
|
-
|
|
86
|
+
// On a local branch named like the line, not detached: `lerna version`
|
|
87
|
+
// refuses a detached HEAD, and its `allowBranch` names the line's branch.
|
|
88
|
+
git.raw('checkout', '--force', '-B', line.branch, parent);
|
|
87
89
|
runShell('yarn install --immutable', git.cwd);
|
|
88
90
|
const generated = generateRelease({
|
|
89
91
|
git,
|
package/dist/io/repo.js
CHANGED
|
@@ -142,20 +142,26 @@ export function publishModeAt(git, rev) {
|
|
|
142
142
|
* automation acts on. The checks of a pull request read `HEAD` instead, so
|
|
143
143
|
* that the pull request that brings in or changes the definition is checked
|
|
144
144
|
* against what it proposes.
|
|
145
|
+
*
|
|
146
|
+
* The version of `dev` is always read from `origin/dev`, whatever the
|
|
147
|
+
* revision: the current major is the one `dev` carries. On a previous line
|
|
148
|
+
* the checked-out `lerna.json` states the previous major, and reading it
|
|
149
|
+
* there would make `dev` look like it carries that line.
|
|
145
150
|
* @param git - Git access
|
|
146
151
|
* @param now - The current time
|
|
147
|
-
* @param rev - The revision the files are read from
|
|
152
|
+
* @param rev - The revision the definition files are read from
|
|
148
153
|
* @returns The facts
|
|
149
154
|
* @example
|
|
150
155
|
* classify(readFacts(git, new Date()));
|
|
151
156
|
* classify(readFacts(git, new Date(), 'HEAD'));
|
|
152
157
|
*/
|
|
153
158
|
export function readFacts(git, now, rev = `origin/${CURRENT_BRANCH}`) {
|
|
154
|
-
const
|
|
159
|
+
const devRev = `origin/${CURRENT_BRANCH}`;
|
|
160
|
+
const lerna = git.show(devRev, 'lerna.json');
|
|
155
161
|
const root = JSON.parse(git.show(rev, 'package.json') ?? '{}');
|
|
156
162
|
const codeowners = git.show(rev, '.github/CODEOWNERS');
|
|
157
163
|
return {
|
|
158
|
-
devVersion: versionAt(git,
|
|
164
|
+
devVersion: versionAt(git, devRev),
|
|
159
165
|
lernaVersion: lerna === null
|
|
160
166
|
? null
|
|
161
167
|
: (JSON.parse(lerna).version ?? null),
|