Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: revert build script #176

Merged
merged 2 commits into from
Nov 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions scripts/publish-via-nx.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ async function updatePackageVersion(pkgName, version, versionMap, dryRun) {
if (!found) console.error(`Could not find '${pkgName}' in any of the folders`);
}

async function createRelease(dryRun, version, isCi) {
async function createRelease(dryRun, version, makeGitCommit) {
console.log('Running nx release');
const { workspaceVersion, projectsVersionData } = await releaseVersion({
gitTag: false,
Expand Down Expand Up @@ -89,10 +89,10 @@ async function createRelease(dryRun, version, isCi) {
versionData: projectsVersionData,
version: workspaceVersion,
verbose: true,
dryRun: !isCi,
dryRun,
});

if (isCi) {
if (makeGitCommit) {
console.log('Committing changes');
const git = simpleGit().clean(CleanOptions.FORCE);

Expand All @@ -115,6 +115,7 @@ async function startReleasePipeline() {

const isCi = args['--ci'] ? true : false;
const dryRun = isCi ? false : await confirm({ message: 'Is this a dry run?', default: true, required: true });
const makeGitCommit = isCi ? false : !dryRun;

let version = 'patch';
if (!args['--version']) {
Expand All @@ -133,7 +134,7 @@ async function startReleasePipeline() {
}
} else version = args['--version'];

await createRelease(dryRun, version, isCi);
await createRelease(dryRun, version, makeGitCommit);
}

await startReleasePipeline();