Compare commits

...

7 Commits

Author SHA1 Message Date
github-actions[bot]
801549b982 chore(release): v0.0.4-nightly.0 2025-08-02 00:48:26 +00:00
奕桁
4db2fc9ed6 update issue template 2025-08-01 19:14:10 +08:00
奕桁
2786f10e8c update dev version 2025-08-01 18:28:16 +08:00
奕桁
964d211270 update dev version 2025-08-01 18:05:05 +08:00
Yiheng Xu
a09a9f2261 fix release.yml 2025-08-01 17:51:42 +08:00
奕桁
09c2a1871b release v0.0.1 2025-08-01 17:26:59 +08:00
Yiheng Xu
999f3af098 fix release workflow (#172) 2025-08-01 17:13:07 +08:00
13 changed files with 99 additions and 68 deletions

View File

@@ -1,5 +1,5 @@
name: Bug Report
description: Report a bug to help us improve Gemini CLI
description: Report a bug to help us improve Qwen Code
labels: ['kind/bug', 'status/need-triage']
body:
- type: markdown
@@ -8,7 +8,7 @@ body:
> [!IMPORTANT]
> Thanks for taking the time to fill out this bug report!
>
> Please search **[existing issues](https://github.com/google-gemini/gemini-cli/issues)** to see if an issue already exists for the bug you encountered.
> Please search **[existing issues](https://github.com/QwenLM/qwen-code/issues)** to see if an issue already exists for the bug you encountered.
- type: textarea
id: problem
@@ -29,12 +29,12 @@ body:
id: info
attributes:
label: Client information
description: Please paste the full text from the `/about` command run from Gemini CLI. Also include which platform (MacOS, Windows, Linux).
description: Please paste the full text from the `/about` command run from Qwen Code. Also include which platform (macOS, Windows, Linux).
value: |
<details>
```console
$ gemini /about
$ qwen /about
# paste output here
```
@@ -46,10 +46,10 @@ body:
id: login-info
attributes:
label: Login information
description: Describe how you are logging in (e.g., Google Account, API key).
description: Describe how you are logging in (e.g., API Config).
- type: textarea
id: additional-context
attributes:
label: Anything else we need to know?
description: Add any other context about the problem here.
description: Add any other context about the problem here.

View File

@@ -8,7 +8,7 @@ body:
> [!IMPORTANT]
> Thanks for taking the time to suggest an enhancement!
>
> Please search **[existing issues](https://github.com/google-gemini/gemini-cli/issues)** to see if a similar feature has already been requested.
> Please search **[existing issues](https://github.com/QwenLM/qwen-code/issues)** to see if a similar feature has already been requested.
- type: textarea
id: feature

View File

@@ -37,7 +37,7 @@ jobs:
environment:
name: production-release
url: ${{ github.server_url }}/${{ github.repository }}/releases/tag/${{ steps.version.outputs.RELEASE_TAG }}
if: github.repository == 'google-gemini/gemini-cli'
if: github.repository == 'QwenLM/qwen-code'
permissions:
contents: write
packages: write
@@ -95,7 +95,9 @@ jobs:
npm run test:integration:sandbox:none
npm run test:integration:sandbox:docker
env:
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
OPENAI_BASE_URL: ${{ secrets.OPENAI_BASE_URL }}
OPENAI_MODEL: ${{ secrets.OPENAI_MODEL }}
- name: Configure Git User
run: |
@@ -133,22 +135,22 @@ jobs:
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: '20'
registry-url: 'https://wombat-dressing-room.appspot.com'
scope: '@google'
registry-url: 'https://registry.npmjs.org'
scope: '@qwen-code'
- name: Publish @google/gemini-cli-core
run: npm publish --workspace=@google/gemini-cli-core --tag=${{ steps.version.outputs.NPM_TAG }} ${{ steps.vars.outputs.is_dry_run == 'true' && '--dry-run' || '' }}
- name: Publish @qwen-code/qwen-code-core
run: npm publish --workspace=@qwen-code/qwen-code-core --access public --tag=${{ steps.version.outputs.NPM_TAG }} ${{ steps.vars.outputs.is_dry_run == 'true' && '--dry-run' || '' }}
env:
NODE_AUTH_TOKEN: ${{ secrets.WOMBAT_TOKEN_CORE }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Install latest core package
if: steps.vars.outputs.is_dry_run == 'false'
run: npm install @google/gemini-cli-core@${{ steps.version.outputs.RELEASE_VERSION }} --workspace=@google/gemini-cli --save-exact
run: npm install @qwen-code/qwen-code-core@${{ steps.version.outputs.RELEASE_VERSION }} --workspace=@qwen-code/qwen-code --save-exact
- name: Publish @google/gemini-cli
run: npm publish --workspace=@google/gemini-cli --tag=${{ steps.version.outputs.NPM_TAG }} ${{ steps.vars.outputs.is_dry_run == 'true' && '--dry-run' || '' }}
- name: Publish @qwen-code/qwen-code
run: npm publish --workspace=@qwen-code/qwen-code --access public --tag=${{ steps.version.outputs.NPM_TAG }} ${{ steps.vars.outputs.is_dry_run == 'true' && '--dry-run' || '' }}
env:
NODE_AUTH_TOKEN: ${{ secrets.WOMBAT_TOKEN_CLI }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Create GitHub Release and Tag
if: ${{ steps.vars.outputs.is_dry_run == 'false' }}

13
package-lock.json generated
View File

@@ -1,18 +1,15 @@
{
"name": "@qwen-code/qwen-code",
"version": "0.0.1-alpha.12",
"version": "0.0.4-nightly.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@qwen-code/qwen-code",
"version": "0.0.1-alpha.12",
"version": "0.0.4-nightly.0",
"workspaces": [
"packages/*"
],
"dependencies": {
"@qwen-code/qwen-code": "^0.0.1-alpha.8"
},
"bin": {
"qwen": "bundle/gemini.js"
},
@@ -11945,7 +11942,7 @@
},
"packages/cli": {
"name": "@qwen-code/qwen-code",
"version": "0.0.1-alpha.12",
"version": "0.0.4-nightly.0",
"dependencies": {
"@qwen-code/qwen-code-core": "file:../core",
"@types/update-notifier": "^6.0.8",
@@ -12123,7 +12120,7 @@
},
"packages/core": {
"name": "@qwen-code/qwen-code-core",
"version": "0.0.1-alpha.12",
"version": "0.0.4-nightly.0",
"dependencies": {
"@google/genai": "1.8.0",
"@modelcontextprotocol/sdk": "^1.11.0",
@@ -12197,7 +12194,7 @@
},
"packages/vscode-ide-companion": {
"name": "@qwen-code/qwen-code-vscode-ide-companion",
"version": "0.0.1-alpha.12",
"version": "0.0.4-nightly.0",
"dependencies": {
"@modelcontextprotocol/sdk": "^1.15.1",
"cors": "^2.8.5",

View File

@@ -1,6 +1,6 @@
{
"name": "@qwen-code/qwen-code",
"version": "0.0.1-alpha.12",
"version": "0.0.4-nightly.0",
"engines": {
"node": ">=20"
},
@@ -10,10 +10,10 @@
],
"repository": {
"type": "git",
"url": "git+http://gitlab.alibaba-inc.com/Qwen-Coder/qwen-code.git"
"url": "git+https://github.com/QwenLM/qwen-code.git"
},
"config": {
"sandboxImageUri": "ghcr.io/qwenlm/qwen-code:0.0.1-alpha.12"
"sandboxImageUri": "ghcr.io/qwenlm/qwen-code:0.0.4-nightly.0"
},
"scripts": {
"start": "node scripts/start.js",
@@ -81,8 +81,5 @@
"typescript-eslint": "^8.30.1",
"vitest": "^3.2.4",
"yargs": "^18.0.0"
},
"dependencies": {
"@qwen-code/qwen-code": "^0.0.1-alpha.8"
}
}

View File

@@ -1,10 +1,10 @@
{
"name": "@qwen-code/qwen-code",
"version": "0.0.1-alpha.12",
"description": "Gemini CLI",
"version": "0.0.4-nightly.0",
"description": "Qwen Code",
"repository": {
"type": "git",
"url": "git+http://gitlab.alibaba-inc.com/Qwen-Coder/qwen-code.git"
"url": "git+https://github.com/QwenLM/qwen-code.git"
},
"type": "module",
"main": "dist/index.js",
@@ -25,7 +25,7 @@
"dist"
],
"config": {
"sandboxImageUri": "ghcr.io/qwenlm/qwen-code:0.0.1-alpha.12"
"sandboxImageUri": "ghcr.io/qwenlm/qwen-code:0.0.4-nightly.0"
},
"dependencies": {
"@qwen-code/qwen-code-core": "file:../core",

View File

@@ -1,12 +1,12 @@
{
"name": "@google/gemini-cli-core",
"version": "0.0.1-alpha.12",
"version": "0.0.3",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@google/gemini-cli-core",
"version": "0.0.1-alpha.12",
"version": "0.0.3",
"dependencies": {
"@google/genai": "^1.4.0",
"@modelcontextprotocol/sdk": "^1.11.0",

View File

@@ -1,10 +1,10 @@
{
"name": "@qwen-code/qwen-code-core",
"version": "0.0.1-alpha.12",
"version": "0.0.4-nightly.0",
"description": "Qwen Code Core",
"repository": {
"type": "git",
"url": "git+http://gitlab.alibaba-inc.com/Qwen-Coder/qwen-code.git"
"url": "git+https://github.com/QwenLM/qwen-code.git"
},
"type": "module",
"main": "dist/index.js",

View File

@@ -1,12 +1,12 @@
{
"name": "qwen-code-vscode",
"version": "0.0.1-alpha.12",
"version": "0.0.3",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "qwen-code-vscode",
"version": "0.0.1-alpha.12",
"version": "0.0.3",
"dependencies": {
"@modelcontextprotocol/sdk": "^1.15.1",
"cors": "^2.8.5",

View File

@@ -2,7 +2,7 @@
"name": "@qwen-code/qwen-code-vscode-ide-companion",
"displayName": "Qwen Code VSCode IDE Companion",
"description": "",
"version": "0.0.1-alpha.12",
"version": "0.0.4-nightly.0",
"engines": {
"vscode": "^1.101.0"
},

View File

@@ -14,20 +14,44 @@ function getPackageVersion() {
return packageJson.version;
}
function getShortSha() {
return execSync('git rev-parse --short HEAD').toString().trim();
function incrementPatchVersion(version) {
const parts = version.split('.');
const major = parseInt(parts[0]);
const minor = parseInt(parts[1]);
const patch = parseInt(parts[2].split('-')[0]); // Handle pre-release versions
return `${major}.${minor}.${patch + 1}`;
}
function getLatestNightlyCount() {
try {
// Try to get the latest nightly tag from git to determine the counter
const currentVersion = getPackageVersion();
const nextVersion = incrementPatchVersion(currentVersion);
const tags = execSync(`git tag -l "v${nextVersion}-nightly.*"`)
.toString()
.trim();
if (!tags) return 0;
const nightlyTags = tags.split('\n').filter(Boolean);
const counts = nightlyTags.map((tag) => {
const match = tag.match(/nightly\.(\d+)$/);
return match ? parseInt(match[1]) : 0;
});
return Math.max(...counts, -1) + 1;
} catch (_error) {
// If we can't get tags, start from 0
return 0;
}
}
export function getNightlyTagName() {
const version = getPackageVersion();
const now = new Date();
const year = now.getUTCFullYear().toString().slice(-2);
const month = (now.getUTCMonth() + 1).toString().padStart(2, '0');
const day = now.getUTCDate().toString().padStart(2, '0');
const date = `${year}${month}${day}`;
const nextVersion = incrementPatchVersion(version);
const nightlyCount = getLatestNightlyCount();
const sha = getShortSha();
return `v${version}-nightly.${date}.${sha}`;
return `v${nextVersion}-nightly.${nightlyCount}`;
}
export function getReleaseVersion() {
@@ -72,7 +96,13 @@ export function getReleaseVersion() {
const releaseVersion = releaseTag.substring(1);
let npmTag = 'latest';
if (releaseVersion.includes('-')) {
npmTag = releaseVersion.split('-')[1].split('.')[0];
const prereleasePart = releaseVersion.split('-')[1];
npmTag = prereleasePart.split('.')[0];
// Ensure nightly releases use 'nightly' tag, not 'latest'
if (npmTag === 'nightly') {
npmTag = 'nightly';
}
}
return { releaseTag, releaseVersion, npmTag };

View File

@@ -41,15 +41,14 @@ describe('getReleaseVersion', () => {
it('should calculate nightly version when IS_NIGHTLY is true', () => {
process.env.IS_NIGHTLY = 'true';
const knownDate = new Date('2025-07-20T10:00:00.000Z');
vi.setSystemTime(knownDate);
vi.mocked(fs.default.readFileSync).mockReturnValue(
JSON.stringify({ version: '0.1.0' }),
);
vi.mocked(execSync).mockReturnValue('abcdef');
// Mock git tag command to return empty (no existing nightly tags)
vi.mocked(execSync).mockReturnValue('');
const { releaseTag, releaseVersion, npmTag } = getReleaseVersion();
expect(releaseTag).toBe('v0.1.0-nightly.250720.abcdef');
expect(releaseVersion).toBe('0.1.0-nightly.250720.abcdef');
expect(releaseTag).toBe('v0.1.1-nightly.0');
expect(releaseVersion).toBe('0.1.1-nightly.0');
expect(npmTag).toBe('nightly');
});
@@ -99,8 +98,8 @@ describe('getReleaseVersion', () => {
describe('get-release-version script', () => {
it('should print version JSON to stdout when executed directly', () => {
const expectedJson = {
releaseTag: 'v0.1.0-nightly.20250705',
releaseVersion: '0.1.0-nightly.20250705',
releaseTag: 'v0.1.1-nightly.0',
releaseVersion: '0.1.1-nightly.0',
npmTag: 'nightly',
};
execSync.mockReturnValue(JSON.stringify(expectedJson));

View File

@@ -23,18 +23,24 @@ function writeJson(filePath, data) {
writeFileSync(filePath, JSON.stringify(data, null, 2) + '\n');
}
// 1. Get the version type from the command line arguments.
const versionType = process.argv[2];
if (!versionType) {
console.error('Error: No version type specified.');
console.error('Usage: npm run version <patch|minor|major|prerelease>');
// 1. Get the version from the command line arguments.
const versionArg = process.argv[2];
if (!versionArg) {
console.error('Error: No version specified.');
console.error(
'Usage: npm run version <version> (e.g., 1.2.3 or patch|minor|major|prerelease)',
);
process.exit(1);
}
// 2. Bump the version in the root and all workspace package.json files.
run(`npm version ${versionType} --no-git-tag-version --allow-same-version`);
// 2. Determine if we have a specific version or a version type
const isSpecificVersion = /^\d+\.\d+\.\d+/.test(versionArg);
const npmVersionArg = isSpecificVersion ? versionArg : versionArg;
// 3. Bump the version in the root and all workspace package.json files.
run(`npm version ${npmVersionArg} --no-git-tag-version --allow-same-version`);
run(
`npm version ${versionType} --workspaces --no-git-tag-version --allow-same-version`,
`npm version ${npmVersionArg} --workspaces --no-git-tag-version --allow-same-version`,
);
// 3. Get the new version number from the root package.json