Skip to content

Commit

Permalink
scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
nalchevanidze committed Jun 12, 2024
1 parent 1bd2aa4 commit db44183
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 22 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.12.0",
"gh-rel-easy": "^0.15.0",
"ts-node": "^10.7.0",
"typescript": "^4.6.2"
}
Expand Down
26 changes: 12 additions & 14 deletions scripts/release.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import { GHRelEasy, runCli } from "gh-rel-easy";
import { GHRelEasy, CLI } from "gh-rel-easy";
import { Command } from "commander";

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

// GHRelEasy
const gh = new GHRelEasy({
gh: "morpheusgraphql/morpheus-graphql",
scope: {
Expand All @@ -16,23 +14,23 @@ const gh = new GHRelEasy({
app: "morpheus-graphql-app",
},
pkg: (p) => `https://hackage.haskell.org/package/${p}`,
version: () => hconf("version"),
next: (b) => hconf("next", b && "-b").then(console.log),
setup: () => hconf("setup").then(console.log),
version: () => hconf.exec("version"),
next: (b) => hconf.void("next", b && "-b"),
setup: () => hconf.void("setup"),
});

// CLI
const cli = new Command();

cli.name("release-cli").description("Automated Releases").version("1.0");
const cli = new Command()
.name("release-cli")
.description("Automated Releases")
.version("1.0");

cli
.command("open")
.option("-d, --dry", "only changelog and setup", false)
.action(({ dry }: { dry: boolean }) => gh.release(dry));

cli.command("changelog").action(async () => {
await gh.changelog("changelog");
});
cli
.command("changelog")
.action(() => gh.changelog("changelog").then(() => undefined));

cli.parse();

0 comments on commit db44183

Please sign in to comment.