feat(sdk): auto-inject Content entries into vsixmanifest #31
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - 'src/**' | |
| - 'samples/**' | |
| - 'tests/**' | |
| - '.github/workflows/build.yml' | |
| pull_request: | |
| branches: [main] | |
| paths: | |
| - 'src/**' | |
| - 'samples/**' | |
| - 'tests/**' | |
| - '.github/workflows/build.yml' | |
| jobs: | |
| build: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: 8.0.x | |
| - name: Create artifacts directory | |
| run: New-Item -ItemType Directory -Force -Path artifacts/packages | |
| - name: Build SDK | |
| run: dotnet build src/CodingWithCalvin.VsixSdk/CodingWithCalvin.VsixSdk.csproj -c Release | |
| - name: Build Templates | |
| run: dotnet pack src/CodingWithCalvin.VsixSdk.Templates/CodingWithCalvin.VsixSdk.Templates.csproj -c Release | |
| - name: Build Sample Extension | |
| run: dotnet build samples/SampleExtension/SampleExtension.csproj -c Release | |
| # E2E Tests - Build all test projects | |
| - name: Build E2E.Minimal | |
| run: dotnet build tests/e2e/E2E.Minimal/E2E.Minimal.csproj -c Release | |
| - name: Build E2E.AutoIncludes | |
| run: dotnet build tests/e2e/E2E.AutoIncludes/E2E.AutoIncludes.csproj -c Release | |
| - name: Build E2E.SourceGenerators | |
| run: dotnet build tests/e2e/E2E.SourceGenerators/E2E.SourceGenerators.csproj -c Release | |
| - name: Build E2E.VersionOverride | |
| run: dotnet build tests/e2e/E2E.VersionOverride/E2E.VersionOverride.csproj -c Release | |
| - name: Build E2E.VersionOverride with SetVsixVersion | |
| run: dotnet build tests/e2e/E2E.VersionOverride/E2E.VersionOverride.csproj -c Release -p:SetVsixVersion=2.0.0 | |
| - name: Build E2E.CustomPkgDef | |
| run: dotnet build tests/e2e/E2E.CustomPkgDef/E2E.CustomPkgDef.csproj -c Release | |
| - name: Build E2E.ManualPkgDef | |
| run: dotnet build tests/e2e/E2E.ManualPkgDef/E2E.ManualPkgDef.csproj -c Release | |
| - name: Build E2E.ImageAndContentManifest | |
| run: dotnet build tests/e2e/E2E.ImageAndContentManifest/E2E.ImageAndContentManifest.csproj -c Release | |
| - name: Build E2E.Validation (expect warnings) | |
| run: dotnet build tests/e2e/E2E.Validation/E2E.Validation.csproj -c Release | |
| - name: Build E2E.ValidationNoManifest (expect warnings) | |
| run: dotnet build tests/e2e/E2E.ValidationNoManifest/E2E.ValidationNoManifest.csproj -c Release | |
| - name: Build E2E.Templates.AutoDiscovery | |
| run: dotnet build tests/e2e/E2E.Templates.AutoDiscovery/E2E.Templates.AutoDiscovery.csproj -c Release | |
| - name: Build E2E.Templates.Reference | |
| run: dotnet build tests/e2e/E2E.Templates.Reference/E2E.Templates.Reference.csproj -c Release | |
| - name: Build E2E.Templates.ReferenceManual | |
| run: dotnet build tests/e2e/E2E.Templates.ReferenceManual/E2E.Templates.ReferenceManual.csproj -c Release | |
| - name: Build E2E.Templates.ManualWithSubPath | |
| run: dotnet build tests/e2e/E2E.Templates.ManualWithSubPath/E2E.Templates.ManualWithSubPath.csproj -c Release | |
| - name: Build E2E.AllFeatures | |
| run: dotnet build tests/e2e/E2E.AllFeatures/E2E.AllFeatures.csproj -c Release | |
| - name: Build E2E.Templates.AutoInject | |
| run: dotnet build tests/e2e/E2E.Templates.AutoInject/E2E.Templates.AutoInject.csproj -c Release | |
| # VSIX Verification - Check that VSIX files contain expected content | |
| - name: Verify E2E.Minimal VSIX | |
| run: | | |
| $vsix = "tests/e2e/E2E.Minimal/bin/Release/net472/E2E.Minimal.vsix" | |
| if (!(Test-Path $vsix)) { throw "VSIX not found: $vsix" } | |
| Expand-Archive -Path $vsix -DestinationPath "tests/e2e/E2E.Minimal/vsix-contents" -Force | |
| $files = Get-ChildItem -Path "tests/e2e/E2E.Minimal/vsix-contents" -Recurse -File | Select-Object -ExpandProperty Name | |
| if ($files -notcontains "extension.vsixmanifest") { throw "Missing extension.vsixmanifest" } | |
| if ($files -notcontains "E2E.Minimal.dll") { throw "Missing E2E.Minimal.dll" } | |
| Write-Host "E2E.Minimal VSIX verified successfully" | |
| - name: Verify E2E.Templates.AutoDiscovery VSIX | |
| run: | | |
| $vsix = "tests/e2e/E2E.Templates.AutoDiscovery/bin/Release/net472/E2E.Templates.AutoDiscovery.vsix" | |
| if (!(Test-Path $vsix)) { throw "VSIX not found: $vsix" } | |
| Expand-Archive -Path $vsix -DestinationPath "tests/e2e/E2E.Templates.AutoDiscovery/vsix-contents" -Force | |
| $files = Get-ChildItem -Path "tests/e2e/E2E.Templates.AutoDiscovery/vsix-contents" -Recurse | Select-Object -ExpandProperty Name | |
| # VSSDK default behavior includes templates as folders with .vstemplate files | |
| if ($files -notcontains "ConsoleApp.vstemplate") { throw "Missing ProjectTemplates/ConsoleApp/ConsoleApp.vstemplate" } | |
| if ($files -notcontains "NewClass.vstemplate") { throw "Missing ItemTemplates/NewClass/NewClass.vstemplate" } | |
| Write-Host "E2E.Templates.AutoDiscovery VSIX verified successfully" | |
| - name: Verify E2E.Templates.Reference VSIX | |
| run: | | |
| $vsix = "tests/e2e/E2E.Templates.Reference/bin/Release/net472/E2E.Templates.Reference.vsix" | |
| if (!(Test-Path $vsix)) { throw "VSIX not found: $vsix" } | |
| Expand-Archive -Path $vsix -DestinationPath "tests/e2e/E2E.Templates.Reference/vsix-contents" -Force | |
| $files = Get-ChildItem -Path "tests/e2e/E2E.Templates.Reference/vsix-contents" -Recurse | Select-Object -ExpandProperty Name | |
| # Verify templates copied from referenced project are included | |
| if ($files -notcontains "RefProject.vstemplate") { throw "Missing ProjectTemplates/ProjectTemplate/RefProject.vstemplate" } | |
| if ($files -notcontains "RefItem.vstemplate") { throw "Missing ItemTemplates/ItemTemplate/RefItem.vstemplate" } | |
| Write-Host "E2E.Templates.Reference VSIX verified successfully" | |
| - name: Verify E2E.Templates.ReferenceManual VSIX | |
| run: | | |
| $vsix = "tests/e2e/E2E.Templates.ReferenceManual/bin/Release/net472/E2E.Templates.ReferenceManual.vsix" | |
| if (!(Test-Path $vsix)) { throw "VSIX not found: $vsix" } | |
| Expand-Archive -Path $vsix -DestinationPath "tests/e2e/E2E.Templates.ReferenceManual/vsix-contents" -Force | |
| $files = Get-ChildItem -Path "tests/e2e/E2E.Templates.ReferenceManual/vsix-contents" -Recurse | Select-Object -ExpandProperty Name | |
| # Verify templates copied from referenced project are included (manual manifest) | |
| if ($files -notcontains "RefProject.vstemplate") { throw "Missing ProjectTemplates/ProjectTemplate/RefProject.vstemplate" } | |
| if ($files -notcontains "RefItem.vstemplate") { throw "Missing ItemTemplates/ItemTemplate/RefItem.vstemplate" } | |
| Write-Host "E2E.Templates.ReferenceManual VSIX verified successfully" | |
| - name: Verify E2E.AllFeatures VSIX | |
| run: | | |
| $vsix = "tests/e2e/E2E.AllFeatures/bin/Release/net472/E2E.AllFeatures.vsix" | |
| if (!(Test-Path $vsix)) { throw "VSIX not found: $vsix" } | |
| Expand-Archive -Path $vsix -DestinationPath "tests/e2e/E2E.AllFeatures/vsix-contents" -Force | |
| $files = Get-ChildItem -Path "tests/e2e/E2E.AllFeatures/vsix-contents" -Recurse | Select-Object -ExpandProperty Name | |
| if ($files -notcontains "extension.vsixmanifest") { throw "Missing extension.vsixmanifest" } | |
| if ($files -notcontains "E2E.AllFeatures.dll") { throw "Missing E2E.AllFeatures.dll" } | |
| Write-Host "E2E.AllFeatures VSIX verified successfully" | |
| - name: Verify E2E.Templates.AutoInject VSIX | |
| run: | | |
| $vsix = "tests/e2e/E2E.Templates.AutoInject/bin/Release/net472/E2E.Templates.AutoInject.vsix" | |
| if (!(Test-Path $vsix)) { throw "VSIX not found: $vsix" } | |
| Expand-Archive -Path $vsix -DestinationPath "tests/e2e/E2E.Templates.AutoInject/vsix-contents" -Force | |
| $files = Get-ChildItem -Path "tests/e2e/E2E.Templates.AutoInject/vsix-contents" -Recurse | Select-Object -ExpandProperty Name | |
| # Verify template was included (Content was auto-injected) | |
| if ($files -notcontains "TestProject.vstemplate") { throw "Missing ProjectTemplates/TestProject/TestProject.vstemplate" } | |
| Write-Host "E2E.Templates.AutoInject VSIX verified successfully" | |
| - name: Test Template - Install | |
| run: dotnet new install artifacts/packages/CodingWithCalvin.VsixSdk.Templates.1.0.0.nupkg | |
| - name: Test Template - Create Project | |
| run: | | |
| mkdir test-template | |
| cd test-template | |
| dotnet new vsix -n TestExtension --publisher "CI Test" | |
| - name: Test Template - Build Project | |
| run: dotnet build test-template/TestExtension/TestExtension.csproj -c Release | |
| - name: Test Template - Uninstall | |
| run: dotnet new uninstall CodingWithCalvin.VsixSdk.Templates | |
| - name: Upload SDK Package | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: sdk-package | |
| path: artifacts/packages/CodingWithCalvin.VsixSdk.*.nupkg | |
| - name: Upload Templates Package | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: templates-package | |
| path: artifacts/packages/CodingWithCalvin.VsixSdk.Templates.*.nupkg |