feat: add WinGet upgrade option to PowerShell update notification (#5477) #856
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: CI Tests | |
| permissions: | |
| contents: read | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| # The branches below must be a subset of the branches above | |
| branches: [main] | |
| merge_group: | |
| types: [checks_requested] | |
| jobs: | |
| ci: | |
| name: node | |
| strategy: | |
| # Report every platform's result instead of cancelling the others as soon | |
| # as one fails. | |
| fail-fast: false | |
| matrix: | |
| os: [windows-latest, macos-latest, ubuntu-latest] | |
| runs-on: ${{ matrix.os }} | |
| env: | |
| DOTNET_NOLOGO: true | |
| DOTNET_GENERATE_ASPNET_CERTIFICATE: false | |
| DISPLAY: ":99.0" | |
| timeout-minutes: 10 | |
| steps: | |
| - name: Checkout PowerShellEditorServices | |
| uses: actions/checkout@v7 | |
| with: | |
| repository: PowerShell/PowerShellEditorServices | |
| path: PowerShellEditorServices | |
| # TODO: Drop this once PowerShellEditorServices can restore again. Its | |
| # nuget.config only lists an Azure DevOps feed whose package downloads | |
| # return 401 (Unauthorized) to anonymous clients such as GitHub runners, | |
| # so restoring the .NET reference packs fails before any tests run. Add | |
| # nuget.org and map the reference packs to it (otherwise NuGet still | |
| # downloads them from the feed that 401s). | |
| - name: Add nuget.org for the PowerShellEditorServices reference packs | |
| shell: pwsh | |
| run: | | |
| $config = @( | |
| '<?xml version="1.0" encoding="utf-8"?>' | |
| '<configuration>' | |
| ' <packageSources>' | |
| ' <clear />' | |
| ' <add key="PowerShellCore_PublicPackages" value="https://pkgs.dev.azure.com/powershell/PowerShell/_packaging/powershell/nuget/v3/index.json" />' | |
| ' <add key="nuget.org" value="https://api.nuget.org/v3/index.json" />' | |
| ' </packageSources>' | |
| ' <packageSourceMapping>' | |
| ' <packageSource key="nuget.org">' | |
| ' <package pattern="Microsoft.NETCore.App.*" />' | |
| ' <package pattern="Microsoft.AspNetCore.App.*" />' | |
| ' <package pattern="Microsoft.WindowsDesktop.App.*" />' | |
| ' </packageSource>' | |
| ' <packageSource key="PowerShellCore_PublicPackages">' | |
| ' <package pattern="*" />' | |
| ' </packageSource>' | |
| ' </packageSourceMapping>' | |
| '</configuration>' | |
| ) | |
| Set-Content -Path PowerShellEditorServices/nuget.config -Value $config | |
| - name: Checkout vscode-powershell | |
| uses: actions/checkout@v7 | |
| with: | |
| path: vscode-powershell | |
| - name: Validate snippets JSON file | |
| shell: pwsh | |
| run: $null = ConvertFrom-Json -InputObject (Get-Content -Raw -Path './snippets/PowerShell.json') | |
| working-directory: vscode-powershell | |
| - name: Install dotnet | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| cache: true | |
| cache-dependency-path: PowerShellEditorServices/**/*.csproj | |
| global-json-file: PowerShellEditorServices/global.json | |
| config-file: PowerShellEditorServices/nuget.config | |
| - name: Install PSResources | |
| shell: pwsh | |
| run: ./vscode-powershell/tools/installPSResources.ps1 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| cache-dependency-path: vscode-powershell/package-lock.json | |
| - name: Start X virtual framebuffer | |
| if: matrix.os == 'ubuntu-latest' | |
| run: /usr/bin/Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & | |
| - name: Build, test and package | |
| shell: pwsh | |
| run: Invoke-Build -Configuration Release | |
| working-directory: vscode-powershell | |
| - name: Rename VSIX to include OS name | |
| if: always() | |
| shell: pwsh | |
| # archive: false uses the filename as the artifact name, so we need unique names across matrix jobs | |
| run: Get-Item out/*.vsix -ErrorAction SilentlyContinue | Rename-Item -NewName { $_.BaseName + '-${{ matrix.os }}' + $_.Extension } | |
| working-directory: vscode-powershell | |
| - name: Upload build artifacts | |
| uses: actions/upload-artifact@v7 | |
| if: always() | |
| with: | |
| # archive: false uploads the .vsix directly (no zip wrapper) using the filename as the artifact name | |
| path: "vscode-powershell/out/*.vsix" | |
| archive: false | |
| if-no-files-found: ignore | |
| - name: Upload test results | |
| uses: actions/upload-artifact@v7 | |
| if: always() | |
| with: | |
| name: vscode-powershell-test-results-${{ matrix.os }} | |
| path: "**/test-results.xml" |