Skip to content

Commit 191bf0f

Browse files
authored
feat: prepare npm publishing automation (#3)
* Prepare npm publishing and add release workflow * Rename npm package and trim README release docs * Add CI lint workflow * chore: add semantic-release scaffolding * ci: add conventional PR title check * ci: fix PR title check
1 parent b1f093a commit 191bf0f

7 files changed

Lines changed: 6231 additions & 344 deletions

File tree

.github/workflows/lint.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Lint
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- codex/**
8+
pull_request:
9+
10+
permissions:
11+
contents: read
12+
13+
concurrency:
14+
group: lint-${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
lint:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Check out repository
22+
uses: actions/checkout@v5
23+
24+
- name: Set up Node.js
25+
uses: actions/setup-node@v4
26+
with:
27+
node-version: "24"
28+
29+
- name: Install dependencies
30+
run: npm ci
31+
32+
- name: Run lint
33+
run: npm run lint

.github/workflows/pr-title.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: PR Title
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- edited
8+
- reopened
9+
- synchronize
10+
11+
permissions:
12+
contents: read
13+
pull-requests: read
14+
15+
concurrency:
16+
group: pr-title-${{ github.workflow }}-${{ github.event.pull_request.number }}
17+
cancel-in-progress: true
18+
19+
jobs:
20+
conventional-pr-title:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Validate PR title
24+
env:
25+
PR_TITLE: ${{ github.event.pull_request.title }}
26+
run: |
27+
python3 - <<'PY'
28+
import os
29+
import re
30+
import sys
31+
32+
title = os.environ["PR_TITLE"]
33+
pattern = re.compile(
34+
r"^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\([^)]+\))?(!)?: .+"
35+
)
36+
37+
if pattern.match(title):
38+
print("PR title is a valid conventional commit title.")
39+
raise SystemExit(0)
40+
41+
print(f"Invalid PR title: {title}", file=sys.stderr)
42+
print("Expected format: type(scope): description", file=sys.stderr)
43+
print(
44+
"Allowed types: build, chore, ci, docs, feat, fix, perf, refactor, revert, style, test",
45+
file=sys.stderr,
46+
)
47+
raise SystemExit(1)
48+
PY

.github/workflows/release.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: write
10+
issues: write
11+
pull-requests: write
12+
id-token: write
13+
14+
concurrency:
15+
group: release-${{ github.workflow }}-${{ github.ref }}
16+
cancel-in-progress: false
17+
18+
jobs:
19+
publish:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Check out repository
23+
uses: actions/checkout@v5
24+
with:
25+
fetch-depth: 0
26+
27+
- name: Set up Node.js
28+
uses: actions/setup-node@v4
29+
with:
30+
node-version: "24.10.0"
31+
32+
- name: Install dependencies
33+
run: npm ci
34+
35+
- name: Lint
36+
run: npm run lint
37+
38+
- name: Release
39+
env:
40+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41+
run: npm run release

.releaserc.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"branches": [
3+
"main"
4+
],
5+
"tagFormat": "v${version}",
6+
"plugins": [
7+
"@semantic-release/commit-analyzer",
8+
"@semantic-release/release-notes-generator",
9+
"@semantic-release/npm",
10+
"@semantic-release/github"
11+
]
12+
}

README.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,22 @@
1-
# @agentcontrol/agent-control
1+
# agent-control-openclaw-plugin
22

33
Agent Control plugin for OpenClaw.
44

55
> [!WARNING]
66
> Experimental plugin: this project is currently a hacky integration and may
77
> break across OpenClaw updates. Use in non-production or pinned environments.
88
9-
## Local dev install (no publish)
9+
## Install from npm
10+
11+
Install the published plugin directly into OpenClaw:
12+
13+
```bash
14+
openclaw plugins install agent-control-openclaw-plugin
15+
```
16+
17+
Then restart the gateway.
18+
19+
## Local dev install
1020

1121
1. Clone this repo anywhere on disk.
1222
2. Install plugin deps in this repo:

0 commit comments

Comments
 (0)