Skip to content

feat(powershell): add Renew-SectigoCertificate cmdlet #407

feat(powershell): add Renew-SectigoCertificate cmdlet

feat(powershell): add Renew-SectigoCertificate cmdlet #407

Workflow file for this run

name: Test PowerShell Module
on:
push:
branches:
- '*'
paths-ignore:
- 'README.md'
- 'CHANGELOG.md'
- 'Docs/**'
pull_request:
branches:
- '*'
workflow_dispatch:
env:
BUILD_CONFIGURATION: 'Debug'
jobs:
refresh-psd1:
name: 'Refresh PSD1'
runs-on: windows-latest
timeout-minutes: 20
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || github.ref }}
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
9.0.x
8.0.x
- name: Setup PowerShell modules
run: |
Install-Module PSPublishModule -Force -Scope CurrentUser -AllowClobber
shell: pwsh
- name: Refresh module manifest
env:
RefreshPSD1Only: 'true'
run: ./Module/Build/Build-Module.ps1
shell: pwsh
- name: Commit refreshed PSD1
if: ${{ github.event_name == 'push' }}
env:
HEAD_BRANCH: ${{ github.ref_name }}
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add Module/SectigoCertificateManager.psd1
git commit -m "chore: regenerate psd1" || echo "No changes to commit"
git push origin HEAD:$Env:HEAD_BRANCH
- name: Upload refreshed manifest
uses: actions/upload-artifact@v4
with:
name: psd1
path: Module/SectigoCertificateManager.psd1
test-windows-ps5:
name: 'Windows PowerShell 5.1'
needs: refresh-psd1
runs-on: windows-latest
timeout-minutes: 20
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.ref }}
- name: Download manifest
uses: actions/download-artifact@v4
with:
name: psd1
path: Module
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
9.0.x
8.0.x
- name: Install PowerShell modules
shell: powershell
run: |
Write-Host "PowerShell Version: $($PSVersionTable.PSVersion)"
Install-Module -Name Pester -Repository PSGallery -Force -SkipPublisherCheck -AllowClobber
Install-Module -Name PSWriteColor -Repository PSGallery -Force -SkipPublisherCheck -AllowClobber
- name: Build .NET solution
run: |
dotnet restore SectigoCertificateManager.sln
dotnet build SectigoCertificateManager.sln --configuration ${{ env.BUILD_CONFIGURATION }} --no-restore
- name: Run PowerShell tests
shell: powershell
run: ./Module/SectigoCertificateManager.Tests.ps1
test-windows-ps7:
name: 'Windows PowerShell 7'
needs: refresh-psd1
runs-on: windows-latest
timeout-minutes: 20
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.ref }}
- name: Download manifest
uses: actions/download-artifact@v4
with:
name: psd1
path: Module
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
9.0.x
8.0.x
- name: Install PowerShell modules
shell: pwsh
run: |
Write-Host "PowerShell Version: $($PSVersionTable.PSVersion)"
Install-Module -Name Pester -Repository PSGallery -Force -SkipPublisherCheck -AllowClobber
Install-Module -Name PSWriteColor -Repository PSGallery -Force -SkipPublisherCheck -AllowClobber
- name: Build .NET solution
run: |
dotnet restore SectigoCertificateManager.sln
dotnet build SectigoCertificateManager.sln --configuration ${{ env.BUILD_CONFIGURATION }} --no-restore
- name: Run PowerShell tests
shell: pwsh
run: ./Module/SectigoCertificateManager.Tests.ps1
test-linux-ps7:
name: 'Linux PowerShell 7'
needs: refresh-psd1
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.ref }}
- name: Download manifest
uses: actions/download-artifact@v4
with:
name: psd1
path: Module
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
9.0.x
8.0.x
- name: Install Mono
run: |
sudo apt-get update
sudo apt-get install -y mono-complete
- name: Install PowerShell modules
shell: pwsh
run: |
Write-Host "PowerShell Version: $($PSVersionTable.PSVersion)"
Install-Module -Name Pester -Repository PSGallery -Force -SkipPublisherCheck -AllowClobber
Install-Module -Name PSWriteColor -Repository PSGallery -Force -SkipPublisherCheck -AllowClobber
- name: Build .NET solution
run: |
dotnet restore SectigoCertificateManager.sln
dotnet build SectigoCertificateManager.sln --configuration ${{ env.BUILD_CONFIGURATION }} --no-restore
- name: Run PowerShell tests
shell: pwsh
run: ./Module/SectigoCertificateManager.Tests.ps1
test-macos-ps7:
name: 'macOS PowerShell 7'
needs: refresh-psd1
runs-on: macos-latest
timeout-minutes: 20
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.ref }}
- name: Download manifest
uses: actions/download-artifact@v4
with:
name: psd1
path: Module
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
9.0.x
8.0.x
- name: Install Mono
run: brew install mono
- name: Install PowerShell modules
shell: pwsh
run: |
Write-Host "PowerShell Version: $($PSVersionTable.PSVersion)"
Install-Module -Name Pester -Repository PSGallery -Force -SkipPublisherCheck -AllowClobber
Install-Module -Name PSWriteColor -Repository PSGallery -Force -SkipPublisherCheck -AllowClobber
- name: Build .NET solution
run: |
dotnet restore SectigoCertificateManager.sln
dotnet build SectigoCertificateManager.sln --configuration ${{ env.BUILD_CONFIGURATION }} --no-restore
- name: Run PowerShell tests
shell: pwsh
run: ./Module/SectigoCertificateManager.Tests.ps1