Skip to content

Commit

Permalink
Version 1.0.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
skymen committed Jan 17, 2025
1 parent 7259315 commit 49832f3
Showing 1 changed file with 27 additions and 18 deletions.
45 changes: 27 additions & 18 deletions build/publish.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import fs from "fs";
import { execSync } from "child_process";
import { execSync, exec } from "child_process";
import version from "../version.js";
import * as chalkUtils from "./chalkUtils.js";
import fromConsole from "./fromConsole.js";
Expand Down Expand Up @@ -42,24 +42,33 @@ export default function publish(type) {

// commit changes
process.env.FORCE_COLOR = "1";
execSync(`npm run build`);
chalkUtils.newLine();
chalkUtils.divider();
chalkUtils.step("Pushing addon to git");
execSync(`git add -A`);
try {
// if there are no changes, don't commit
execSync(`git commit -m "Version ${newVersion}"`);
} catch (e) {
chalkUtils.info("No changes to commit");
return;
}
execSync(`git push`);
let build = exec(`npm run build`);
build.stdout.pipe(process.stdout);
build.stderr.pipe(process.stderr);
build.on("exit", (code) => {
if (code !== 0) {
chalkUtils.failed("Build failed");
return;
}

chalkUtils.newLine();
chalkUtils.divider();
chalkUtils.step("Pushing addon to git");
execSync(`git add -A`);
try {
// if there are no changes, don't commit
execSync(`git commit -m "Version ${newVersion}"`);
} catch (e) {
chalkUtils.info("No changes to commit");
return;
}
execSync(`git push`);

chalkUtils.newLine();
chalkUtils.divider();
chalkUtils.success(`Version ${newVersion} published`);
chalkUtils.newLine();
chalkUtils.newLine();
chalkUtils.divider();
chalkUtils.success(`Version ${newVersion} published`);
chalkUtils.newLine();
});
}

if (fromConsole(import.meta.url)) {
Expand Down

0 comments on commit 49832f3

Please sign in to comment.