simplify: use commit SHA for all version modifications
- Replace separate PR number and commit ID logic with unified approach - Always use first 7 characters of commit SHA for version suffix - Both PR and main builds now use format: 1.1.67-a1b2c3d - Simpler logic, consistent naming across all build types - Updated oneper script messaging accordingly 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
2f6b12018a
commit
f173cf4dc1
4 changed files with 10 additions and 35 deletions
40
.github/workflows/build-vscode-extension.yml
vendored
40
.github/workflows/build-vscode-extension.yml
vendored
|
|
@ -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"
|
||||
|
|
|
|||
2
.github/workflows/main-build.yaml
vendored
2
.github/workflows/main-build.yaml
vendored
|
|
@ -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
|
||||
2
.github/workflows/pr_checks.yaml
vendored
2
.github/workflows/pr_checks.yaml
vendored
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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}-<commit-sha> (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)"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue