Strengthen import validation (manifest + help) and harden Gitea workflow

This commit is contained in:
GraceSolutions
2026-06-02 13:25:18 -04:00
parent 5801b4774a
commit fa65c18bc1
5 changed files with 115 additions and 14 deletions
+41 -2
View File
@@ -20,10 +20,48 @@ jobs:
with:
dotnet-version: '8.0.x'
- name: Build and test module
- name: Install PowerShell 7 (if not present)
shell: bash
run: |
set -euo pipefail
if command -v pwsh >/dev/null 2>&1; then
echo "pwsh already installed: $(pwsh --version)"
exit 0
fi
sudo apt-get update
sudo apt-get install -y --no-install-recommends wget ca-certificates apt-transport-https gnupg
source /etc/os-release
wget -q "https://packages.microsoft.com/config/ubuntu/${VERSION_ID}/packages-microsoft-prod.deb" -O /tmp/ms-prod.deb
sudo dpkg -i /tmp/ms-prod.deb
rm -f /tmp/ms-prod.deb
sudo apt-get update
sudo apt-get install -y powershell
pwsh --version
- name: Bootstrap PowerShellGet / NuGet provider
shell: pwsh
run: |
./build.ps1 -RunTests
$ErrorActionPreference = 'Stop'
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
if (-not (Get-PackageProvider -Name NuGet -ListAvailable -ErrorAction SilentlyContinue)) {
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force -Scope CurrentUser | Out-Null
}
Get-PackageProvider -Name NuGet | Format-Table Name,Version
- name: Build and test module
shell: pwsh
run: ./build.ps1 -RunTests
- name: Validate module manifest
shell: pwsh
run: |
$ErrorActionPreference = 'Stop'
$manifestPath = Join-Path $PWD 'Module/PSInfisicalAPI/PSInfisicalAPI.psd1'
$manifest = Test-ModuleManifest -Path $manifestPath
Write-Host "Manifest OK: $($manifest.Name) $($manifest.Version)"
- name: Verify PowerShell Gallery API key is configured
shell: pwsh
@@ -39,6 +77,7 @@ jobs:
env:
PSGALLERY_API_KEY: ${{ secrets.PSGALLERY_API_KEY }}
run: |
$ErrorActionPreference = 'Stop'
$moduleDir = Join-Path $PWD 'Module/PSInfisicalAPI'
Write-Host "Publishing module from: $moduleDir"
Publish-Module `