Add plugin manager and bump to v0.1.2

This commit is contained in:
Benjamin Shafii
2026-01-13 21:23:52 -08:00
parent 98a31f9ee5
commit 02fdac0a4a
14 changed files with 952 additions and 57 deletions

View File

@@ -0,0 +1,73 @@
name: publish
description: Publish OpenWork DMG releases
---
## Purpose
Publish a new OpenWork release (version bump + DMG + GitHub release) without forgetting any steps.
## Prereqs
- `pnpm`
- Rust toolchain (`cargo`, `rustc`)
- `gh` authenticated (`gh auth status`)
- macOS tools: `hdiutil`, `codesign`, `spctl`
## Workflow
### 1) Clean working tree
```bash
git status
```
### 2) Bump version everywhere
- `package.json` (`version`)
- `src-tauri/tauri.conf.json` (`version`)
- `src-tauri/Cargo.toml` (`version`)
### 3) Validate builds
```bash
pnpm typecheck
pnpm build:web
cargo check --manifest-path src-tauri/Cargo.toml
```
### 4) Build DMG
```bash
pnpm tauri build --bundles dmg
```
Expected output (Apple Silicon example):
- `src-tauri/target/release/bundle/dmg/OpenWork_<version>_aarch64.dmg`
### 5) Commit + tag
```bash
git commit -am "Release vX.Y.Z"
git tag -a vX.Y.Z -m "OpenWork vX.Y.Z"
git push
git push origin vX.Y.Z
```
### 6) GitHub release
```bash
gh release create vX.Y.Z \
--title "OpenWork vX.Y.Z" \
--notes "<summary>"
gh release upload vX.Y.Z "src-tauri/target/release/bundle/dmg/<DMG_NAME>.dmg" --clobber
```
## Helper
Run the quick check:
```bash
bun .opencode/skill/publish/first-call.ts
```

View File

@@ -0,0 +1,35 @@
import { spawn } from "child_process";
export async function run(
command: string,
args: string[],
options?: { cwd?: string; allowFailure?: boolean },
): Promise<{ ok: boolean; code: number; stdout: string; stderr: string }> {
const child = spawn(command, args, {
cwd: options?.cwd,
stdio: ["ignore", "pipe", "pipe"],
env: process.env,
});
let stdout = "";
let stderr = "";
child.stdout.setEncoding("utf8");
child.stderr.setEncoding("utf8");
child.stdout.on("data", (d) => (stdout += d));
child.stderr.on("data", (d) => (stderr += d));
const code = await new Promise<number>((resolve) => {
child.on("close", (c) => resolve(c ?? -1));
});
const ok = code === 0;
if (!ok && !options?.allowFailure) {
throw new Error(
`Command failed (${code}): ${command} ${args.join(" ")}\n${stderr || stdout}`,
);
}
return { ok, code, stdout, stderr };
}

View File

@@ -0,0 +1,36 @@
import { readFile } from "fs/promises";
import { loadEnv } from "./load-env";
import { run } from "./client";
async function main() {
await loadEnv();
await run("gh", ["auth", "status"], { allowFailure: false });
const pkgRaw = await readFile("package.json", "utf8");
const pkg = JSON.parse(pkgRaw) as { name?: string; version?: string };
console.log(
JSON.stringify(
{
ok: true,
package: pkg.name ?? null,
version: pkg.version ?? null,
next: [
"pnpm typecheck",
"pnpm build:web",
"cargo check --manifest-path src-tauri/Cargo.toml",
"pnpm tauri build --bundles dmg",
"gh release upload vX.Y.Z <dmg> --clobber",
],
},
null,
2,
),
);
}
main().catch((e) => {
const message = e instanceof Error ? e.message : String(e);
console.error(message);
process.exit(1);
});

View File

@@ -0,0 +1,23 @@
import { run } from "./client";
const REQUIRED = ["pnpm", "cargo", "gh", "hdiutil", "codesign", "spctl", "git"];
export async function loadEnv() {
const missing: string[] = [];
for (const bin of REQUIRED) {
try {
await run("/usr/bin/env", ["bash", "-lc", `command -v ${bin}`], {
allowFailure: false,
});
} catch {
missing.push(bin);
}
}
if (missing.length) {
throw new Error(`Missing required tools: ${missing.join(", ")}`);
}
return { ok: true as const };
}