fix(ci): use Windows PowerShell 5.1 (powershell) instead of pwsh
The self-hosted Windows runner runs as LocalSystem and only sees the machine PATH. winget-installed pwsh lands in the user PATH and is invisible to the service. Built-in Windows PowerShell 5.1 (`powershell`) handles the same syntax we use, so switch all steps to it. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -20,7 +20,7 @@ jobs:
|
|||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Debug — show what checkout produced
|
- name: Debug — show what checkout produced
|
||||||
shell: pwsh
|
shell: powershell
|
||||||
run: |
|
run: |
|
||||||
Write-Host "CWD: $(Get-Location)"
|
Write-Host "CWD: $(Get-Location)"
|
||||||
Write-Host "GITHUB_WORKSPACE: $env:GITHUB_WORKSPACE"
|
Write-Host "GITHUB_WORKSPACE: $env:GITHUB_WORKSPACE"
|
||||||
@@ -74,7 +74,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Resolve mage.exe + signtool.exe paths
|
- name: Resolve mage.exe + signtool.exe paths
|
||||||
id: tools
|
id: tools
|
||||||
shell: pwsh
|
shell: powershell
|
||||||
run: |
|
run: |
|
||||||
# mage.exe lives under .NET 4.8 Developer Pack. Find any installed copy.
|
# mage.exe lives under .NET 4.8 Developer Pack. Find any installed copy.
|
||||||
$mage = Get-ChildItem 'C:\Program Files (x86)\Microsoft SDKs\Windows' -Recurse -Filter mage.exe -ErrorAction SilentlyContinue |
|
$mage = Get-ChildItem 'C:\Program Files (x86)\Microsoft SDKs\Windows' -Recurse -Filter mage.exe -ErrorAction SilentlyContinue |
|
||||||
@@ -95,7 +95,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Compute version from tag
|
- name: Compute version from tag
|
||||||
id: ver
|
id: ver
|
||||||
shell: pwsh
|
shell: powershell
|
||||||
run: |
|
run: |
|
||||||
$tag = "${{ github.ref_name }}"
|
$tag = "${{ github.ref_name }}"
|
||||||
if ($tag -notmatch '^v(\d+\.\d+\.\d+)$') {
|
if ($tag -notmatch '^v(\d+\.\d+\.\d+)$') {
|
||||||
@@ -108,7 +108,7 @@ jobs:
|
|||||||
Write-Host "Version: $version"
|
Write-Host "Version: $version"
|
||||||
|
|
||||||
- name: Ensure code-signing cert in LocalMachine\My
|
- name: Ensure code-signing cert in LocalMachine\My
|
||||||
shell: pwsh
|
shell: powershell
|
||||||
env:
|
env:
|
||||||
THUMB: ${{ secrets.CODESIGN_THUMBPRINT }}
|
THUMB: ${{ secrets.CODESIGN_THUMBPRINT }}
|
||||||
PFX_B64: ${{ secrets.CODESIGN_CERT_PFX_BASE64 }}
|
PFX_B64: ${{ secrets.CODESIGN_CERT_PFX_BASE64 }}
|
||||||
@@ -142,7 +142,7 @@ jobs:
|
|||||||
# picks it by thumbprint, the service runs as LocalSystem so the runtime
|
# picks it by thumbprint, the service runs as LocalSystem so the runtime
|
||||||
# search reaches both stores.
|
# search reaches both stores.
|
||||||
- name: Sign assemblies
|
- name: Sign assemblies
|
||||||
shell: pwsh
|
shell: powershell
|
||||||
run: |
|
run: |
|
||||||
$thumb = "${{ secrets.CODESIGN_THUMBPRINT }}"
|
$thumb = "${{ secrets.CODESIGN_THUMBPRINT }}"
|
||||||
& "$env:SIGNTOOL" sign /sha1 $thumb /fd SHA256 /tr http://timestamp.digicert.com /td SHA256 `
|
& "$env:SIGNTOOL" sign /sha1 $thumb /fd SHA256 /tr http://timestamp.digicert.com /td SHA256 `
|
||||||
@@ -152,7 +152,7 @@ jobs:
|
|||||||
src/OutlookAddinProtocolHandler/bin/Release/net48/OutlookAddinProtocolHandler.exe
|
src/OutlookAddinProtocolHandler/bin/Release/net48/OutlookAddinProtocolHandler.exe
|
||||||
|
|
||||||
- name: Publish ClickOnce
|
- name: Publish ClickOnce
|
||||||
shell: pwsh
|
shell: powershell
|
||||||
run: |
|
run: |
|
||||||
$version = "${{ steps.ver.outputs.version }}"
|
$version = "${{ steps.ver.outputs.version }}"
|
||||||
$versionUscore = "${{ steps.ver.outputs.versionUscore }}"
|
$versionUscore = "${{ steps.ver.outputs.versionUscore }}"
|
||||||
@@ -195,7 +195,7 @@ jobs:
|
|||||||
ForEach-Object { Rename-Item -LiteralPath $_.FullName -NewName ($_.Name + '.deploy') }
|
ForEach-Object { Rename-Item -LiteralPath $_.FullName -NewName ($_.Name + '.deploy') }
|
||||||
|
|
||||||
- name: Stage protocol handler
|
- name: Stage protocol handler
|
||||||
shell: pwsh
|
shell: powershell
|
||||||
run: |
|
run: |
|
||||||
$stagingDir = "publish/protocol-handler"
|
$stagingDir = "publish/protocol-handler"
|
||||||
New-Item -ItemType Directory -Force -Path $stagingDir | Out-Null
|
New-Item -ItemType Directory -Force -Path $stagingDir | Out-Null
|
||||||
|
|||||||
Reference in New Issue
Block a user