mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-05-22 03:03:56 +00:00
chore(release): add channel packages to release workflow
- Bump channel package versions to 0.13.0 - Add publish steps for @qwen-code/channel-base and @qwen-code/channel-plugin-example - Update version script to convert file: references to semver for published packages This enables proper npm publishing of channel packages during the release process. Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
parent
c97c548acb
commit
a700ce8186
7 changed files with 42 additions and 9 deletions
16
.github/workflows/release.yml
vendored
16
.github/workflows/release.yml
vendored
|
|
@ -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' }}
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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": {
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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}.`);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue