diff --git a/.github/workflows/release-vscode-companion.yml b/.github/workflows/release-vscode-companion.yml index 2e0c4b60e..ea02b01fb 100644 --- a/.github/workflows/release-vscode-companion.yml +++ b/.github/workflows/release-vscode-companion.yml @@ -18,7 +18,7 @@ on: type: 'boolean' default: true create_preview_release: - description: 'Auto apply the preview release tag, input version is ignored.' + description: 'Create a preview release. If version includes -preview., it is used as-is; otherwise a timestamp is appended.' required: false type: 'boolean' default: false @@ -93,10 +93,24 @@ jobs: BASE_VERSION=$(node -p "require('./package.json').version") if [[ "${IS_PREVIEW}" == "true" ]]; then - # Generate preview version with timestamp based on actual package version - TIMESTAMP=$(date +%Y%m%d%H%M%S) - PREVIEW_VERSION="${BASE_VERSION}-preview.${TIMESTAMP}" - RELEASE_TAG="preview.${TIMESTAMP}" + # Generate preview version. If a manual version is provided and already + # contains -preview., use it as-is (no timestamp). Otherwise, append + # a timestamp for uniqueness. + if [[ -n "${MANUAL_VERSION}" ]]; then + MANUAL_CLEAN="${MANUAL_VERSION#v}" # Remove 'v' prefix if present + if [[ "${MANUAL_CLEAN}" == *"-preview."* ]]; then + PREVIEW_VERSION="${MANUAL_CLEAN}" + else + PREVIEW_BASE="${MANUAL_CLEAN%%-*}" # Strip any prerelease/build + TIMESTAMP=$(date +%Y%m%d%H%M%S) + PREVIEW_VERSION="${PREVIEW_BASE}-preview.${TIMESTAMP}" + fi + else + TIMESTAMP=$(date +%Y%m%d%H%M%S) + PREVIEW_VERSION="${BASE_VERSION}-preview.${TIMESTAMP}" + fi + + RELEASE_TAG="${PREVIEW_VERSION}" echo "RELEASE_TAG=${RELEASE_TAG}" >> "$GITHUB_OUTPUT" echo "RELEASE_VERSION=${PREVIEW_VERSION}" >> "$GITHUB_OUTPUT" @@ -119,6 +133,12 @@ jobs: IS_PREVIEW: '${{ steps.vars.outputs.is_preview }}' MANUAL_VERSION: '${{ inputs.version }}' + - name: 'Build webui dependency' + if: |- + ${{ github.event.inputs.force_skip_tests != 'true' }} + run: | + npm run build --workspace=@qwen-code/webui + - name: 'Run Tests' if: |- ${{ github.event.inputs.force_skip_tests != 'true' }} @@ -279,7 +299,7 @@ jobs: echo "Publishing to Microsoft Marketplace..." for vsix in vsix-artifacts/*.vsix; do echo "Publishing: ${vsix}" - vsce publish --packagePath "${vsix}" --pat "${VSCE_PAT}" + vsce publish --packagePath "${vsix}" --pat "${VSCE_PAT}" --skip-duplicate done - name: 'Publish to OpenVSX'