|
1 | | -import { parse, yaml } from "../deps.ts"; |
| 1 | +import { parse } from "../deps.ts"; |
2 | 2 | import { sh } from "../exec.ts"; |
3 | | -import * as $notes from "../notes.ts"; |
| 3 | + |
| 4 | +import * as $signoffs from "../signoffs.ts"; |
4 | 5 |
|
5 | 6 | const flags = parse(Deno.args, { |
6 | 7 | "boolean": "dry-run", |
7 | 8 | }); |
8 | 9 |
|
9 | 10 | const dryRun = flags["dry-run"] ?? false; |
10 | 11 |
|
11 | | -for await (let note of $notes.all("shipit")) { |
12 | | - let releases = yaml.parse(note.content); |
13 | | - for (let tag of Object.values(releases) as string[]) { |
| 12 | +for await (let signoff of $signoffs.untagged()) { |
| 13 | + for (let tag of signoff.releases) { |
14 | 14 | if (dryRun) { |
15 | | - console.log(`[DRY] git tag ${tag} ${note.targetId}`); |
| 15 | + console.log(`[DRY] git tag ${tag} ${signoff.commitId}`); |
16 | 16 | } else { |
17 | | - await sh(["git", "tag", tag, note.targetId]); |
| 17 | + await sh(["git", "tag", tag, signoff.commitId]); |
18 | 18 | } |
19 | 19 | } |
20 | | -} |
21 | | - |
22 | | -const cleanup = [ |
23 | | - ["git", "push", "origin", ":refs/notes/shipit"], |
24 | | - ["git", "push", "origin", "--tags"], |
25 | | -]; |
26 | | - |
27 | | -if (!dryRun) { |
28 | | - for (let cmd of cleanup) { |
29 | | - await sh(cmd); |
| 20 | + if (!dryRun) { |
| 21 | + await $signoffs.complete(signoff); |
30 | 22 | } |
31 | | -} else { |
32 | | - console.log(cleanup.map((cmd) => `[DRY] ${cmd.join(" ")}`).join("\n")); |
33 | 23 | } |
0 commit comments