-
Notifications
You must be signed in to change notification settings - Fork 7
/
releases.ts
35 lines (29 loc) · 1.05 KB
/
releases.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import { join } from "@std/path"
import $ from "@david/dax"
import { steam as SteamPath } from "./paths.ts"
export const basePath = "docs/changelog"
export const changelogPath = join(basePath, "changelog.md")
export const version = (await Deno.readTextFile(join(basePath, "version.txt"))).trim()
const changelogText = await Deno.readTextFile(changelogPath)
const title = changelogText.split("\n")[0].replace("# ", "")
const body = changelogText.split("\n").slice(1).join("\n")
export const jarPath = "build/libs/MarisaContinued.jar"
export const stsPath = join(SteamPath, "SlayTheSpire")
const github = async () => {
const artifact = `${jarPath}#MarisaContinued-${version}.jar`
const command =
$`gh release create --verify-tag --title ${title} --notes ${body} v${version} ${artifact}`
await command.printCommand()
await command.text()
}
if (import.meta.main) {
switch (Deno.args[0]) {
case "github": {
await github()
break
}
case "steam": {
await $`java -jar mod-uploader.jar upload -w MarisaContinued/`.cwd(stsPath)
}
}
}