diff --git a/.github/workflows/build-vscode-extension.yml b/.github/workflows/build-vscode-extension.yml index e5a3c88bc..9293e3e55 100644 --- a/.github/workflows/build-vscode-extension.yml +++ b/.github/workflows/build-vscode-extension.yml @@ -63,12 +63,8 @@ on: required: false type: boolean default: false - pr-number: - description: "PR number for version modification (optional)" - required: false - type: string - commit-id: - description: "Commit ID for version modification (optional)" + commit-sha: + description: "Commit SHA for version modification (optional, uses first 7 chars)" required: false type: string @@ -186,38 +182,16 @@ jobs: cd extensions/vscode npm install -f esbuild - # 3.5. Modify version for PR builds - - name: Modify package.json version for PR builds - if: inputs.pr-number != '' + # 3.5. Modify version with commit SHA + - name: Modify package.json version with commit SHA + if: inputs.commit-sha != '' run: | cd extensions/vscode # Get current version from package.json CURRENT_VERSION=$(node -p "require('./package.json').version") - # Create new version with PR number - NEW_VERSION="${CURRENT_VERSION}-${{ inputs.pr-number }}" - - echo "📝 Updating package.json version from $CURRENT_VERSION to $NEW_VERSION" - - # Update version in package.json - sed -i.bak "s/\"version\": \"$CURRENT_VERSION\"/\"version\": \"$NEW_VERSION\"/" package.json - - # Remove backup file - rm -f package.json.bak - - # Verify the change - echo "✅ New version: $(node -p "require('./package.json').version")" - - # 3.6. Modify version for main builds with commit ID - - name: Modify package.json version for main builds - if: inputs.commit-id != '' - run: | - cd extensions/vscode - # Get current version from package.json - CURRENT_VERSION=$(node -p "require('./package.json').version") - - # Create new version with short commit ID - COMMIT_SHORT="${{ inputs.commit-id }}" + # Create new version with short commit SHA (first 7 chars) + COMMIT_SHORT="${{ inputs.commit-sha }}" NEW_VERSION="${CURRENT_VERSION}-${COMMIT_SHORT:0:7}" echo "📝 Updating package.json version from $CURRENT_VERSION to $NEW_VERSION" diff --git a/.github/workflows/main-build.yaml b/.github/workflows/main-build.yaml index f86347e10..10e7bf4e3 100644 --- a/.github/workflows/main-build.yaml +++ b/.github/workflows/main-build.yaml @@ -11,5 +11,5 @@ jobs: with: # Uses default platforms (all supported platforms) pre-release: false - commit-id: ${{ github.sha }} + commit-sha: ${{ github.sha }} secrets: inherit \ No newline at end of file diff --git a/.github/workflows/pr_checks.yaml b/.github/workflows/pr_checks.yaml index c2703c8f9..7db77438f 100644 --- a/.github/workflows/pr_checks.yaml +++ b/.github/workflows/pr_checks.yaml @@ -697,7 +697,7 @@ jobs: } ] pre-release: false - pr-number: ${{ github.event.pull_request.number }} + commit-sha: ${{ github.sha }} secrets: inherit vscode-download-e2e-dependencies: diff --git a/scripts/oneper b/scripts/oneper index 68318a83f..530cef690 100755 --- a/scripts/oneper +++ b/scripts/oneper @@ -182,6 +182,7 @@ install_from_pr() { if code --install-extension "$target_path"; then echo "✅ Successfully installed Continue extension from PR #$pr_number" echo "📄 VSIX file saved to: $target_path" + echo "🔖 Extension version: ${version}- (set by workflow)" echo "" echo "💡 To use the new extension version, reload your VS Code window:" echo " • Press Ctrl+Shift+P (Cmd+Shift+P on Mac)"