Skip to content

Commit cef23b7

Browse files
committed
chore: automate npm release for v1.5.3
1 parent 937c1d0 commit cef23b7

7 files changed

Lines changed: 64 additions & 4 deletions

File tree

.github/workflows/publish-npm.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Publish to npm
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
permissions:
9+
contents: read
10+
id-token: write
11+
12+
jobs:
13+
publish:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v6
17+
18+
- uses: actions/setup-node@v6
19+
with:
20+
node-version: "24"
21+
registry-url: "https://registry.npmjs.org"
22+
23+
- name: Verify tag matches package version
24+
run: |
25+
package_version=$(node -p "require('./package.json').version")
26+
if [ "v$package_version" != "$GITHUB_REF_NAME" ]; then
27+
echo "Tag $GITHUB_REF_NAME does not match package.json version v$package_version" >&2
28+
exit 1
29+
fi
30+
31+
- run: npm ci
32+
- run: npm run build
33+
- run: npm test
34+
- run: npm pack --dry-run
35+
- run: npm publish

llmdoc/architecture/system.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
- `src/utils/frontmatter.ts`: YAML frontmatter parse/stringify via gray-matter.
2828
- `src/utils/toml.ts`: TOML serialization via @iarna/toml.
2929
- `src/utils/fs.ts` (`writeFile`, `readFile`, `fileExists`): File system utilities with directory creation.
30+
- `.github/workflows/acplugin.yml`: Repository CI workflow that runs `TokenRollAI/acplugin-action@v1` on Claude source changes in `main`.
31+
- `.github/workflows/publish-npm.yml`: Release workflow. Triggers on `v*` tags, verifies the tag matches `package.json` version, runs install/build/test/package validation, then publishes to npm with GitHub Actions OIDC Trusted Publishing.
3032

3133
## 3. Execution Flow (LLM Retrieval Map)
3234

llmdoc/guides/release.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# How to Publish `@disdjj/acplugin` to npm
2+
3+
Release publishing is automated by GitHub Actions. The workflow lives at `.github/workflows/publish-npm.yml` and publishes only from Git tags that match the package version.
4+
5+
1. Update the package version in `package.json` and `package-lock.json`.
6+
7+
2. Commit the version bump to `main`.
8+
9+
3. Create and push a Git tag in the form `vX.Y.Z`. The tag must exactly match `package.json` version. Example: package version `1.5.3` requires tag `v1.5.3`.
10+
11+
4. GitHub Actions runs `.github/workflows/publish-npm.yml` on the tag push. The workflow validates the tag-version match, then runs `npm ci`, `npm run build`, `npm test`, `npm pack --dry-run`, and `npm publish`.
12+
13+
5. npm authentication uses Trusted Publishing, not a long-lived token. The npm package `@disdjj/acplugin` must be configured to trust the GitHub repository `TokenRollAI/acplugin` and workflow `.github/workflows/publish-npm.yml`.
14+
15+
6. Package metadata required for publishing is stored in `package.json`. `repository.url` must point to `https://github.com/TokenRollAI/acplugin.git`, and `publishConfig.access` must stay `public` because the package is scoped.

llmdoc/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ CLI tool that converts Claude Code plugins (skills, instructions, MCP configs, a
1313
### Guides
1414

1515
- [CLI Usage](guides/usage.md) - How to scan and convert resources from local paths or GitHub repos.
16+
- [npm Release](guides/release.md) - How tag-driven GitHub Actions publishing to npm works.
1617

1718
### Architecture
1819

llmdoc/overview/project.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
acplugin follows a scan-convert-write pipeline. It scans a local directory or a GitHub repository for Claude Code resources (skills, instructions, MCP server configs, agents, commands, and hooks), then converts each resource type into the target platform's native format, and writes the output files. Conversion is one-way (Claude Code to others, never bidirectional). Claude-specific fields that have no equivalent on a target platform are preserved as HTML comments or generate compatibility warnings. A model mapping module (`src/utils/model.ts`) translates Claude model names to platform equivalents (e.g., `gpt-5.4` for Codex, `gemini-3-pro`/`gemini-3-flash` for Antigravity).
1111

12-
The tool supports three input formats: standard Claude Code project layout (`.claude/` directory), single plugin (`.claude-plugin/plugin.json`), and multi-plugin marketplace (`.claude-plugin/marketplace.json`). Sources can be local paths or GitHub repositories (auto-detected from `owner/repo` syntax). For marketplace repos, an interactive TUI allows selecting which plugins and target platforms to convert. Cursor output uses `.cursor-plugin/` format with `plugin.json` manifest and resources at plugin root (`skills/`, `agents/`, `commands/`, `rules/`, `mcp.json`), compatible with Cursor Marketplace (v2.5+). OpenCode generates `.opencode/agents/*.md` with `mode: subagent`, `steps`, `permission` fields; Antigravity generates `.gemini/agents/*.md` with tool-mapped `allowed-tools` lists. A GitHub Action workflow (`.github/workflows/acplugin.yml`) using `TokenRollAI/acplugin-action@v1` enables CI auto-conversion on push to main.
12+
The tool supports three input formats: standard Claude Code project layout (`.claude/` directory), single plugin (`.claude-plugin/plugin.json`), and multi-plugin marketplace (`.claude-plugin/marketplace.json`). Sources can be local paths or GitHub repositories (auto-detected from `owner/repo` syntax). For marketplace repos, an interactive TUI allows selecting which plugins and target platforms to convert. Cursor output uses `.cursor-plugin/` format with `plugin.json` manifest and resources at plugin root (`skills/`, `agents/`, `commands/`, `rules/`, `mcp.json`), compatible with Cursor Marketplace (v2.5+). OpenCode generates `.opencode/agents/*.md` with `mode: subagent`, `steps`, `permission` fields; Antigravity generates `.gemini/agents/*.md` with tool-mapped `allowed-tools` lists. GitHub Actions also handles automation around the project itself: `.github/workflows/acplugin.yml` runs conversion on push to main, and `.github/workflows/publish-npm.yml` publishes `@disdjj/acplugin` to npm from matching `v*` tags via npm Trusted Publishing.
1313

1414
**Tech Stack:** TypeScript, Node.js, Commander.js, gray-matter, @iarna/toml, glob, @inquirer/prompts, chalk, ora.
1515

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@disdjj/acplugin",
3-
"version": "1.5.2",
3+
"version": "1.5.3",
44
"description": "Convert Claude Code plugins to Codex, OpenCode, and Cursor formats",
55
"main": "dist/index.js",
66
"bin": {
@@ -31,8 +31,15 @@
3131
"mcp"
3232
],
3333
"author": "",
34+
"repository": {
35+
"type": "git",
36+
"url": "https://github.com/TokenRollAI/acplugin.git"
37+
},
3438
"license": "MIT",
3539
"type": "commonjs",
40+
"publishConfig": {
41+
"access": "public"
42+
},
3643
"dependencies": {
3744
"@iarna/toml": "^2.2.5",
3845
"@inquirer/prompts": "^8.3.2",

0 commit comments

Comments
 (0)