mirror of
https://github.com/Tencent/BrowserSkill.git
synced 2026-09-10 13:01:23 +08:00
ci: publish the dsh plugin to npm as @wxg-prc-cpg/browser-skill-dsh-plugin
Add a Release dsh plugin workflow (dsh-plugin-v* tags or workflow_dispatch) that reads NPM_TOKEN from the GitHub Environment of the same name. The Cordis plugin id stays dsh-plugin-browserskill; only the npm package name changes.
This commit is contained in:
@@ -0,0 +1,105 @@
|
|||||||
|
name: Release dsh plugin
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- dsh-plugin-v*
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: release-dsh-plugin-${{ github.ref }}
|
||||||
|
cancel-in-progress: false
|
||||||
|
|
||||||
|
env:
|
||||||
|
PACKAGE_NAME: "@wxg-prc-cpg/browser-skill-dsh-plugin"
|
||||||
|
PACKAGE_DIR: packages/dsh-plugin-browserskill
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
resolve:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
version: ${{ steps.version.outputs.version }}
|
||||||
|
tag: ${{ steps.version.outputs.tag }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v6
|
||||||
|
|
||||||
|
- name: Resolve plugin version
|
||||||
|
id: version
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
|
||||||
|
VERSION="$(node -p "require('./${{ env.PACKAGE_DIR }}/package.json').version")"
|
||||||
|
else
|
||||||
|
VERSION="${GITHUB_REF_NAME#dsh-plugin-v}"
|
||||||
|
fi
|
||||||
|
VERSION="${VERSION#v}"
|
||||||
|
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
|
||||||
|
echo "tag=dsh-plugin-v${VERSION}" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
|
guard:
|
||||||
|
needs: resolve
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v6
|
||||||
|
|
||||||
|
- name: Verify tag matches package.json name and version
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
PKG_NAME="$(node -p "require('./${{ env.PACKAGE_DIR }}/package.json').name")"
|
||||||
|
PKG_VERSION="$(node -p "require('./${{ env.PACKAGE_DIR }}/package.json').version")"
|
||||||
|
RELEASE_VERSION="${{ needs.resolve.outputs.version }}"
|
||||||
|
if [ "$PKG_NAME" != "$PACKAGE_NAME" ]; then
|
||||||
|
echo "package.json name (${PKG_NAME}) does not match expected ${PACKAGE_NAME}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if [ "$PKG_VERSION" != "$RELEASE_VERSION" ]; then
|
||||||
|
echo "${PACKAGE_DIR}/package.json version (${PKG_VERSION}) does not match release version (${RELEASE_VERSION})"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "Version guard passed: ${PKG_NAME}@${RELEASE_VERSION}"
|
||||||
|
|
||||||
|
publish:
|
||||||
|
needs: [resolve, guard]
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
# Secret NPM_TOKEN is stored on the GitHub Environment also named NPM_TOKEN.
|
||||||
|
environment: NPM_TOKEN
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v6
|
||||||
|
|
||||||
|
- uses: pnpm/action-setup@v6
|
||||||
|
|
||||||
|
- uses: actions/setup-node@v6
|
||||||
|
with:
|
||||||
|
node-version: 22
|
||||||
|
cache: pnpm
|
||||||
|
registry-url: https://registry.npmjs.org
|
||||||
|
scope: "@wxg-prc-cpg"
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: pnpm install --frozen-lockfile
|
||||||
|
|
||||||
|
- name: Typecheck plugin
|
||||||
|
run: pnpm --filter "${{ env.PACKAGE_NAME }}" typecheck
|
||||||
|
|
||||||
|
- name: Test plugin
|
||||||
|
run: pnpm --filter "${{ env.PACKAGE_NAME }}" test
|
||||||
|
|
||||||
|
- name: Publish to npm
|
||||||
|
working-directory: ${{ env.PACKAGE_DIR }}
|
||||||
|
env:
|
||||||
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
if [ -z "${NODE_AUTH_TOKEN:-}" ]; then
|
||||||
|
echo "::error::Environment secret NPM_TOKEN is not configured"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
pnpm publish --access public --no-git-checks
|
||||||
|
echo "Published ${PACKAGE_NAME}@${{ needs.resolve.outputs.version }}"
|
||||||
+1
-1
@@ -9,7 +9,7 @@
|
|||||||
"ext:dev": "pnpm --filter @browser-skill/extension dev",
|
"ext:dev": "pnpm --filter @browser-skill/extension dev",
|
||||||
"ext:test": "pnpm --filter @browser-skill/extension test",
|
"ext:test": "pnpm --filter @browser-skill/extension test",
|
||||||
"vom:test": "pnpm --filter @browser-skill/vom test",
|
"vom:test": "pnpm --filter @browser-skill/vom test",
|
||||||
"lint": "biome check . && stylelint \"**/*.css\" && pnpm --filter dsh-plugin-browserskill typecheck && pnpm --filter dsh-plugin-browserskill test",
|
"lint": "biome check . && stylelint \"**/*.css\" && pnpm --filter @wxg-prc-cpg/browser-skill-dsh-plugin typecheck && pnpm --filter @wxg-prc-cpg/browser-skill-dsh-plugin test",
|
||||||
"format": "biome format --write ."
|
"format": "biome format --write ."
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
# dsh-plugin-browserskill
|
# dsh-plugin-browserskill
|
||||||
|
|
||||||
|
npm: [`@wxg-prc-cpg/browser-skill-dsh-plugin`](https://www.npmjs.com/package/@wxg-prc-cpg/browser-skill-dsh-plugin)
|
||||||
|
|
||||||
A [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (dsh) tool plugin that exposes
|
A [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (dsh) tool plugin that exposes
|
||||||
[BrowserSkill](https://github.com/Tencent/BrowserSkill) (`bsk`) browser automation to the model.
|
[BrowserSkill](https://github.com/Tencent/BrowserSkill) (`bsk`) browser automation to the model.
|
||||||
|
|
||||||
@@ -58,7 +60,7 @@ a session owned by another program.
|
|||||||
The plugin follows the standard dsh bundle layout (`dsh.bundle` manifest + `cordis.patch.yml`):
|
The plugin follows the standard dsh bundle layout (`dsh.bundle` manifest + `cordis.patch.yml`):
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
dsh plugin --profile <name> add <path-or-spec-of-this-package>
|
dsh plugin --profile <name> add @wxg-prc-cpg/browser-skill-dsh-plugin
|
||||||
dsh --profile <name>
|
dsh --profile <name>
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -166,11 +168,27 @@ shell's theme cannot bleed back in.
|
|||||||
|
|
||||||
```sh
|
```sh
|
||||||
pnpm install
|
pnpm install
|
||||||
pnpm --filter dsh-plugin-browserskill typecheck
|
pnpm --filter @wxg-prc-cpg/browser-skill-dsh-plugin typecheck
|
||||||
pnpm --filter dsh-plugin-browserskill test # unit tests mock bsk; no browser needed
|
pnpm --filter @wxg-prc-cpg/browser-skill-dsh-plugin test # unit tests mock bsk; no browser needed
|
||||||
pnpm --filter dsh-plugin-browserskill build # tsdown -> lib/
|
pnpm --filter @wxg-prc-cpg/browser-skill-dsh-plugin build # tsdown -> lib/
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Publishing
|
||||||
|
|
||||||
|
The GitHub Actions workflow **Release dsh plugin** publishes this package to npm
|
||||||
|
as `@wxg-prc-cpg/browser-skill-dsh-plugin`. The Cordis plugin id stays
|
||||||
|
`dsh-plugin-browserskill`.
|
||||||
|
|
||||||
|
Trigger it by pushing a tag that matches `package.json`'s `version`:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
git tag dsh-plugin-v0.1.0
|
||||||
|
git push origin dsh-plugin-v0.1.0
|
||||||
|
```
|
||||||
|
|
||||||
|
Or run the workflow from the Actions tab (`workflow_dispatch`). The job reads
|
||||||
|
`NPM_TOKEN` from the GitHub Environment of the same name.
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
MIT
|
MIT
|
||||||
|
|||||||
@@ -1,7 +1,27 @@
|
|||||||
{
|
{
|
||||||
"name": "dsh-plugin-browserskill",
|
"name": "@wxg-prc-cpg/browser-skill-dsh-plugin",
|
||||||
"description": "DeepSeek Harness tool plugin that exposes BrowserSkill (bsk) browser automation to the model",
|
"description": "DeepSeek Harness tool plugin that exposes BrowserSkill (bsk) browser automation to the model",
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
|
"license": "MIT",
|
||||||
|
"publishConfig": {
|
||||||
|
"access": "public",
|
||||||
|
"registry": "https://registry.npmjs.org/"
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git+https://github.com/Tencent/BrowserSkill.git",
|
||||||
|
"directory": "packages/dsh-plugin-browserskill"
|
||||||
|
},
|
||||||
|
"homepage": "https://github.com/Tencent/BrowserSkill/tree/main/packages/dsh-plugin-browserskill#readme",
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/Tencent/BrowserSkill/issues"
|
||||||
|
},
|
||||||
|
"keywords": [
|
||||||
|
"dsh-plugin",
|
||||||
|
"deepseek-harness",
|
||||||
|
"browserskill",
|
||||||
|
"browser-automation"
|
||||||
|
],
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "lib/index.mjs",
|
"main": "lib/index.mjs",
|
||||||
"types": "lib/index.d.mts",
|
"types": "lib/index.d.mts",
|
||||||
@@ -106,6 +126,5 @@
|
|||||||
"vitest": "^4.1.6",
|
"vitest": "^4.1.6",
|
||||||
"@browser-skill/ui": "workspace:*",
|
"@browser-skill/ui": "workspace:*",
|
||||||
"@remixicon/react": "^4.9.0"
|
"@remixicon/react": "^4.9.0"
|
||||||
},
|
}
|
||||||
"license": "MIT"
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user