Skip to content

Commit

Permalink
0.12.0
Browse files Browse the repository at this point in the history
  • Loading branch information
nalchevanidze committed Jun 12, 2024
1 parent 37227a9 commit 1bd2aa4
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 33 deletions.
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
},
"dependencies": {
"commander": "^9.1.0",
"gh-rel-easy": "^0.8.0",
"gh-rel-easy": "^0.12.0",
"ts-node": "^10.7.0",
"typescript": "^4.6.2"
}
Expand Down
33 changes: 8 additions & 25 deletions scripts/release.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
import { writeFile } from "fs/promises";
import { GHRelEasy, runCli } from "gh-rel-easy";
import { Command } from "commander";

export const exit = (error: Error) => {
console.log(error.message);
process.exit(1);
};

// HConf
const hconf = runCli("hconf");

// GHRelEasy
const release = new GHRelEasy({
const gh = new GHRelEasy({
gh: "morpheusgraphql/morpheus-graphql",
scope: {
server: "morpheus-graphql",
Expand All @@ -23,7 +17,8 @@ const release = new GHRelEasy({
},
pkg: (p) => `https://hackage.haskell.org/package/${p}`,
version: () => hconf("version"),
next: (b) => hconf("next", ...(b ? ["-b"] : [])).then(console.log),
next: (b) => hconf("next", b && "-b").then(console.log),
setup: () => hconf("setup").then(console.log),
});

// CLI
Expand All @@ -33,23 +28,11 @@ cli.name("release-cli").description("Automated Releases").version("1.0");

cli
.command("open")
.option("-p, --preview", "preview", false)
.action(({ preview }: { preview: boolean }) =>
release
.changelog()
.then((body) =>
hconf("setup")
.then(console.log)
.then(() => (preview ? undefined : release.open(body)))
)
.catch(exit)
);
.option("-d, --dry", "only changelog and setup", false)
.action(({ dry }: { dry: boolean }) => gh.release(dry));

cli.command("changelog").action(() =>
release
.changelog()
.then((body: string) => writeFile("./changelog.md", body, "utf8"))
.catch(exit)
);
cli.command("changelog").action(async () => {
await gh.changelog("changelog");
});

cli.parse();

0 comments on commit 1bd2aa4

Please sign in to comment.