Skip to content

deps: Bump the wcf-client group with 4 updates #316

deps: Bump the wcf-client group with 4 updates

deps: Bump the wcf-client group with 4 updates #316

name: Continuous Integration
# Two-job design:
# build — fast lane: Release build + lint + serverless Pester. No secrets. Parallel-safe.
# Triggers on every push/PR to any branch. Uploads the compiled module as an artifact.
# live — live integration tests against the real Tridion Docs server. Needs secrets.
# Runs only after build succeeds and only for master-targeting pushes/PRs.
# Serialized via concurrency group so Dependabot PRs queue instead of racing.
on:
push:
paths:
- 'Source/**'
- '*.TXT'
- '*.MD'
pull_request:
paths:
- 'Source/**'
- '*.TXT'
- '*.MD'
# Least-privilege default: both jobs only need to read the repository contents
# (checkout) and use the actions runtime token for artifacts. No job writes back
# to the GitHub repository — PSGallery publish uses an external NUGET_API_KEY.
permissions:
contents: read
env:
ISHGITHUB_RUN_NUMBER: ${{ github.run_number }}
ISHGITHUB_SERVER_URL: ${{ github.server_url }}
ISHGITHUB_REPOSITORY: ${{ github.repository }}
ISHGITHUB_RUN_ID: ${{ github.run_id }}
jobs:
# ---------------------------------------------------------------------------
# Fast lane — no secrets, parallel-safe, used by agents and Dependabot PRs.
# ---------------------------------------------------------------------------
build:
name: Build, lint and fast checks
runs-on: windows-latest
steps:
- name: PowerShell Update to latest stable (initially because 7.2.13/lts had issues, forcing latest stable)
uses: bjompen/UpdatePWSHAction@v1.1.0
with:
ReleaseVersion: 'Stable'
- name: "Info: My Github Workflows Setup"
shell: pwsh
run: |
echo "My Github Workflows Setup Information..."
echo ("PSVersionTable info PSEdition["+$PSVersionTable.PSEdition+"] PSVersion["+$PSVersionTable.PSVersion+"]")
echo "GITHUB_ACTIONS[$env:GITHUB_ACTIONS]"
echo "GITHUB_WORKFLOW[$env:GITHUB_WORKFLOW]"
echo "GITHUB_REF[$env:GITHUB_REF]"
echo "GITHUB_RUN_NUMBER[$env:GITHUB_RUN_NUMBER]"
echo "GITHUB_RUN_ATTEMPT[$env:GITHUB_RUN_ATTEMPT]"
echo "ISHGITHUB_RUN_NUMBER[$env:ISHGITHUB_RUN_NUMBER]"
echo "ISHGITHUB_SERVER_URL[$env:ISHGITHUB_SERVER_URL]"
echo "ISHGITHUB_REPOSITORY[$env:ISHGITHUB_REPOSITORY]"
echo "ISHGITHUB_RUN_ID[$env:ISHGITHUB_RUN_ID]"
- uses: actions/checkout@v7
- name: Setup .NET 6.0.x
uses: actions/setup-dotnet@v6
with:
dotnet-version: 6.0.x
- name: Explicit restore of multi-target/conditional ProjectReference and dependencies
shell: pwsh
run: |
# See Github #180
# dotnet restore Source/ISHRemote/Trisoft.ISHRemote.OpenApiAM10\Trisoft.ISHRemote.OpenApiAM10.NET48.csproj
# dotnet restore Source/ISHRemote/Trisoft.ISHRemote.OpenApiAM10\Trisoft.ISHRemote.OpenApiAM10.NET60.csproj
# dotnet restore Source/ISHRemote/Trisoft.ISHRemote.OpenApiISH30\Trisoft.ISHRemote.OpenApiISH30.NET48.csproj
# dotnet restore Source/ISHRemote/Trisoft.ISHRemote.OpenApiISH30\Trisoft.ISHRemote.OpenApiISH30.NET60.csproj
dotnet restore Source/ISHRemote/ISHRemote.sln
- name: Build Solution
shell: pwsh
run: dotnet build --no-restore --no-incremental --configuration release Source/ISHRemote/ISHRemote.sln
- name: Setup PowerShell modules (PSScriptAnalyzer + Pester)
shell: pwsh
run: |
Set-PSRepository PSGallery -InstallationPolicy Trusted
Install-Module PSScriptAnalyzer -ErrorAction Stop
if (-not (Get-Module -ListAvailable -Name Pester | Where-Object { $_.Version -ge [version]'5.3.0' })) {
Install-Module Pester -MinimumVersion 5.3.0 -Force -SkipPublisherCheck -Scope CurrentUser
}
- name: Lint with PSScriptAnalyzer
shell: pwsh
run: |
Invoke-ScriptAnalyzer -Path Source/ISHRemote/Trisoft.ISHRemote/Scripts -Recurse -Outvariable issues
$errors = $issues.Where({$_.Severity -eq 'Error'})
$warnings = $issues.Where({$_.Severity -eq 'Warning'})
if ($errors) {
Write-Warning "There were $($errors.Count) errors and $($warnings.Count) warnings total."
} else {
Write-Output "There were $($errors.Count) errors and $($warnings.Count) warnings total."
}
- name: Pester Test Anonymization of public Doc and Samples on Windows using PowerShell 7.x
shell: pwsh
run: |
$result = Invoke-Pester -Path Source/ISHRemote/Trisoft.ISHRemote/Cmdlets/_TestEnvironment/TestAnonymization.Tests.ps1 -Output Detailed -PassThru
if ($result.FailedCount -gt 0) {
throw "Anonymization guard failed: $($result.FailedCount) check(s) found a real URL, internal hostname, private IP or token. Use example.com placeholders or extend the known-exceptions list in the test."
}
- name: Archive ISHRemote module
uses: actions/upload-artifact@v7
with:
name: ISHRemote-MainCI-Module
path: Source/ISHRemote/Trisoft.ISHRemote/bin/Release/ISHRemote/
# ---------------------------------------------------------------------------
# Live integration tests — requires the single shared Tridion Docs server.
# Queued (not cancelled) so Dependabot PRs and pushes never race each other.
# ---------------------------------------------------------------------------
live:
name: Live integration tests (PS 7.x and PS 5.1)
runs-on: windows-latest
needs: build
if: (github.event_name == 'push' && github.ref == 'refs/heads/master') || (github.event_name == 'pull_request' && github.base_ref == 'master')
concurrency:
group: run-tests-on-ishbaseurl
cancel-in-progress: false
steps:
- name: PowerShell Update to latest stable (initially because 7.2.13/lts had issues, forcing latest stable)
uses: bjompen/UpdatePWSHAction@v1.1.0
with:
ReleaseVersion: 'Stable'
- uses: actions/checkout@v7
- name: Download ISHRemote module artifact
uses: actions/download-artifact@v8
with:
name: ISHRemote-MainCI-Module
path: Source/ISHRemote/Trisoft.ISHRemote/bin/Release/ISHRemote/
- name: Pester Test Preparation (...products.com) on Windows using PowerShell 7.x
shell: pwsh
env:
ISH_BASE_URL: ${{ secrets.ISH_BASE_URL }}
ISH_USER_NAME: ${{ secrets.ISH_USER_NAME }}
ISH_PASSWORD: ${{ secrets.ISH_PASSWORD }}
ISH_CLIENT_ID: ${{ secrets.ISH_CLIENT_ID }}
ISH_CLIENT_SECRET: ${{ secrets.ISH_CLIENT_SECRET }}
run: |
$filePath = 'Source/ISHRemote/Trisoft.ISHRemote/ISHRemote.PesterSetup.Debug.ps1'
Add-Content -Path $filePath -Value '# File[$filePath] is generated through continuous-integration.yml section PowerShell 7.x'
Add-Content -Path $filePath -Value '$baseUrl = $env:ISH_BASE_URL'
Add-Content -Path $filePath -Value 'if ($baseUrl -like "*.sdlproducts.com*")'
Add-Content -Path $filePath -Value '{'
Add-Content -Path $filePath -Value ' $ishEventTypeToPurge = ''TESTBACKGROUNDTASK''' # before 14SP4 use ''PUSHTRANSLATIONS'''
Add-Content -Path $filePath -Value ' $ishLngLabel = ''en-us'''
Add-Content -Path $filePath -Value ' $ishLngTarget1 = ''VLANGUAGEESES'''
Add-Content -Path $filePath -Value ' $ishLngTarget1Label = ''es-es'''
Add-Content -Path $filePath -Value ' $ishLngTarget2 = ''VLANGUAGEDEDE'''
Add-Content -Path $filePath -Value ' $ishLngTarget2Label = ''de-de'''
Add-Content -Path $filePath -Value ' $ishLngCombination = ''en-us'''
Add-Content -Path $filePath -Value '}'
- name: Pester Test Prerequisites on Windows using PowerShell 7.x
shell: pwsh
env:
ISH_BASE_URL: ${{ secrets.ISH_BASE_URL }}
ISH_USER_NAME: ${{ secrets.ISH_USER_NAME }}
ISH_PASSWORD: ${{ secrets.ISH_PASSWORD }}
ISH_CLIENT_ID: ${{ secrets.ISH_CLIENT_ID }}
ISH_CLIENT_SECRET: ${{ secrets.ISH_CLIENT_SECRET }}
run: Invoke-Pester -Path Source/ISHRemote/Trisoft.ISHRemote/Cmdlets/_TestEnvironment/TestPrerequisite.Tests.ps1 -Output Detailed -Passthru | Export-CliXml -Path Cmdlets.Pester.Tests.xml
- name: Upload test results
uses: actions/upload-artifact@v7
with:
name: ISHRemote-MainCI-PesterPrerequisiteOnPowerShellCore
path: Cmdlets.Pester.Tests.xml
- name: Pester Test Cmdlets on Windows using PowerShell 7.x
shell: pwsh
env:
ISH_BASE_URL: ${{ secrets.ISH_BASE_URL }}
ISH_USER_NAME: ${{ secrets.ISH_USER_NAME }}
ISH_PASSWORD: ${{ secrets.ISH_PASSWORD }}
ISH_CLIENT_ID: ${{ secrets.ISH_CLIENT_ID }}
ISH_CLIENT_SECRET: ${{ secrets.ISH_CLIENT_SECRET }}
run: Invoke-Pester -Path @('Source/ISHRemote/Trisoft.ISHRemote/Scripts/Public/','Source/ISHRemote/Trisoft.ISHRemote/Cmdlets/') -ExcludePath @('*GetIshDocumentObj.Tests.ps1','*TestAnonymization.Tests.ps1') -Output Detailed -Passthru | Export-CliXml -Path Cmdlets.Pester.Tests.xml
- name: Upload test results
uses: actions/upload-artifact@v7
with:
name: ISHRemote-MainCI-PesterOnPowerShellCore
path: Cmdlets.Pester.Tests.xml
if: ${{ always() }}
- name: Pester Test Preparation (...products.com) using Windows PowerShell 5.1
shell: powershell
env:
ISH_BASE_URL: ${{ secrets.ISH_BASE_URL }}
ISH_USER_NAME: ${{ secrets.ISH_USER_NAME }}
ISH_PASSWORD: ${{ secrets.ISH_PASSWORD }}
ISH_CLIENT_ID: ${{ secrets.ISH_CLIENT_ID }}
ISH_CLIENT_SECRET: ${{ secrets.ISH_CLIENT_SECRET }}
run: |
$filePath = 'Source/ISHRemote/Trisoft.ISHRemote/ISHRemote.PesterSetup.Debug.ps1'
Add-Content -Path $filePath -Value '# File[$filePath] is generated through continuous-integration.yml section Windows PowerShell 5.1'
Add-Content -Path $filePath -Value '$baseUrl = $env:ISH_BASE_URL'
Add-Content -Path $filePath -Value 'if ($baseUrl -like "*.sdlproducts.com*")'
Add-Content -Path $filePath -Value '{'
Add-Content -Path $filePath -Value ' $ishEventTypeToPurge = ''TESTBACKGROUNDTASK''' # before 14SP4 use ''PUSHTRANSLATIONS'''
Add-Content -Path $filePath -Value ' $ishLngLabel = ''en-us'''
Add-Content -Path $filePath -Value ' $ishLngTarget1 = ''VLANGUAGEESES'''
Add-Content -Path $filePath -Value ' $ishLngTarget1Label = ''es-es'''
Add-Content -Path $filePath -Value ' $ishLngTarget2 = ''VLANGUAGEDEDE'''
Add-Content -Path $filePath -Value ' $ishLngTarget2Label = ''de-de'''
Add-Content -Path $filePath -Value ' $ishLngCombination = ''en-us'''
Add-Content -Path $filePath -Value '}'
- name: Pester Test Prerequisites using Windows PowerShell 5.1
shell: powershell
env:
ISH_BASE_URL: ${{ secrets.ISH_BASE_URL }}
ISH_USER_NAME: ${{ secrets.ISH_USER_NAME }}
ISH_PASSWORD: ${{ secrets.ISH_PASSWORD }}
ISH_CLIENT_ID: ${{ secrets.ISH_CLIENT_ID }}
ISH_CLIENT_SECRET: ${{ secrets.ISH_CLIENT_SECRET }}
run: Invoke-Pester -Path Source/ISHRemote/Trisoft.ISHRemote/Cmdlets/_TestEnvironment/TestPrerequisite.Tests.ps1 -Output Detailed -Passthru | Export-CliXml -Path Cmdlets.Pester.Tests.xml
- name: Upload test results
uses: actions/upload-artifact@v7
with:
name: ISHRemote-MainCI-PesterPrerequisiteOnWindowsPowerShell
path: Cmdlets.Pester.Tests.xml
- name: Pester Test Cmdlets using Windows PowerShell 5.1
shell: powershell
env:
ISH_BASE_URL: ${{ secrets.ISH_BASE_URL }}
ISH_USER_NAME: ${{ secrets.ISH_USER_NAME }}
ISH_PASSWORD: ${{ secrets.ISH_PASSWORD }}
ISH_CLIENT_ID: ${{ secrets.ISH_CLIENT_ID }}
ISH_CLIENT_SECRET: ${{ secrets.ISH_CLIENT_SECRET }}
run: Invoke-Pester -Path @('Source/ISHRemote/Trisoft.ISHRemote/Cmdlets/') -ExcludePath @('*GetIshDocumentObj.Tests.ps1','*TestAnonymization.Tests.ps1') -Output Detailed -Passthru | Export-CliXml -Path Cmdlets.Pester.Tests.xml
- name: Upload test results
uses: actions/upload-artifact@v7
with:
name: ISHRemote-MainCI-PesterOnWindowsPowerShell
path: Cmdlets.Pester.Tests.xml
if: ${{ always() }}
- name: "Publish to PowerShellGallery if commit on Main/Master branch holds [PublishToPSGalleryAsPreview]"
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
if: ${{ success() && (github.ref == 'refs/heads/master') && contains(github.event.head_commit.message, '[PublishToPSGalleryAsPreview]') }}
shell: pwsh
run: |
$packageRootFolderPath = "Source/ISHRemote/Trisoft.ISHRemote/bin/Release/ISHRemote/"
$manifestFilePath = Join-Path -Path $packageRootFolderPath -ChildPath "ISHRemote.psd1"
$manifestFileInfo = Get-ChildItem $manifestFilePath
if ($manifestFileInfo -eq $null) { echo "File[$manifestFilePath] not found" }
$moduleManifest = Test-ModuleManifest -Path $manifestFileInfo.FullName
$moduleManifestFileVersion = $moduleManifest.Version
$moduleManifestFileUpdateVersion = $moduleManifest.PrivateData.PSData['Prerelease']
$fullVersion = "$moduleManifestFileVersion-$moduleManifestFileUpdateVersion"
$remoteModule = Find-Module -Name ISHRemote -Repository PSGallery -AllowPrerelease
if($remoteModule.Version -ne $fullVersion)
{
echo ("Found earlier module[ISHRemote] of version["+($remoteModule.Version)+"]. Publishing module with version[$fullVersion]!")
Publish-Module -Path $packageRootFolderPath -Repository PSGallery -NuGetApiKey $env:NUGET_API_KEY -Verbose -Force #-WhatIf -ErrorAction:Continue
}
else
{
echo ("Found recent module[ISHRemote] of version["+($remoteModule.Version)+"]. Skipping publish of module with version[$fullVersion]!")
}
- name: "Publish to PowerShellGallery if commit on Main/Master branch holds [PublishToPSGalleryAsRelease]"
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
if: ${{ success() && (github.ref == 'refs/heads/master') && contains(github.event.head_commit.message, '[PublishToPSGalleryAsRelease]') }}
shell: pwsh
run: |
$packageRootFolderPath = "Source/ISHRemote/Trisoft.ISHRemote/bin/Release/ISHRemote/"
$manifestFilePath = Join-Path -Path $packageRootFolderPath -ChildPath "ISHRemote.psd1"
$manifestFileInfo = Get-ChildItem $manifestFilePath
if ($manifestFileInfo -eq $null) { echo "File[$manifestFilePath] not found" }
(Get-Content -Raw -Path $ManifestFilePath).Replace('Prerelease = ','# Prerelease = ') | Set-Content -Path $ManifestFilePath
$moduleManifest = Test-ModuleManifest -Path $manifestFileInfo.FullName
$moduleManifestFileVersion = $moduleManifest.Version
$fullVersion = "$moduleManifestFileVersion"
$remoteModule = Find-Module -Name ISHRemote -Repository PSGallery
if($remoteModule.Version -ne $fullVersion)
{
echo ("Found earlier module[ISHRemote] of version["+($remoteModule.Version)+"]. Publishing module with version[$fullVersion]!")
Publish-Module -Path $packageRootFolderPath -Repository PSGallery -NuGetApiKey $env:NUGET_API_KEY -Verbose -Force -WhatIf #-ErrorAction:Continue
}
else
{
echo ("Found recent module[ISHRemote] of version["+($remoteModule.Version)+"]. Skipping publish of module with version[$fullVersion]!")
}
- name: "Info: How to publish to Internal/Nexus Repositories"
shell: pwsh
run: |
echo "Either the steps below or in-house https://jenkins-docs.web.sdldev.net/job/Publish-ISHRemote/ job that downloads and publishes to Nexus"
echo "1. Login to Github, navigate to $env:ISHGITHUB_SERVER_URL/$env:ISHGITHUB_REPOSITORY/actions/runs/$env:ISHGITHUB_RUN_ID"
echo "2. Download ISHRemote-MainCI-Module artefact to C:\TEMP\ISHRemote\ISHRemote-MainCI-Module.zip"
echo "3. In a PowerShell Session..."
echo "3a. Remove-Item -Path C:\TEMP\ISHRemote\ToPublish -Recurse -Force"
echo "3b. Expand-Archive -Path C:\TEMP\ISHRemote\ISHRemote-MainCI-Module.zip -DestinationPath C:\TEMP\ISHRemote\ToPublish\ -Force"
echo "3c. Publish-Module -Path C:\TEMP\ISHRemote\ToPublish\ISHRemote.psd1 -Repository $psRepository -NuGetApiKey $nuGetApiKey -Force"
echo "3d. Find-Module -Name ISHRemote -Repository $psRepository -AllowPrerelease"