Skip to content
22 changes: 22 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,28 @@ jobs:
--notes-file "${NOTES_FILE}" \
${PRERELEASE_FLAG}

- name: 'Trigger ECS runner qwen update'
# Stable releases only: nightly/preview must not move the fleet.
if: |-
${{ github.repository == 'QwenLM/qwen-code' &&
needs.prepare.outputs.is_dry_run == 'false' &&
needs.prepare.outputs.npm_tag == 'latest' }}
# The packages are already published; a dispatch failure must not
# fail the release — warn and let maintainers re-run the update
# workflow manually instead.
continue-on-error: true
env:
GITHUB_TOKEN: '${{ secrets.CI_BOT_PAT }}'
RELEASE_VERSION: '${{ needs.prepare.outputs.release_version }}'
run: |-
gh api "repos/${GITHUB_REPOSITORY}/dispatches" \
--method POST \
-f 'event_type=npm-published' \
-f "client_payload[version]=${RELEASE_VERSION}" || {
echo "::warning::npm-published dispatch failed; run the 'Update ECS Runner Qwen' workflow manually."
exit 1
}

notify_failure:
name: 'Notify Release Failure'
runs-on: 'ubuntu-latest'
Expand Down
15 changes: 14 additions & 1 deletion .github/workflows/update-ecs-runner-qwen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,20 @@ jobs:
# carry a runner user's custom npm prefix into the sudo install.
(
cd "${RUNNER_TEMP:?}"
sudo env -u NPM_CONFIG_PREFIX npm install -g --registry=https://registry.npmjs.org "@qwen-code/qwen-code@${VERSION}"
# All runner processes of a region share one machine, so another
# job's concurrent `npm install -g` can race npm's rename of the
# package dir (ENOTEMPTY). Clear trash left by crashed installs
# and retry through the seconds-long race window.
PKG_DIR='/usr/local/lib/node_modules/@qwen-code'
for attempt in 1 2 3; do
sudo rm -rf "${PKG_DIR}"/.qwen-code-* 2>/dev/null || true
if sudo env -u NPM_CONFIG_PREFIX npm install -g --registry=https://registry.npmjs.org "@qwen-code/qwen-code@${VERSION}"; then
exit 0
fi
echo "::warning::npm install attempt ${attempt} failed; retrying"
sleep $((attempt * 10))
done
exit 1
)

- name: 'Verify version'
Expand Down
Loading