Release VSIX Extension #22
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: Release VSIX Extension | |
| on: | |
| push: | |
| branches: [ "release" ] | |
| pull_request: | |
| branches: [ "release" ] | |
| workflow_dispatch: # Allows manual trigger | |
| jobs: | |
| build: | |
| runs-on: windows-latest | |
| outputs: | |
| version: ${{ steps.get_version.outputs.VERSION }} | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| - name: Setup NuGet | |
| uses: NuGet/setup-nuget@v2 | |
| - name: Restore NuGet Packages | |
| run: nuget restore DebugAttachHistory.sln | |
| - name: Install Visual Studio Build Tools | |
| run: | | |
| choco install visualstudio2022buildtools --params "--add Microsoft.VisualStudio.Component.VSSDK" | |
| - name: Locate MSBuild | |
| id: locate-msbuild | |
| run: | | |
| $msbuildPath = &"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -latest -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe | |
| echo "MSBUILD_EXE=$msbuildPath" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 | |
| - name: Build Solution | |
| run: | | |
| &"$env:MSBUILD_EXE" DebugAttachHistory.sln /p:Configuration=Release /p:Platform="Any CPU" /p:DeployExtension=false /m | |
| - name: Find VSIX File | |
| id: find-vsix | |
| run: | | |
| $vsixFile = Get-ChildItem -Path . -Recurse -Filter "*.vsix" | Select-Object -ExpandProperty FullName | |
| echo $vsixFile | |
| echo "VSIX_PATH=$vsixFile" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 | |
| shell: pwsh | |
| - name: Upload VSIX as Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: VSIX-Package | |
| path: ${{ env.VSIX_PATH }} | |
| - name: Extract Extension Version | |
| id: get_version | |
| run: | | |
| [xml]$xml = Get-Content "DebugAttachHistory/source.extension.vsixmanifest" | |
| $version = $xml.PackageManifest.Metadata.Identity.Version | |
| echo "VERSION=$version" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 | |
| shell: pwsh | |
| release: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Download VSIX Artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: VSIX-Package | |
| path: . | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: "*.vsix" | |
| tag_name: v${{ needs.build.outputs.VERSION }} | |
| name: v${{ needs.build.outputs.VERSION }} | |
| draft: false | |
| prerelease: false | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |