diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 617cf9553..5d323cdd9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -166,7 +166,7 @@ jobs: IS_DRY_RUN: '${{ steps.vars.outputs.is_dry_run }}' RELEASE_TAG: '${{ steps.version.outputs.RELEASE_TAG }}' run: |- - git add package.json package-lock.json packages/*/package.json + git add package.json package-lock.json packages/*/package.json packages/channels/*/package.json if git diff --staged --quiet; then echo "No version changes to commit" else @@ -198,6 +198,20 @@ jobs: env: NODE_AUTH_TOKEN: '${{ secrets.NPM_TOKEN }}' + - name: 'Publish @qwen-code/channel-base' + working-directory: 'packages/channels/base' + run: |- + npm publish --access public --tag=${{ steps.version.outputs.NPM_TAG }} ${{ steps.vars.outputs.is_dry_run == 'true' && '--dry-run' || '' }} + env: + NODE_AUTH_TOKEN: '${{ secrets.NPM_TOKEN }}' + + - name: 'Publish @qwen-code/channel-plugin-example' + working-directory: 'packages/channels/plugin-example' + run: |- + npm publish --access public --tag=${{ steps.version.outputs.NPM_TAG }} ${{ steps.vars.outputs.is_dry_run == 'true' && '--dry-run' || '' }} + env: + NODE_AUTH_TOKEN: '${{ secrets.NPM_TOKEN }}' + - name: 'Create GitHub Release and Tag' if: |- ${{ steps.vars.outputs.is_dry_run == 'false' }} diff --git a/packages/channels/base/package.json b/packages/channels/base/package.json index e32304c66..6d66675de 100644 --- a/packages/channels/base/package.json +++ b/packages/channels/base/package.json @@ -1,6 +1,6 @@ { "name": "@qwen-code/channel-base", - "version": "0.1.0", + "version": "0.13.0", "description": "Base channel infrastructure for Qwen Code", "type": "module", "main": "dist/index.js", diff --git a/packages/channels/dingtalk/package.json b/packages/channels/dingtalk/package.json index facfd5894..641fc9e29 100644 --- a/packages/channels/dingtalk/package.json +++ b/packages/channels/dingtalk/package.json @@ -1,6 +1,6 @@ { "name": "@qwen-code/channel-dingtalk", - "version": "0.1.0", + "version": "0.13.0", "description": "DingTalk channel adapter for Qwen Code", "type": "module", "main": "src/index.ts", diff --git a/packages/channels/plugin-example/package.json b/packages/channels/plugin-example/package.json index 9c59fd356..12816047d 100644 --- a/packages/channels/plugin-example/package.json +++ b/packages/channels/plugin-example/package.json @@ -1,6 +1,6 @@ { "name": "@qwen-code/channel-plugin-example", - "version": "0.1.0", + "version": "0.13.0", "type": "module", "main": "dist/index.js", "types": "dist/index.d.ts", @@ -22,7 +22,7 @@ "build": "tsc --build" }, "dependencies": { - "@qwen-code/channel-base": "^0.1.0", + "@qwen-code/channel-base": "file:../base", "ws": "^8.18.0" }, "devDependencies": { diff --git a/packages/channels/telegram/package.json b/packages/channels/telegram/package.json index 0154257d3..adc4f1071 100644 --- a/packages/channels/telegram/package.json +++ b/packages/channels/telegram/package.json @@ -1,6 +1,6 @@ { "name": "@qwen-code/channel-telegram", - "version": "0.1.0", + "version": "0.13.0", "description": "Telegram channel adapter for Qwen Code", "type": "module", "main": "src/index.ts", diff --git a/packages/channels/weixin/package.json b/packages/channels/weixin/package.json index 29adf6afe..f6a024733 100644 --- a/packages/channels/weixin/package.json +++ b/packages/channels/weixin/package.json @@ -1,6 +1,6 @@ { "name": "@qwen-code/channel-weixin", - "version": "0.1.0", + "version": "0.13.0", "description": "WeChat (Weixin) channel adapter for Qwen Code", "type": "module", "main": "src/index.ts", diff --git a/scripts/version.js b/scripts/version.js index d67ff71f6..cf74a8bd9 100644 --- a/scripts/version.js +++ b/scripts/version.js @@ -104,9 +104,28 @@ if (cliPackageJson.config?.sandboxImageUri) { writeJson(cliPackageJsonPath, cliPackageJson); } -// 7. Run `npm install` to update package-lock.json. +// 7. Rewrite file: references to semver for packages that will be published to npm. +// During development, channel packages use file: for monorepo linking. +// At release time, published packages need real semver references so they resolve from npm. +const publishedCrossRefs = [ + { + packagePath: 'packages/channels/plugin-example/package.json', + dep: '@qwen-code/channel-base', + }, +]; +for (const { packagePath, dep } of publishedCrossRefs) { + const pkgPath = resolve(process.cwd(), packagePath); + const pkgJson = readJson(pkgPath); + if (pkgJson.dependencies?.[dep]?.startsWith('file:')) { + pkgJson.dependencies[dep] = `^${newVersion}`; + console.log(`Updated ${dep} in ${packagePath} to ^${newVersion}`); + writeJson(pkgPath, pkgJson); + } +} + +// 8. Run `npm install` to update package-lock.json. run( - 'npm install --workspace packages/cli --workspace packages/core --package-lock-only', + 'npm install --workspace packages/cli --workspace packages/core --workspace packages/channels/base --workspace packages/channels/plugin-example --package-lock-only', ); console.log(`Successfully bumped versions to v${newVersion}.`);