Skip to content

Commit 9f65bd3

Browse files
authored
Merge pull request #1325 from QwenLM/mingholy/chore/revert-sdk-version
chore: revert sdk-typescript version to 0.1.0 and update release workflow
2 parents 2b3830c + 2b91409 commit 9f65bd3

File tree

3 files changed

+53
-5
lines changed

3 files changed

+53
-5
lines changed

.github/workflows/release-sdk.yml

Lines changed: 51 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ on:
3333
type: 'boolean'
3434
default: false
3535

36+
concurrency:
37+
group: '${{ github.workflow }}'
38+
cancel-in-progress: false
39+
3640
jobs:
3741
release-sdk:
3842
runs-on: 'ubuntu-latest'
@@ -46,6 +50,7 @@ jobs:
4650
packages: 'write'
4751
id-token: 'write'
4852
issues: 'write'
53+
pull-requests: 'write'
4954
outputs:
5055
RELEASE_TAG: '${{ steps.version.outputs.RELEASE_TAG }}'
5156

@@ -163,19 +168,19 @@ jobs:
163168
echo "BRANCH_NAME=${BRANCH_NAME}" >> "${GITHUB_OUTPUT}"
164169
165170
- name: 'Update package version'
166-
working-directory: 'packages/sdk-typescript'
167171
env:
168172
RELEASE_VERSION: '${{ steps.version.outputs.RELEASE_VERSION }}'
169173
run: |-
170-
npm version "${RELEASE_VERSION}" --no-git-tag-version --allow-same-version
174+
# Use npm workspaces so the root lockfile is updated consistently.
175+
npm version -w @qwen-code/sdk "${RELEASE_VERSION}" --no-git-tag-version --allow-same-version
171176
172177
- name: 'Commit and Conditionally Push package version'
173178
env:
174179
BRANCH_NAME: '${{ steps.release_branch.outputs.BRANCH_NAME }}'
175180
IS_DRY_RUN: '${{ steps.vars.outputs.is_dry_run }}'
176181
RELEASE_TAG: '${{ steps.version.outputs.RELEASE_TAG }}'
177182
run: |-
178-
git add packages/sdk-typescript/package.json
183+
git add packages/sdk-typescript/package.json package-lock.json
179184
if git diff --staged --quiet; then
180185
echo "No version changes to commit"
181186
else
@@ -222,6 +227,49 @@ jobs:
222227
--notes-start-tag "sdk-typescript-${PREVIOUS_RELEASE_TAG}" \
223228
--generate-notes
224229
230+
- name: 'Create PR to merge release branch into main'
231+
if: |-
232+
${{ steps.vars.outputs.is_dry_run == 'false' }}
233+
id: 'pr'
234+
env:
235+
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
236+
RELEASE_BRANCH: '${{ steps.release_branch.outputs.BRANCH_NAME }}'
237+
RELEASE_TAG: '${{ steps.version.outputs.RELEASE_TAG }}'
238+
run: |-
239+
set -euo pipefail
240+
241+
pr_url="$(gh pr list --head "${RELEASE_BRANCH}" --base main --json url --jq '.[0].url')"
242+
if [[ -z "${pr_url}" ]]; then
243+
pr_url="$(gh pr create \
244+
--base main \
245+
--head "${RELEASE_BRANCH}" \
246+
--title "chore(release): sdk-typescript ${RELEASE_TAG}" \
247+
--body "Automated release PR for sdk-typescript ${RELEASE_TAG}.")"
248+
fi
249+
250+
echo "PR_URL=${pr_url}" >> "${GITHUB_OUTPUT}"
251+
252+
- name: 'Wait for CI checks to complete'
253+
if: |-
254+
${{ steps.vars.outputs.is_dry_run == 'false' }}
255+
env:
256+
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
257+
PR_URL: '${{ steps.pr.outputs.PR_URL }}'
258+
run: |-
259+
set -euo pipefail
260+
echo "Waiting for CI checks to complete..."
261+
gh pr checks "${PR_URL}" --watch --interval 30
262+
263+
- name: 'Enable auto-merge for release PR'
264+
if: |-
265+
${{ steps.vars.outputs.is_dry_run == 'false' }}
266+
env:
267+
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
268+
PR_URL: '${{ steps.pr.outputs.PR_URL }}'
269+
run: |-
270+
set -euo pipefail
271+
gh pr merge "${PR_URL}" --merge --auto
272+
225273
- name: 'Create Issue on Failure'
226274
if: |-
227275
${{ failure() }}

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/sdk-typescript/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@qwen-code/sdk",
3-
"version": "0.6.0",
3+
"version": "0.1.0",
44
"description": "TypeScript SDK for programmatic access to qwen-code CLI",
55
"main": "./dist/index.cjs",
66
"module": "./dist/index.mjs",

0 commit comments

Comments
 (0)