Allows for manual nightly builds.

This commit is contained in:
Henning Dieterichs 2023-06-05 17:40:14 +02:00
parent c84c0cb8f9
commit 74470a5fb2
No known key found for this signature in database
GPG key ID: 771381EFFDB9EC06
5 changed files with 31 additions and 5 deletions

6
scripts/ci/env.ts Normal file
View file

@ -0,0 +1,6 @@
export function getEnv(): {
VSCODE_REF: string | undefined;
PRERELEASE_VERSION: string | undefined;
} {
return process.env as any;
}

View file

@ -1,6 +1,7 @@
import { mkdir, rm } from 'fs/promises';
import { join, resolve } from 'path';
import { PackageJson, group, gitShallowClone, run, writeJsonFile, getNightlyVersion } from '../lib';
import { getEnv } from './env';
const selfPath = __dirname;
const rootPath = join(selfPath, '..', '..');
@ -21,8 +22,8 @@ async function prepareMonacoEditorCoreReleaseStableOrNightly() {
version = monacoEditorPackageJson.version;
ref = monacoEditorPackageJson.vscodeRef;
} else if (arg === 'nightly') {
version = getNightlyVersion(monacoEditorPackageJson.version);
ref = 'main';
version = getNightlyVersion(monacoEditorPackageJson.version, getEnv().PRERELEASE_VERSION);
ref = getEnv().VSCODE_REF || 'main';
} else {
throw new Error('Invalid argument');
}

View file

@ -1,6 +1,7 @@
import { readFile } from 'fs/promises';
import { join, resolve } from 'path';
import { PackageJson, getNightlyVersion, group, run, writeJsonFile, gitCommitId } from '../lib';
import { getEnv } from './env';
const selfPath = __dirname;
const rootPath = join(selfPath, '..', '..');
@ -23,7 +24,7 @@ async function prepareMonacoEditorReleaseStableOrNightly() {
if (arg === 'stable') {
version = monacoEditorPackageJson.version;
} else if (arg === 'nightly') {
version = getNightlyVersion(monacoEditorPackageJson.version);
version = getNightlyVersion(monacoEditorPackageJson.version, getEnv().PRERELEASE_VERSION);
} else {
throw new Error('Invalid argument');
}