chore: fix lint errors for shell scripts and yaml files

This commit is contained in:
tanzhenxin
2025-08-22 11:35:35 +08:00
parent 0ba0d27941
commit 0f3db5275f
11 changed files with 195 additions and 213 deletions

View File

@@ -1,69 +1,69 @@
# .aoneci/workflows/ci.yml # .aoneci/workflows/ci.yml
name: Qwen Code CI name: 'Qwen Code CI'
triggers: triggers:
push: push:
branches: [main, dev, integration] branches: ['main', 'dev', 'integration']
merge_request: merge_request:
jobs: jobs:
build: build:
name: Build and Lint name: 'Build and Lint'
steps: steps:
- uses: checkout - uses: 'checkout'
- uses: setup-env - uses: 'setup-env'
inputs: inputs:
node-version: '20' node-version: '20'
- name: Install dependencies - name: 'Install dependencies'
run: npm ci run: 'npm ci'
- name: Run formatter check - name: 'Run formatter check'
run: | run: |
npm run format npm run format
git diff --exit-code git diff --exit-code
- name: Run linter - name: 'Run linter'
run: npm run lint:ci run: 'npm run lint:ci'
- name: Build project - name: 'Build project'
run: npm run build run: 'npm run build'
- name: Run type check - name: 'Run type check'
run: npm run typecheck run: 'npm run typecheck'
- name: Upload build artifacts - name: 'Upload build artifacts'
uses: upload-artifact uses: 'upload-artifact'
inputs: inputs:
name: build-artifacts-20 name: 'build-artifacts-20'
path: | path: |
packages/*/dist/**/* packages/*/dist/**/*
package-lock.json package-lock.json
test: test:
name: Test name: 'Test'
needs: build # This job depends on the 'build' job needs: 'build' # This job depends on the 'build' job
steps: steps:
- uses: checkout - uses: 'checkout'
- uses: setup-env - uses: 'setup-env'
inputs: inputs:
node-version: '20' node-version: '20'
- uses: download-artifact - uses: 'download-artifact'
inputs: inputs:
name: build-artifacts-20 name: 'build-artifacts-20'
path: . path: '.'
- name: Install dependencies for testing - name: 'Install dependencies for testing'
run: npm ci run: 'npm ci'
- name: Run tests and generate reports - name: 'Run tests and generate reports'
run: NO_COLOR=true npm run test:ci run: 'NO_COLOR=true npm run test:ci'
- name: Upload coverage reports - name: 'Upload coverage reports'
uses: upload-artifact uses: 'upload-artifact'
inputs: inputs:
name: coverage-reports-20 name: 'coverage-reports-20'
path: packages/*/coverage path: 'packages/*/coverage'

View File

@@ -1,5 +1,5 @@
name: Bug Report name: 'Bug Report'
description: Report a bug to help us improve Qwen Code description: 'Report a bug to help us improve Qwen Code'
labels: ['kind/bug', 'status/need-triage'] labels: ['kind/bug', 'status/need-triage']
body: body:
- type: 'markdown' - type: 'markdown'
@@ -28,8 +28,8 @@ body:
- type: 'textarea' - type: 'textarea'
id: 'info' id: 'info'
attributes: attributes:
label: Client information label: 'Client information'
description: Please paste the full text from the `/about` command run from Qwen Code. 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: | value: |
<details> <details>
@@ -45,8 +45,8 @@ body:
- type: 'textarea' - type: 'textarea'
id: 'login-info' id: 'login-info'
attributes: attributes:
label: Login information label: 'Login information'
description: Describe how you are logging in (e.g., API Config). description: 'Describe how you are logging in (e.g., API Config).'
- type: 'textarea' - type: 'textarea'
id: 'additional-context' id: 'additional-context'

View File

@@ -1,4 +1,4 @@
name: Build and Publish Docker Image name: 'Build and Publish Docker Image'
on: on:
push: push:
@@ -8,35 +8,35 @@ on:
inputs: inputs:
publish: publish:
description: 'Publish to GHCR (only works on main branch)' description: 'Publish to GHCR (only works on main branch)'
type: boolean type: 'boolean'
default: false default: false
env: env:
REGISTRY: ghcr.io REGISTRY: 'ghcr.io'
IMAGE_NAME: ${{ github.repository }} IMAGE_NAME: '${{ github.repository }}'
jobs: jobs:
build-and-push-to-ghcr: build-and-push-to-ghcr:
runs-on: ubuntu-latest runs-on: 'ubuntu-latest'
permissions: permissions:
contents: read contents: 'read'
packages: write packages: 'write'
steps: steps:
- name: Checkout repository - name: 'Checkout repository'
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 uses: 'actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683' # v4
- name: Set up QEMU - name: 'Set up QEMU'
uses: docker/setup-qemu-action@v3 uses: 'docker/setup-qemu-action@v3'
- name: Set up Docker Buildx - name: 'Set up Docker Buildx'
uses: docker/setup-buildx-action@v3 uses: 'docker/setup-buildx-action@v3'
- name: Extract metadata (tags, labels) for Docker - name: 'Extract metadata (tags, labels) for Docker'
id: meta id: 'meta'
uses: docker/metadata-action@v5 uses: 'docker/metadata-action@v5'
with: with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} images: '${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}'
tags: | tags: |
type=ref,event=branch type=ref,event=branch
type=ref,event=pr type=ref,event=pr
@@ -44,22 +44,22 @@ jobs:
type=semver,pattern={{major}}.{{minor}} type=semver,pattern={{major}}.{{minor}}
type=sha,prefix=sha-,format=short type=sha,prefix=sha-,format=short
- name: Log in to the Container registry - name: 'Log in to the Container registry'
if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')) if: 'github.event_name != "pull_request" && (github.ref == "refs/heads/main" || startsWith(github.ref, "refs/tags/v"))'
uses: docker/login-action@v3 uses: 'docker/login-action@v3'
with: with:
registry: ${{ env.REGISTRY }} registry: '${{ env.REGISTRY }}'
username: ${{ github.actor }} username: '${{ github.actor }}'
password: ${{ secrets.GITHUB_TOKEN }} password: '${{ secrets.GITHUB_TOKEN }}'
- name: Build and push Docker image - name: 'Build and push Docker image'
id: build-and-push id: 'build-and-push'
uses: docker/build-push-action@v6 uses: 'docker/build-push-action@v6'
with: with:
context: . context: '.'
platforms: linux/amd64,linux/arm64 platforms: 'linux/amd64,linux/arm64'
push: ${{ github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') || github.event.inputs.publish == 'true') }} push: '${{ github.event_name != "pull_request" && (github.ref == "refs/heads/main" || startsWith(github.ref, "refs/tags/v") || github.event.inputs.publish == "true") }}'
tags: ${{ steps.meta.outputs.tags }} tags: '${{ steps.meta.outputs.tags }}'
labels: ${{ steps.meta.outputs.labels }} labels: '${{ steps.meta.outputs.labels }}'
build-args: | build-args: |
CLI_VERSION_ARG=${{ github.sha }} CLI_VERSION_ARG=${{ github.sha }}

View File

@@ -1,6 +1,6 @@
# .github/workflows/ci.yml # .github/workflows/ci.yml
name: Qwen Code CI name: 'Qwen Code CI'
on: on:
push: push:

View File

@@ -54,8 +54,8 @@ jobs:
- name: 'Run E2E tests' - name: 'Run E2E tests'
env: env:
OPENAI_API_KEY: '${{ secrets.OPENAI_API_KEY }}' OPENAI_API_KEY: '${{ secrets.OPENAI_API_KEY }}'
OPENAI_BASE_URL: ${{ secrets.OPENAI_BASE_URL }} OPENAI_BASE_URL: '${{ secrets.OPENAI_BASE_URL }}'
OPENAI_MODEL: ${{ secrets.OPENAI_MODEL }} OPENAI_MODEL: '${{ secrets.OPENAI_MODEL }}'
KEEP_OUTPUT: 'true' KEEP_OUTPUT: 'true'
SANDBOX: '${{ matrix.sandbox }}' SANDBOX: '${{ matrix.sandbox }}'
VERBOSE: 'true' VERBOSE: 'true'
@@ -85,7 +85,7 @@ jobs:
- name: 'Run E2E tests' - name: 'Run E2E tests'
env: env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} OPENAI_API_KEY: '${{ secrets.OPENAI_API_KEY }}'
OPENAI_BASE_URL: ${{ secrets.OPENAI_BASE_URL }} OPENAI_BASE_URL: '${{ secrets.OPENAI_BASE_URL }}'
OPENAI_MODEL: ${{ secrets.OPENAI_MODEL }} OPENAI_MODEL: '${{ secrets.OPENAI_MODEL }}'
run: npm run test:e2e run: 'npm run test:e2e'

View File

@@ -1,4 +1,4 @@
name: Qwen Automated Issue Triage name: 'Qwen Automated Issue Triage'
on: on:
issues: issues:
@@ -33,19 +33,20 @@ permissions:
jobs: jobs:
triage-issue: triage-issue:
timeout-minutes: 5 timeout-minutes: 5
if: ${{ github.repository == 'QwenLM/qwen-code' }} if: '${{ github.repository == "QwenLM/qwen-code" }}'
runs-on: ubuntu-latest runs-on: 'ubuntu-latest'
steps: steps:
- name: Run Qwen Issue Triage - name: 'Run Qwen Issue Analysis'
uses: QwenLM/qwen-code-action@5fd6818d04d64e87d255ee4d5f77995e32fbf4c2 uses: 'QwenLM/qwen-code-action@5fd6818d04d64e87d255ee4d5f77995e32fbf4c2'
id: 'qwen_issue_analysis'
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
ISSUE_TITLE: ${{ github.event.issue.title }} ISSUE_TITLE: '${{ github.event.issue.title }}'
ISSUE_BODY: ${{ github.event.issue.body }} ISSUE_BODY: '${{ github.event.issue.body }}'
with: with:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} OPENAI_API_KEY: '${{ secrets.OPENAI_API_KEY }}'
OPENAI_BASE_URL: ${{ secrets.OPENAI_BASE_URL }} OPENAI_BASE_URL: '${{ secrets.OPENAI_BASE_URL }}'
OPENAI_MODEL: ${{ secrets.OPENAI_MODEL }} OPENAI_MODEL: '${{ secrets.OPENAI_MODEL }}'
settings_json: | settings_json: |
{ {
"maxSessionTurns": 25, "maxSessionTurns": 25,
@@ -65,11 +66,11 @@ jobs:
## Steps ## Steps
1. Run: `gh label list --repo "${REPOSITORY}" --limit 100` to get all available labels. 1. Run: `gh label list --repo ${{ github.repository }} --limit 100` to get all available labels.
2. Use right tool to review the issue title and body provided in the environment variables: "${ISSUE_TITLE}" and "${ISSUE_BODY}". 2. Use right tool to review the issue title and body provided in the environment variables: "${ISSUE_TITLE}" and "${ISSUE_BODY}".
3. Ignore any existing priorities or tags on the issue. Just report your findings. 3. Ignore any existing priorities or tags on the issue. Just report your findings.
4. Select the most relevant labels from the existing labels, focusing on kind/*, area/*, sub-area/* and priority/*. For area/* and kind/* limit yourself to only the single most applicable label in each case. 4. Select the most relevant labels from the existing labels, focusing on kind/*, area/*, sub-area/* and priority/*. For area/* and kind/* limit yourself to only the single most applicable label in each case.
6. Apply the selected labels to this issue using: `gh issue edit "${ISSUE_NUMBER}" --repo "${REPOSITORY}" --add-label "label1,label2"`. 6. Apply the selected labels to this issue using: `gh issue edit ${{ github.event.issue.number }} --repo ${{ github.repository }} --add-label "label1,label2"`.
7. For each issue please check if CLI version is present, this is usually in the output of the /about command and will look like 0.1.5 for anything more than 6 versions older than the most recent should add the status/need-retesting label. 7. For each issue please check if CLI version is present, this is usually in the output of the /about command and will look like 0.1.5 for anything more than 6 versions older than the most recent should add the status/need-retesting label.
8. If you see that the issue doesn't look like it has sufficient information recommend the status/need-information label. 8. If you see that the issue doesn't look like it has sufficient information recommend the status/need-information label.
9. Use Area definitions mentioned below to help you narrow down issues. 9. Use Area definitions mentioned below to help you narrow down issues.
@@ -160,19 +161,20 @@ jobs:
- other general software performance like, memory usage, CPU consumption, and algorithmic efficiency. - other general software performance like, memory usage, CPU consumption, and algorithmic efficiency.
- Switching models from one to the other unexpectedly. - Switching models from one to the other unexpectedly.
- name: 'Post Issue Triage Failure Comment' - name: 'Post Issue Analysis Failure Comment'
if: |- if: |-
${{ failure() && steps.gemini_issue_triage.outcome == 'failure' }} ${{ failure() && steps.qwen_issue_analysis.outcome == 'failure' }}
uses: 'actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea' # ratchet:actions/github-script@v7 uses: 'actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea' # ratchet:actions/github-script@v7
env: env:
ISSUE_NUMBER: '${{ github.event.issue.number }}'
REPOSITORY: '${{ github.repository }}' REPOSITORY: '${{ github.repository }}'
RUN_URL: '${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}' RUN_URL: '${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}'
with: with:
github-token: '${{ steps.generate_token.outputs.token }}' github-token: '${{ secrets.GITHUB_TOKEN }}'
script: |- script: |-
github.rest.issues.createComment({ github.rest.issues.createComment({
owner: process.env.REPOSITORY.split('/')[0], owner: process.env.REPOSITORY.split('/')[0],
repo: process.env.REPOSITORY.split('/')[1], repo: process.env.REPOSITORY.split('/')[1],
issue_number: '${{ github.event.issue.number }}', issue_number: parseInt(process.env.ISSUE_NUMBER),
body: 'There is a problem with the Qwen Code issue triaging. Please check the [action logs](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) for details.' body: 'There is a problem with the Qwen Code issue analysis. Please check the [action logs](${process.env.RUN_URL}) for details.'
}) })

View File

@@ -1,4 +1,4 @@
name: Qwen Scheduled Issue Triage name: 'Qwen Scheduled Issue Triage'
on: on:
schedule: schedule:
@@ -23,17 +23,18 @@ permissions:
jobs: jobs:
triage-issues: triage-issues:
timeout-minutes: 10 timeout-minutes: 10
if: ${{ github.repository == 'QwenLM/qwen-code' }} if: '${{ github.repository == "QwenLM/qwen-code" }}'
runs-on: ubuntu-latest runs-on: 'ubuntu-latest'
permissions: permissions:
contents: read contents: 'read'
id-token: write id-token: 'write'
issues: write issues: 'write'
steps: steps:
- name: Find untriaged issues - name: 'Find untriaged issues'
id: find_issues id: 'find_issues'
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
GITHUB_REPOSITORY: '${{ github.repository }}'
run: | run: |
echo "🔍 Finding issues without labels..." echo "🔍 Finding issues without labels..."
NO_LABEL_ISSUES=$(gh issue list --repo ${{ github.repository }} --search "is:open is:issue no:label" --json number,title,body) NO_LABEL_ISSUES=$(gh issue list --repo ${{ github.repository }} --search "is:open is:issue no:label" --json number,title,body)
@@ -52,17 +53,17 @@ jobs:
echo '📝 Setting output for GitHub Actions...' echo '📝 Setting output for GitHub Actions...'
echo "issues_to_triage=${ISSUES}" >> "${GITHUB_OUTPUT}" echo "issues_to_triage=${ISSUES}" >> "${GITHUB_OUTPUT}"
- name: Run Qwen Issue Triage - name: 'Run Qwen Issue Triage'
if: steps.find_issues.outputs.issues_to_triage != '[]' if: 'steps.find_issues.outputs.issues_to_triage != "[]"'
uses: QwenLM/qwen-code-action@5fd6818d04d64e87d255ee4d5f77995e32fbf4c2 uses: 'QwenLM/qwen-code-action@5fd6818d04d64e87d255ee4d5f77995e32fbf4c2'
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
ISSUES_TO_TRIAGE: ${{ steps.find_issues.outputs.issues_to_triage }} ISSUES_TO_TRIAGE: '${{ steps.find_issues.outputs.issues_to_triage }}'
REPOSITORY: ${{ github.repository }} REPOSITORY: '${{ github.repository }}'
with: with:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} OPENAI_API_KEY: '${{ secrets.OPENAI_API_KEY }}'
OPENAI_BASE_URL: ${{ secrets.OPENAI_BASE_URL }} OPENAI_BASE_URL: '${{ secrets.OPENAI_BASE_URL }}'
OPENAI_MODEL: ${{ secrets.OPENAI_MODEL }} OPENAI_MODEL: '${{ secrets.OPENAI_MODEL }}'
settings_json: | settings_json: |
{ {
"maxSessionTurns": 25, "maxSessionTurns": 25,
@@ -84,28 +85,28 @@ jobs:
## Steps ## Steps
1. Run: `gh label list --repo "${REPOSITORY}" --limit 100` to get all available labels. 1. Run: `gh label list --repo ${{ github.repository }} --limit 100` to get all available labels.
2. Use right tool to check environment variable for issues to triage: $ISSUES_TO_TRIAGE (JSON array of issues) 2. Use right tool to check environment variable for issues to triage: $ISSUES_TO_TRIAGE (JSON array of issues)
3. Review the issue title, body and any comments provided in the environment variables. 3. Review the issue title, body and any comments provided in the environment variables.
4. Ignore any existing priorities or tags on the issue. 4. Ignore any existing priorities or tags on the issue.
5. Select the most relevant labels from the existing labels, focusing on kind/*, area/*, sub-area/* and priority/*. 5. Select the most relevant labels from the existing labels, focusing on kind/*, area/*, sub-area/* and priority/*.
6. Get the list of labels already on the issue using `gh issue view ISSUE_NUMBER --repo "${REPOSITORY}" --json labels -t '{{range .labels}}{{.name}}{{"\n"}}{{end}}' 6. Get the list of labels already on the issue using `gh issue view ISSUE_NUMBER --repo ${{ github.repository }} --json labels -t '{{range .labels}}{{.name}}{{"\n"}}{{end}}'
7. For area/* and kind/* limit yourself to only the single most applicable label in each case. 7. For area/* and kind/* limit yourself to only the single most applicable label in each case.
8. Give me a single short paragraph about why you are selecting each label in the process. use the format Issue ID: , Title, Label applied:, Label removed, ovearll explanation 8. Give me a single short paragraph about why you are selecting each label in the process. use the format Issue ID: , Title, Label applied:, Label removed, ovearll explanation
9. Parse the JSON array from step 2 and for EACH INDIVIDUAL issue, apply appropriate labels using separate commands: 9. Parse the JSON array from step 2 and for EACH INDIVIDUAL issue, apply appropriate labels using separate commands:
- `gh issue edit ISSUE_NUMBER --repo "${REPOSITORY}" --add-label "label1"` - `gh issue edit ISSUE_NUMBER --repo ${{ github.repository }} --add-label "label1"`
- `gh issue edit ISSUE_NUMBER --repo "${REPOSITORY}" --add-label "label2"` - `gh issue edit ISSUE_NUMBER --repo ${{ github.repository }} --add-label "label2"`
- Continue for each label separately - Continue for each label separately
- IMPORTANT: Label each issue individually, one command per issue, one label at a time if needed. - IMPORTANT: Label each issue individually, one command per issue, one label at a time if needed.
- Make sure after you apply labels there is only one area/* and one kind/* label per issue. - Make sure after you apply labels there is only one area/* and one kind/* label per issue.
- To do this look for labels found in step 6 that no longer apply remove them one at a time using - To do this look for labels found in step 6 that no longer apply remove them one at a time using
- `gh issue edit ISSUE_NUMBER --repo "${REPOSITORY}" --remove-label "label-name1"` - `gh issue edit ISSUE_NUMBER --repo ${{ github.repository }} --remove-label "label-name1"`
- `gh issue edit ISSUE_NUMBER --repo "${REPOSITORY}" --remove-label "label-name2"` - `gh issue edit ISSUE_NUMBER --repo ${{ github.repository }} --remove-label "label-name2"`
- IMPORTANT: Remove each label one at a time, one command per issue if needed. - IMPORTANT: Remove each label one at a time, one command per issue if needed.
10. For each issue please check if CLI version is present, this is usually in the output of the /about command and will look like 0.1.5 10. For each issue please check if CLI version is present, this is usually in the output of the /about command and will look like 0.1.5
- Anything more than 6 versions older than the most recent should add the status/need-retesting label - Anything more than 6 versions older than the most recent should add the status/need-retesting label
11. If you see that the issue doesn't look like it has sufficient information recommend the status/need-information label 11. If you see that the issue doesn't look like it has sufficient information recommend the status/need-information label
- After applying appropriate labels to an issue, remove the "status/need-triage" label if present: `gh issue edit ISSUE_NUMBER --repo "${REPOSITORY}" --remove-label "status/need-triage"` - After applying appropriate labels to an issue, remove the "status/need-triage" label if present: `gh issue edit ISSUE_NUMBER --repo ${{ github.repository }} --remove-label "status/need-triage"`
- Execute one `gh issue edit` command per issue, wait for success before proceeding to the next - Execute one `gh issue edit` command per issue, wait for success before proceeding to the next
Process each issue sequentially and confirm each labeling operation before moving to the next issue. Process each issue sequentially and confirm each labeling operation before moving to the next issue.

View File

@@ -1,4 +1,4 @@
name: Qwen Scheduled PR Triage 🚀 name: 'Qwen Scheduled PR Triage 🚀'
on: on:
schedule: schedule:
@@ -8,7 +8,7 @@ on:
jobs: jobs:
audit-prs: audit-prs:
timeout-minutes: 15 timeout-minutes: 15
if: ${{ github.repository == 'QwenLM/qwen-code' }} if: '${{ github.repository == "QwenLM/qwen-code" }}'
permissions: permissions:
contents: 'read' contents: 'read'
id-token: 'write' id-token: 'write'
@@ -21,9 +21,9 @@ jobs:
- name: 'Checkout' - name: 'Checkout'
uses: 'actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8' # ratchet:actions/checkout@v5 uses: 'actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8' # ratchet:actions/checkout@v5
- name: Run PR Triage Script - name: 'Run PR Triage Script'
id: run_triage id: 'run_triage'
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
GITHUB_REPOSITORY: ${{ github.repository }} GITHUB_REPOSITORY: '${{ github.repository }}'
run: ./.github/scripts/pr-triage.sh run: './.github/scripts/pr-triage.sh'

View File

@@ -1,18 +1,18 @@
name: 🧐 Qwen Pull Request Review name: '🧐 Qwen Pull Request Review'
on: on:
pull_request_target: pull_request_target:
types: [opened] types: ['opened']
pull_request_review_comment: pull_request_review_comment:
types: [created] types: ['created']
pull_request_review: pull_request_review:
types: [submitted] types: ['submitted']
workflow_dispatch: workflow_dispatch:
inputs: inputs:
pr_number: pr_number:
description: 'PR number to review' description: 'PR number to review'
required: true required: true
type: number type: 'number'
jobs: jobs:
review-pr: review-pr:
@@ -40,24 +40,24 @@ jobs:
github.event.review.author_association == 'MEMBER' || github.event.review.author_association == 'MEMBER' ||
github.event.review.author_association == 'COLLABORATOR')) github.event.review.author_association == 'COLLABORATOR'))
timeout-minutes: 15 timeout-minutes: 15
runs-on: ubuntu-latest runs-on: 'ubuntu-latest'
permissions: permissions:
contents: read contents: 'read'
id-token: write id-token: 'write'
pull-requests: write pull-requests: 'write'
issues: write issues: 'write'
steps: steps:
- name: Checkout PR code - name: 'Checkout PR code'
uses: actions/checkout@v4 uses: 'actions/checkout@v4'
with: with:
token: ${{ secrets.GITHUB_TOKEN }} token: '${{ secrets.GITHUB_TOKEN }}'
fetch-depth: 0 fetch-depth: 0
- name: Get PR details (pull_request_target & workflow_dispatch) - name: 'Get PR details (pull_request_target & workflow_dispatch)'
id: get_pr id: 'get_pr'
if: github.event_name == 'pull_request_target' || github.event_name == 'workflow_dispatch' if: 'github.event_name == "pull_request_target" || github.event_name == "workflow_dispatch"'
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
run: | run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
PR_NUMBER=${{ github.event.inputs.pr_number }} PR_NUMBER=${{ github.event.inputs.pr_number }}
@@ -74,12 +74,12 @@ jobs:
echo "$CHANGED_FILES" >> "$GITHUB_OUTPUT" echo "$CHANGED_FILES" >> "$GITHUB_OUTPUT"
echo "EOF" >> "$GITHUB_OUTPUT" echo "EOF" >> "$GITHUB_OUTPUT"
- name: Get PR details (issue_comment) - name: 'Get PR details (issue_comment)'
id: get_pr_comment id: 'get_pr_comment'
if: github.event_name == 'issue_comment' if: 'github.event_name == "issue_comment"'
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
COMMENT_BODY: ${{ github.event.comment.body }} COMMENT_BODY: '${{ github.event.comment.body }}'
run: | run: |
PR_NUMBER=${{ github.event.issue.number }} PR_NUMBER=${{ github.event.issue.number }}
echo "pr_number=$PR_NUMBER" >> "$GITHUB_OUTPUT" echo "pr_number=$PR_NUMBER" >> "$GITHUB_OUTPUT"
@@ -95,19 +95,19 @@ jobs:
echo "$CHANGED_FILES" >> "$GITHUB_OUTPUT" echo "$CHANGED_FILES" >> "$GITHUB_OUTPUT"
echo "EOF" >> "$GITHUB_OUTPUT" echo "EOF" >> "$GITHUB_OUTPUT"
- name: Run Qwen PR Review - name: 'Run Qwen PR Review'
uses: QwenLM/qwen-code-action@5fd6818d04d64e87d255ee4d5f77995e32fbf4c2 uses: 'QwenLM/qwen-code-action@5fd6818d04d64e87d255ee4d5f77995e32fbf4c2'
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
PR_NUMBER: ${{ steps.get_pr.outputs.pr_number || steps.get_pr_comment.outputs.pr_number }} PR_NUMBER: '${{ steps.get_pr.outputs.pr_number || steps.get_pr_comment.outputs.pr_number }}'
PR_DATA: ${{ steps.get_pr.outputs.pr_data || steps.get_pr_comment.outputs.pr_data }} PR_DATA: '${{ steps.get_pr.outputs.pr_data || steps.get_pr_comment.outputs.pr_data }}'
CHANGED_FILES: ${{ steps.get_pr.outputs.changed_files || steps.get_pr_comment.outputs.changed_files }} CHANGED_FILES: '${{ steps.get_pr.outputs.changed_files || steps.get_pr_comment.outputs.changed_files }}'
ADDITIONAL_INSTRUCTIONS: ${{ steps.get_pr.outputs.additional_instructions || steps.get_pr_comment.outputs.additional_instructions }} ADDITIONAL_INSTRUCTIONS: '${{ steps.get_pr.outputs.additional_instructions || steps.get_pr_comment.outputs.additional_instructions }}'
REPOSITORY: ${{ github.repository }} REPOSITORY: '${{ github.repository }}'
with: with:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} OPENAI_API_KEY: '${{ secrets.OPENAI_API_KEY }}'
OPENAI_BASE_URL: ${{ secrets.OPENAI_BASE_URL }} OPENAI_BASE_URL: '${{ secrets.OPENAI_BASE_URL }}'
OPENAI_MODEL: ${{ secrets.OPENAI_MODEL }} OPENAI_MODEL: '${{ secrets.OPENAI_MODEL }}'
settings_json: | settings_json: |
{ {
"coreTools": [ "coreTools": [

View File

@@ -35,9 +35,9 @@ jobs:
release: release:
runs-on: 'ubuntu-latest' runs-on: 'ubuntu-latest'
environment: environment:
name: production-release name: 'production-release'
url: ${{ github.server_url }}/${{ github.repository }}/releases/tag/${{ steps.version.outputs.RELEASE_TAG }} url: '${{ github.server_url }}/${{ github.repository }}/releases/tag/${{ steps.version.outputs.RELEASE_TAG }}'
if: github.repository == 'QwenLM/qwen-code' if: 'github.repository == "QwenLM/qwen-code"'
permissions: permissions:
contents: 'write' contents: 'write'
packages: 'write' packages: 'write'
@@ -82,34 +82,34 @@ jobs:
run: |- run: |-
npm ci npm ci
- name: Get the version - name: 'Get the version'
id: version id: 'version'
run: | run: |
VERSION_JSON=$(node scripts/get-release-version.js) VERSION_JSON=$(node scripts/get-release-version.js)
echo "RELEASE_TAG=$(echo $VERSION_JSON | jq -r .releaseTag)" >> $GITHUB_OUTPUT echo "RELEASE_TAG=$(echo "$VERSION_JSON" | jq -r .releaseTag)" >> "$GITHUB_OUTPUT"
echo "RELEASE_VERSION=$(echo $VERSION_JSON | jq -r .releaseVersion)" >> $GITHUB_OUTPUT echo "RELEASE_VERSION=$(echo "$VERSION_JSON" | jq -r .releaseVersion)" >> "$GITHUB_OUTPUT"
echo "NPM_TAG=$(echo $VERSION_JSON | jq -r .npmTag)" >> $GITHUB_OUTPUT echo "NPM_TAG=$(echo "$VERSION_JSON" | jq -r .npmTag)" >> "$GITHUB_OUTPUT"
# Get the previous tag for release notes generation # Get the previous tag for release notes generation
CURRENT_TAG=$(echo $VERSION_JSON | jq -r .releaseTag) CURRENT_TAG=$(echo "$VERSION_JSON" | jq -r .releaseTag)
PREVIOUS_TAG=$(node scripts/get-previous-tag.js "$CURRENT_TAG" || echo "") PREVIOUS_TAG=$(node scripts/get-previous-tag.js "$CURRENT_TAG" || echo "")
echo "PREVIOUS_TAG=${PREVIOUS_TAG}" >> $GITHUB_OUTPUT echo "PREVIOUS_TAG=${PREVIOUS_TAG}" >> "$GITHUB_OUTPUT"
env: env:
IS_NIGHTLY: ${{ steps.vars.outputs.is_nightly }} IS_NIGHTLY: '${{ steps.vars.outputs.is_nightly }}'
MANUAL_VERSION: ${{ inputs.version }} MANUAL_VERSION: '${{ inputs.version }}'
- name: Run Tests - name: 'Run Tests'
if: github.event.inputs.force_skip_tests != 'true' if: 'github.event.inputs.force_skip_tests != "true"'
run: | run: |
npm run preflight npm run preflight
npm run test:integration:sandbox:none npm run test:integration:sandbox:none
npm run test:integration:sandbox:docker npm run test:integration:sandbox:docker
env: env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} OPENAI_API_KEY: '${{ secrets.OPENAI_API_KEY }}'
OPENAI_BASE_URL: ${{ secrets.OPENAI_BASE_URL }} OPENAI_BASE_URL: '${{ secrets.OPENAI_BASE_URL }}'
OPENAI_MODEL: ${{ secrets.OPENAI_MODEL }} OPENAI_MODEL: '${{ secrets.OPENAI_MODEL }}'
- name: Configure Git User - name: 'Configure Git User'
run: | run: |
git config user.name "github-actions[bot]" git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com" git config user.email "github-actions[bot]@users.noreply.github.com"
@@ -156,25 +156,25 @@ jobs:
registry-url: 'https://registry.npmjs.org' registry-url: 'https://registry.npmjs.org'
scope: '@qwen-code' scope: '@qwen-code'
- name: Publish @qwen-code/qwen-code-core - 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' || '' }} 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: env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} NODE_AUTH_TOKEN: '${{ secrets.NPM_TOKEN }}'
- name: Install latest core package - name: 'Install latest core package'
if: steps.vars.outputs.is_dry_run == 'false' if: 'steps.vars.outputs.is_dry_run == "false"'
run: npm install @qwen-code/qwen-code-core@${{ steps.version.outputs.RELEASE_VERSION }} --workspace=@qwen-code/qwen-code --save-exact run: 'npm install @qwen-code/qwen-code-core@${{ steps.version.outputs.RELEASE_VERSION }} --workspace=@qwen-code/qwen-code --save-exact'
- name: Publish @qwen-code/qwen-code - 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' || '' }} 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: env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} NODE_AUTH_TOKEN: '${{ secrets.NPM_TOKEN }}'
- name: Create GitHub Release and Tag - name: 'Create GitHub Release and Tag'
if: ${{ steps.vars.outputs.is_dry_run == 'false' }} if: '${{ steps.vars.outputs.is_dry_run == "false" }}'
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
RELEASE_BRANCH: ${{ steps.release_branch.outputs.BRANCH_NAME }} RELEASE_BRANCH: '${{ steps.release_branch.outputs.BRANCH_NAME }}'
run: | run: |
# Build the gh release create command with appropriate options # Build the gh release create command with appropriate options
RELEASE_CMD="gh release create ${{ steps.version.outputs.RELEASE_TAG }} bundle/gemini.js --target \"$RELEASE_BRANCH\" --title \"Release ${{ steps.version.outputs.RELEASE_TAG }}\"" RELEASE_CMD="gh release create ${{ steps.version.outputs.RELEASE_TAG }} bundle/gemini.js --target \"$RELEASE_BRANCH\" --title \"Release ${{ steps.version.outputs.RELEASE_TAG }}\""
@@ -189,7 +189,7 @@ jobs:
fi fi
# Execute the release command # Execute the release command
eval $RELEASE_CMD eval "$RELEASE_CMD"
- name: 'Create Issue on Failure' - name: 'Create Issue on Failure'
if: |- if: |-

View File

@@ -1,21 +0,0 @@
#!/bin/bash
# Build the packages first
npm run build:packages
# Pack CLI package
cd packages/cli && npm pack && cd ../../
# Pack Core package
cd packages/core && npm pack && cd ../../
# Move the tgz files to root directory using absolute paths
cp packages/cli/*.tgz ./
cp packages/core/*.tgz ./
# Remove the original files from package directories
rm packages/cli/*.tgz
rm packages/core/*.tgz
echo "Packages created successfully:"
ls -la *.tgz