Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
outputs:
skip_workflow: ${{ (steps.check_for_changes.outputs.no_changes == 'true' || steps.check_for_changes.outputs.only_changed == 'true') && 'true' || 'false' }}
VERSION_SUFFIX_OVERRIDE: ${{ steps.compute_version_suffix.outputs.VERSION_SUFFIX_OVERRIDE }}
EXTENSION_VERSION_OVERRIDE: ${{ steps.compute_version_suffix.outputs.EXTENSION_VERSION_OVERRIDE }}

steps:
- name: Checkout code
Expand Down Expand Up @@ -58,13 +59,18 @@ jobs:
Write-Host "Computed VERSION_SUFFIX_OVERRIDE=$VERSION_SUFFIX"
"VERSION_SUFFIX_OVERRIDE=$VERSION_SUFFIX" | Out-File -FilePath $Env:GITHUB_OUTPUT -Append -Encoding utf8

$EXTENSION_VERSION = "0.0.$($Env:PR_NUMBER)"
Comment thread
adamint marked this conversation as resolved.
Outdated
Write-Host "Computed EXTENSION_VERSION_OVERRIDE=$EXTENSION_VERSION"
"EXTENSION_VERSION_OVERRIDE=$EXTENSION_VERSION" | Out-File -FilePath $Env:GITHUB_OUTPUT -Append -Encoding utf8

tests:
uses: ./.github/workflows/tests.yml
name: Tests
needs: [prepare_for_ci]
if: ${{ github.repository_owner == 'microsoft' && needs.prepare_for_ci.outputs.skip_workflow != 'true' }}
with:
versionOverrideArg: ${{ needs.prepare_for_ci.outputs.VERSION_SUFFIX_OVERRIDE }}
extensionVersionOverride: ${{ needs.prepare_for_ci.outputs.EXTENSION_VERSION_OVERRIDE }}

# This job is used for branch protection. It fails if any of the dependent jobs failed
results:
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
versionOverrideArg:
required: false
type: string
extensionVersionOverride:
required: false
type: string

jobs:
setup_for_tests:
Expand Down Expand Up @@ -294,6 +297,9 @@ jobs:
run: npm install
- name: Run tests
run: npm test
- name: Override extension version for PR builds
if: ${{ inputs.extensionVersionOverride != '' }}
run: npm version "${{ inputs.extensionVersionOverride }}" --no-git-tag-version
Comment thread
adamint marked this conversation as resolved.
Outdated
- name: Package VSIX
run: npm exec @vscode/vsce -- package --pre-release -o out/aspire-extension.vsix
- name: Upload VSIX
Expand Down
13 changes: 10 additions & 3 deletions extension/Extension.proj
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,18 @@
</Exec>

<PropertyGroup>
<_EffectiveVersion Condition="'$(ExtensionVersionOverride)' != ''">$(ExtensionVersionOverride)</_EffectiveVersion>
Comment thread
adamint marked this conversation as resolved.
<_EffectiveVersion Condition="'$(ExtensionVersionOverride)' == ''">$(_ExtractedVersion)</_EffectiveVersion>
<_VscodeOutputDir>$(ArtifactsPackagesDir)vscode</_VscodeOutputDir>
<_VsixPath>$(_VscodeOutputDir)\aspire-vscode-$(_ExtractedVersion).vsix</_VsixPath>
<_ManifestPath>$(_VscodeOutputDir)\aspire-vscode-$(_ExtractedVersion).manifest</_ManifestPath>
<_VsixPath>$(_VscodeOutputDir)\aspire-vscode-$(_EffectiveVersion).vsix</_VsixPath>
<_ManifestPath>$(_VscodeOutputDir)\aspire-vscode-$(_EffectiveVersion).manifest</_ManifestPath>
</PropertyGroup>
Comment thread
adamint marked this conversation as resolved.

<!-- Override package.json version if ExtensionVersionOverride is set -->
<Exec Command="node -e &quot;const p=require('./package.json');p.version='$(ExtensionVersionOverride)';require('fs').writeFileSync('./package.json',JSON.stringify(p,null,2)+'\n')&quot;"
Comment thread
adamint marked this conversation as resolved.
Outdated
Comment thread
adamint marked this conversation as resolved.
Outdated
Condition="'$(ExtensionVersionOverride)' != ''"
WorkingDirectory="$(ExtensionSrcDir)" />
Comment thread
adamint marked this conversation as resolved.
Outdated

<!-- Install dependencies and compile -->
<Exec Command="yarn install" WorkingDirectory="$(ExtensionSrcDir)" IgnoreStandardErrorWarningFormat="true" />
<Exec Command="yarn compile" WorkingDirectory="$(ExtensionSrcDir)" IgnoreStandardErrorWarningFormat="true" />
Expand All @@ -37,7 +44,7 @@
IgnoreStandardErrorWarningFormat="true"
Comment thread
adamint marked this conversation as resolved.
WorkingDirectory="$(ExtensionSrcDir)" />

<!--
<!--
VS Code extension signing for marketplace verification:
Generate manifest from the VSIX using vsce. The signing project (signing/signVsix.proj)
will copy this to .signature.p7s and sign it with the VSCodePublisher certificate.
Expand Down
Loading