Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
65076eb
ci(desktop): publish the desktop app when the CLI releases
yiliang114 Sep 10, 2026
956b0b8
ci(desktop): fix release-following gates so the desktop publish runs
yiliang114 Sep 11, 2026
2b01523
Merge remote-tracking branch 'origin/main' into prmerge-11575
yiliang114 Sep 11, 2026
a11675f
fix(ci): run prettier on desktop-oss workflow test
yiliang114 Sep 11, 2026
412ecfa
test(ci): tighten desktop release sync workflow assertions
yiliang114 Sep 11, 2026
668ef60
test(ci): pin cancel-in-progress false in desktop-oss workflow test
yiliang114 Sep 11, 2026
7c89930
ci(desktop): say what the release arm's ancestry check establishes
yiliang114 Sep 14, 2026
11754dc
Merge main and reclaim the desktop-release size baseline
yiliang114 Sep 14, 2026
9419b3a
ci(desktop): name the operand the ancestry guard actually checks
yiliang114 Sep 14, 2026
7f62b95
Merge remote-tracking branch 'origin/main' into fix-11575-wording
yiliang114 Sep 14, 2026
491cea9
test(ci): pin that the release arm emits the tag commit, not its parent
yiliang114 Sep 14, 2026
f96a12a
fix(ci): thread the release signal into the desktop release callees
yiliang114 Sep 14, 2026
091b90f
Merge origin/main into ci/desktop-follow-cli-release
yiliang114 Sep 14, 2026
359a079
fix(ci): gate the desktop publish job and correct the peel comment
yiliang114 Sep 14, 2026
ab9cdb0
docs(ci): record the manual route for a tag the ancestry check rejects
yiliang114 Sep 14, 2026
6b76f73
ci(desktop): report a release-following publish that never happened
yiliang114 Sep 14, 2026
c37db89
chore(ci): record the sync caller's new size in the workflow baseline
yiliang114 Sep 14, 2026
74dba5d
fix(ci): correct the desktop failure reporter's runbook text and chec…
yiliang114 Sep 15, 2026
11966e7
chore(ci): retrigger the lint gate after a reverted foreign push froz…
yiliang114 Sep 15, 2026
a7eb6fc
Merge remote-tracking branch 'origin/main' into HEAD
yiliang114 Sep 15, 2026
433782c
Merge remote-tracking branch 'origin/main' into HEAD
yiliang114 Sep 15, 2026
0428a35
Merge remote-tracking branch 'origin/main' into HEAD
yiliang114 Sep 15, 2026
81cd523
Merge remote-tracking branch 'origin/main' into ci/desktop-follow-cli…
yiliang114 Sep 15, 2026
416249d
ci(desktop): handle release events in one workflow
yiliang114 Sep 15, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/.size-baseline
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
1482 codeql.yml
9389 comment-attachment-guard.yml
1634 desktop-packaging-check.yml
1936 desktop-release-sync.yml
31677 desktop-release.yml
2038 docs-page-action.yml
10005 dsw-swe-verified-release.yml
Expand Down
55 changes: 55 additions & 0 deletions .github/workflows/desktop-release-sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: 'Desktop Release Sync'

run-name: 'Desktop release following ${{ github.event.release.tag_name }}'

# Publishes the desktop app whenever a stable Qwen Code release is published,
# the way the VS Code companion already follows the CLI.
#
# The desktop app is a shell around the CLI, so its useful version is whichever
# CLI it carries. Following the release event gives it that number for free and
# removes the question of when to cut a desktop release: the answer becomes the
# same as for the CLI.
#
# Three gates, mirroring release-vscode-companion.yml:
#
# - the repository variable below, so this can be stopped without a code change
# - the `v` prefix, so `desktop-v*`, `sdk-typescript-v*` and the other release
# series in this repository do not trigger it
# - stable only, so nightlies and previews do not reach users
#
# The variable is opt-IN rather than opt-out, unlike the VS Code one. A desktop
# release is a push: publishing moves the updater feed, and every installation
# follows within a day. That is worth turning on deliberately, after watching a
# few releases build without publishing.
on:
release:
types: ['published']

permissions:
actions: 'read'
contents: 'write'

concurrency:
group: 'desktop-release-sync'
cancel-in-progress: false

jobs:
publish:
name: 'Publish desktop for ${{ github.event.release.tag_name }}'
if: |-
${{
github.repository == 'QwenLM/qwen-code' &&
vars.RELEASE_DESKTOP_SYNC_PUBLISH == 'true' &&
startsWith(github.event.release.tag_name, 'v') &&
Comment thread
yiliang114 marked this conversation as resolved.
Resolved
github.event.release.prerelease == false
}}
uses: './.github/workflows/desktop-release.yml'
with:
version: '${{ github.event.release.tag_name }}'
qwen_code_ref: '${{ github.event.release.tag_name }}'
electron_bridge: false
dry_run: false
draft: false
prerelease: false
clobber: false
secrets: 'inherit'
16 changes: 12 additions & 4 deletions .github/workflows/desktop-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,20 @@ jobs:
git fetch origin "$INPUT_REF"
sha="$(git rev-parse FETCH_HEAD)"
if [ "$IS_DRY_RUN" = 'false' ]; then
if [ "$GITHUB_REF_NAME" != 'main' ]; then
echo '::error::Published desktop releases must run from main.'
if [ "$GITHUB_REF_NAME" != 'main' ] && [ "$GITHUB_EVENT_NAME" != 'release' ]; then
Comment thread
yiliang114 marked this conversation as resolved.
Resolved
echo '::error::Published desktop releases must run from main or follow a published release.'
exit 1
fi
# A release tag points at the version-bump commit on release/<tag>,
# which is squash-merged back to main as a different commit and so
# is never reachable from main. Its parent is the main commit the
# release was cut from, so check that on the release arm.
ancestor="$sha"
if [ "$GITHUB_EVENT_NAME" = 'release' ]; then
ancestor="$(git rev-parse "${sha}^")"
Comment thread
yiliang114 marked this conversation as resolved.
Resolved
fi
git fetch origin main:refs/remotes/origin/main
if ! git merge-base --is-ancestor "$sha" refs/remotes/origin/main; then
if ! git merge-base --is-ancestor "$ancestor" refs/remotes/origin/main; then
echo '::error::Published desktop releases may only bundle commits reachable from main.'
exit 1
fi
Expand Down Expand Up @@ -738,7 +746,7 @@ jobs:

sync-oss:
name: 'Mirror stable Desktop release to Aliyun OSS'
if: "${{ github.event_name == 'workflow_dispatch' && inputs.dry_run == false && inputs.draft == false && inputs.prerelease == false && github.repository == 'QwenLM/qwen-code' }}"
if: "${{ (github.event_name == 'workflow_dispatch' || github.event_name == 'release') && inputs.dry_run == false && inputs.draft == false && inputs.prerelease == false && github.repository == 'QwenLM/qwen-code' }}"
Comment thread
yiliang114 marked this conversation as resolved.
Resolved
needs:
- 'prepare'
- 'build'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sync-desktop-to-oss.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ concurrency:
jobs:
sync:
name: 'Mirror Qwen Code Desktop to Aliyun OSS'
if: "${{ github.repository == 'QwenLM/qwen-code' && github.ref == 'refs/heads/main' }}"
if: "${{ github.repository == 'QwenLM/qwen-code' && (github.ref == 'refs/heads/main' || github.event_name == 'release') }}"
runs-on: 'ubuntu-latest'
timeout-minutes: 90
environment:
Expand Down
91 changes: 90 additions & 1 deletion scripts/tests/desktop-oss-workflow.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ const syncWorkflow = readFileSync(
'.github/workflows/sync-desktop-to-oss.yml',
'utf8',
);
const syncCallerWorkflow = readFileSync(
'.github/workflows/desktop-release-sync.yml',
'utf8',
);
const tauriConfig = JSON.parse(
readFileSync('packages/desktop-shell/src-tauri/tauri.conf.json', 'utf8'),
);
Expand All @@ -42,7 +46,7 @@ describe('Desktop OSS mirror workflow', () => {

const syncOss = getWorkflowJob(releaseWorkflow, 'sync-oss');
expect(syncOss).toContain(
"if: \"${{ github.event_name == 'workflow_dispatch' && inputs.dry_run == false && inputs.draft == false && inputs.prerelease == false && github.repository == 'QwenLM/qwen-code' }}\"",
"if: \"${{ (github.event_name == 'workflow_dispatch' || github.event_name == 'release') && inputs.dry_run == false && inputs.draft == false && inputs.prerelease == false && github.repository == 'QwenLM/qwen-code' }}\"",
);
expect(syncOss).toContain("- 'publish'");
expect(syncOss).toContain("source: 'artifact'");
Expand Down Expand Up @@ -154,4 +158,89 @@ describe('Desktop OSS mirror workflow', () => {
const firstEndpoint = tauriConfig.plugins.updater.endpoints[0];
expect(syncWorkflow).toContain(new URL(firstEndpoint).origin);
});

it('admits the release path in the reusable sync job gate', () => {
const sync = getWorkflowJob(syncWorkflow, 'sync');
expect(sync).toContain(
"if: \"${{ github.repository == 'QwenLM/qwen-code' && (github.ref == 'refs/heads/main' || github.event_name == 'release') }}\"",
);
});

it('resolves the release tag parent before the main ancestry check', () => {
Comment thread
yiliang114 marked this conversation as resolved.
Resolved
Comment thread
yiliang114 marked this conversation as resolved.
Resolved
const source = getWorkflowStep(
getWorkflowJob(releaseWorkflow, 'prepare'),
'Resolve Qwen Code source',
);
expect(source).toContain(
'if [ "$GITHUB_REF_NAME" != \'main\' ] && [ "$GITHUB_EVENT_NAME" != \'release\' ]; then',
);
expect(source).toContain(
'::error::Published desktop releases must run from main or follow a published release.',
);
expect(source).toContain('ancestor="$sha"');
expect(source).toContain('if [ "$GITHUB_EVENT_NAME" = \'release\' ]; then');
Comment thread
yiliang114 marked this conversation as resolved.
Resolved
expect(source).toContain('ancestor="$(git rev-parse "${sha}^")"');
expect(source).toContain(
'git merge-base --is-ancestor "$ancestor" refs/remotes/origin/main',
);
expect(
source.indexOf('ancestor="$(git rev-parse "${sha}^")"'),
).toBeGreaterThan(source.indexOf('ancestor="$sha"'));
expect(
source.indexOf('ancestor="$(git rev-parse "${sha}^")"'),
).toBeLessThan(source.indexOf('git merge-base --is-ancestor "$ancestor"'));
});
});

describe('Desktop release sync caller', () => {
it('gates the release-following publish on the CLI release signal', () => {
expect(syncCallerWorkflow).toContain("release:\n types: ['published']");
const publish = getWorkflowJob(syncCallerWorkflow, 'publish');
expect(publish).toContain("github.repository == 'QwenLM/qwen-code'");
expect(publish).toContain("vars.RELEASE_DESKTOP_SYNC_PUBLISH == 'true'");
Comment thread
yiliang114 marked this conversation as resolved.
Resolved
Comment thread
yiliang114 marked this conversation as resolved.
Resolved
expect(publish).toContain("startsWith(github.event.release.tag_name, 'v')");
expect(publish).toContain('github.event.release.prerelease == false');
expect(publish).toContain(
"github.repository == 'QwenLM/qwen-code' &&\n" +
" vars.RELEASE_DESKTOP_SYNC_PUBLISH == 'true' &&\n" +
" startsWith(github.event.release.tag_name, 'v') &&\n" +
' github.event.release.prerelease == false',
);
for (const withValue of [
"version: '${{ github.event.release.tag_name }}'",
"qwen_code_ref: '${{ github.event.release.tag_name }}'",
'electron_bridge: false',
'dry_run: false',
'draft: false',
'prerelease: false',
'clobber: false',
]) {
expect(publish).toContain(withValue);
}
expect(publish).toContain(
"uses: './.github/workflows/desktop-release.yml'",
);
expect(publish).toContain("secrets: 'inherit'");
});

it('uses a concurrency group distinct from the callee publish group', () => {
const calleeFallback =
/group: "desktop-release-\$\{\{[^}]*\|\| '([^']+)' \}\}"/.exec(
releaseWorkflow,
)?.[1];
expect(calleeFallback).toBe('publish');
Comment thread
yiliang114 marked this conversation as resolved.
Resolved
expect(syncCallerWorkflow).toContain("group: 'desktop-release-sync'");
expect(syncCallerWorkflow).toContain(
"concurrency:\n group: 'desktop-release-sync'\n cancel-in-progress: false",
);
expect(`desktop-release-${calleeFallback}`).not.toBe(
'desktop-release-sync',
);
});

it('keeps the caller permissions to actions read and contents write', () => {
expect(syncCallerWorkflow).toContain(
"permissions:\n actions: 'read'\n contents: 'write'",
);
});
});
Loading