feat(build-tools): detect .NET SDK version from csproj and migrate copilot setup to Linux#2091
Merged
Merged
Conversation
Copilot created this pull request from a session on behalf of
Belphemur
May 5, 2026 20:54
View session
Owner
|
@copilot fix the copilot setup. Check CI/CD failure. |
Contributor
Author
Fixed in d855493. The issue was GNU grep on Ubuntu doesn't support variable-length lookbehind assertions ( |
Owner
|
@copilot do the right update for this to work: |
Contributor
Author
…pilot setup to Linux - Add Get-DotNetSdkVersion to Install-BuildTools.ps1 that reads TargetFramework from SoundSwitch.csproj (same regex pattern as CI) and maps it to the winget package ID Microsoft.DotNet.SDK.<major> - Install the detected .NET SDK as step 6 in Install-BuildTools.ps1 - Add 5 Pester tests for Get-DotNetSdkVersion; all 42 tests pass - Migrate copilot-setup-steps.yml from windows-latest to ubuntu-latest with native bash framework detection (grep -oP) replacing the pwsh XML parsing Agent-Logs-Url: https://github.com/Belphemur/SoundSwitch/sessions/49501ace-3311-42d4-ab6a-2efb42ad9da0 Co-authored-by: Belphemur <197810+Belphemur@users.noreply.github.com>
…NET version extraction
GNU grep on Ubuntu does not support variable-length lookbehinds (e.g.
(?<=^net\d{1,3}\.)). Replace the two-grep approach with a single sed
substitution: sed -E 's/^net([0-9]+\.[0-9]+).*/\1.x/' which is
portable across macOS and all Linux grep/sed versions.
Agent-Logs-Url: https://github.com/Belphemur/SoundSwitch/sessions/d93fc16a-0054-4e64-b394-eeeef35b11aa
Co-authored-by: Belphemur <197810+Belphemur@users.noreply.github.com>
… on Linux Agent-Logs-Url: https://github.com/Belphemur/SoundSwitch/sessions/6f898a40-eb6f-49d5-9fb3-6cc2b6924a31 Co-authored-by: Belphemur <197810+Belphemur@users.noreply.github.com>
be066dc to
8af7cce
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two related improvements to the local dev setup and Copilot cloud agent environment:
tools/Install-BuildTools.ps1Get-DotNetSdkVersionhelper function that reads theTargetFrameworkfromSoundSwitch/SoundSwitch.csprojusing the same regex pattern already used by the CI workflows (reusable-build.yml,test-installer-build.yml).Microsoft.DotNet.SDK.<major>(e.g.Microsoft.DotNet.SDK.10fornet10.0-windows), so the correct SDK is always installed without hardcoding.tools/Install-BuildTools.Tests.ps1Get-DotNetSdkVersioncovering:net<major>.<minor>-windowsTFM, plainnet<major>.<minor>TFM, missing csproj, unparseable TFM, and file-read failure.Get-DotNetSdkVersion..github/workflows/copilot-setup-steps.ymlwindows-latesttoubuntu-latest.grep -oP(same version output format).shell: pwshdirectives — all steps now use the default bash shell.