Skip to content

Commit adcecd7

Browse files
committed
automated zip packaging releases
1 parent 3f13fdf commit adcecd7

3 files changed

Lines changed: 10 additions & 4 deletions

File tree

.cursor/rules/project.mdc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ alwaysApply: true
77
# Project layout
88

99
- **Repository root**: Plugin sources — `index.js`, `worker.mjs`, `worker-log.mjs`, `openclaw-resolve.mjs`, `package.json`, `openclaw.plugin.json`, `README.md`, `CHANGELOG.md`, `LICENSE`. **`node-edge-tts`** is a **dependency**; **`openclaw`** is an **optional** peer. Keep **`package.json`** and **`openclaw.plugin.json`** `version` fields identical; run **`npm run check-version`** or **`npm run release`** to verify.
10-
- **User docs**: Root **`README.md`** is the install and configuration guide; **`CHANGELOG.md`** is the release history. **`npm run release`** copies both (and other bundle files) into **`release/discord-tts-attacher/`** (gitignored).
10+
- **User docs**: Root **`README.md`** is the install and configuration guide; **`CHANGELOG.md`** is the release history. **`npm run release`** copies both (and other bundle files) into **`release/discord-tts-attacher/`** (gitignored) and writes **`release/discord-tts-attacher-<version>.zip`**.
1111
- **Live OpenClaw plugin**: Typically **`~/.openclaw/extensions/discord-tts-attacher/`** with **`npm install`** there (**`node-edge-tts`** from `dependencies`; optional **`openclaw`** only if you need the npm SDK fallback). Shared maintainer workflow: **`npm run release`**, ClawHub / manual copy — see **`DEVELOPMENT.md`**.
1212
- **Owner-only (ignore for default assistant work)**: **`scripts/sync-to-live-plugin.sh`** is not part of the shared workflow and is not referenced in **README** or **DEVELOPMENT**. It exists only for this repo owner’s local machine (run with **`bash`** if needed). **Do not** open, edit, or refactor it unless the user explicitly asks. Listed in **`.cursorignore`** so Cursor downweights it.

DEVELOPMENT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Here **`synthTimeoutMs`** is the synthesis estimate above. So **`pickupTimeoutMs
6161
Optional: **`npm install`** in the root for **`node-edge-tts`** and maintainer scripts. **`openclaw-resolve.mjs`** loads **`definePluginEntry`** from **`dist/plugin-sdk/plugin-entry.js`** and picks **`sendMessageDiscord`** from **`dist/extensions/discord/runtime-api.js`** (OpenClaw **2026.4+**) or **`dist/plugin-sdk/discord.js`** (legacy). Optional **`npm install openclaw`** if you need the **`openclaw/package.json`** fallback outside a gateway. The **gateway** still uses **`node_modules`** inside **`~/.openclaw/extensions/discord-tts-attacher/`**.
6262

6363
2. **`npm run release`**
64-
Refreshes the minimal plugin bundle (plugin sources only, no `node_modules`, no `scripts/`). Copies the root **`README.md`** into that bundle. **`CHANGELOG.md`** is included in the bundle via rsync. The command prints the bundle output directory when it finishes. That output tree is **not committed to git** and is **omitted from ClawHub “publish whole repo” uploads**; generate it whenever you need a zip or a **`clawhub package publish .`** target.
64+
Refreshes the minimal plugin bundle (plugin sources only, no `node_modules`, no `scripts/`). Copies the root **`README.md`** into that bundle. **`CHANGELOG.md`** is included in the bundle via rsync. Also creates **`release/discord-tts-attacher-<version>.zip`** containing a top-level **`discord-tts-attacher/`** folder (same files as the directory bundle). The command prints the bundle path and zip path when it finishes. That output is **not committed to git** (`release/` is ignored); generate it whenever you need a zip or a **`clawhub package publish .`** target (publish from the **directory**, not the zip, unless your workflow says otherwise).
6565

6666
3. **ClawHub (`clawhub package publish`)**
6767
Code plugins need **`openclaw.compat.pluginApi`** and **`openclaw.build.openclawVersion`** in **`package.json`** (ClawHub rejects uploads without them). Bump **`openclaw.build.openclawVersion`** / **`pluginSdkVersion`** when you verify against a newer OpenClaw release.

scripts/prepare-release.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
2-
# Build release/discord-tts-attacher/ — minimal plugin tree for zip, manual share, or
3-
# clawhub package publish ./release/discord-tts-attacher
2+
# Build release/discord-tts-attacher/ — minimal plugin tree for ClawHub, manual share, etc.
3+
# Also writes release/discord-tts-attacher-<version>.zip (folder inside the archive).
44
# (see DEVELOPMENT.md). No node_modules or dev-only files.
55
set -euo pipefail
66
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
@@ -44,4 +44,10 @@ find "$OUT" -mindepth 1 -maxdepth 1 ! \( \
4444
-name index.js -o -name openclaw-resolve.mjs -o -name openclaw.plugin.json -o \
4545
-name package.json -o -name worker-log.mjs -o -name worker.mjs \
4646
\) -exec rm -rf {} +
47+
VERSION="$(cd "$ROOT" && node -p "require('./package.json').version")"
48+
ZIP_NAME="discord-tts-attacher-${VERSION}.zip"
49+
ZIP_PATH="$ROOT/release/$ZIP_NAME"
50+
rm -f "$ZIP_PATH"
51+
( cd "$ROOT/release" && zip -rq "$ZIP_NAME" discord-tts-attacher )
4752
echo "Release bundle ready: $OUT"
53+
echo "Release zip: $ZIP_PATH"

0 commit comments

Comments
 (0)