Skip to content

Commit

Permalink
chore(core): release canary version for e2e tests to avoid version ov…
Browse files Browse the repository at this point in the history
…erlap (nrwl#11539)
  • Loading branch information
meeroslav committed Aug 12, 2022
1 parent d13d5eb commit 001fed8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion scripts/e2e-build-package-publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ async function buildPackagePublishAndCleanPorts() {
}

async function updateVersionsAndPublishPackages() {
execSync(`yarn nx-release --local`, {
execSync(`yarn nx-release --local --canary`, {
stdio: 'inherit',
});
}
Expand Down
13 changes: 10 additions & 3 deletions scripts/nx-release.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,12 @@ function hideFromGitIndex(uncommittedFiles: string[]) {
}

const lernaJsonPath = join(__dirname, '../lerna.json');
let originalLernaJson: Buffer;
let originalLernaJson: Buffer | undefined;

if (options.local || options.tag === 'next') {
originalLernaJson = readFileSync(lernaJsonPath);
}

if (options.local) {
/**
* Hide changes from Lerna
Expand All @@ -82,9 +83,10 @@ function hideFromGitIndex(uncommittedFiles: string[]) {
process.on('SIGTERM', unhideFromGitIndex);
}

const publishOptions = {
const publishOptions: Record<string, boolean | string | undefined> = {
gitReset: false,
distTag: options.tag,
canary: options.canary,
};

if (!options.skipPublish) {
Expand All @@ -94,7 +96,7 @@ function hideFromGitIndex(uncommittedFiles: string[]) {
console.warn('Not Publishing because --dryRun was passed');
}

if (options.local || options.tag === 'next') {
if (originalLernaJson) {
writeFileSync(lernaJsonPath, originalLernaJson);
}
})();
Expand Down Expand Up @@ -125,6 +127,11 @@ function parseArgs() {
alias: 'l',
default: true,
})
.option('canary', {
type: 'boolean',
description: 'Create canary version',
hidden: true,
})
.option('force', {
type: 'boolean',
description: "Don't use this unless you really know what it does",
Expand Down

0 comments on commit 001fed8

Please sign in to comment.