diff --git a/.github/workflows/powershell-module-ci.yml b/.github/workflows/powershell-module-ci.yml new file mode 100644 index 000000000..49e07b8e1 --- /dev/null +++ b/.github/workflows/powershell-module-ci.yml @@ -0,0 +1,16 @@ +name: PowerShell Module CI +on: [push] +jobs: + Publish-PowerShell-Artifact: + runs-on: ubuntu-latest + env: + source: CodeArtifact + steps: + - uses: actions/checkout@v4 + with: + sparse-checkout: | + PowerShell/Deploy + PowerShell/JumpCloud\ Module + - shell: pwsh + run: | + . "./PowerShell/Deploy/BuildNuspecFromPsd1.ps1" -RequiredModulesRepo PSGallery diff --git a/PowerShell/Deploy/BuildNuspecFromPsd1.ps1 b/PowerShell/Deploy/BuildNuspecFromPsd1.ps1 index 8cfc30629..09e39ab12 100644 --- a/PowerShell/Deploy/BuildNuspecFromPsd1.ps1 +++ b/PowerShell/Deploy/BuildNuspecFromPsd1.ps1 @@ -92,8 +92,8 @@ function New-NuspecFile { # Append buildNumber if ($env:Source -eq "CodeArtifact") { $date = (Get-Date).ToString("yyyyMMddHHmm") - # $BuildString = "build$($env:CIRCLE_BUILD_NUM)datetime$($date)" - $build = $($env:CIRCLE_BUILD_NUM) + # $BuildString = "build$($env:GITHUB_RUN_NUMBER)datetime$($date)" + $build = $($env:GITHUB_RUN_NUMBER) $Version = $Version + ".$($build)" + "-$date" } @@ -178,7 +178,7 @@ $Psd1 = Import-PowerShellDataFile -Path:($FilePath_psd1) $params = @{ OutputPath = $FolderPath_Module Id = $(Get-Item ($FilePath_psd1)).BaseName - buildNumber = $env:CIRCLE_BUILD_NUM + buildNumber = $env:GITHUB_RUN_NUMBER Version = $Psd1.ModuleVersion Authors = $Psd1.Author Owners = $Psd1.CompanyName diff --git a/PowerShell/Deploy/Setup-Dependencies.ps1 b/PowerShell/Deploy/Setup-Dependencies.ps1 index 47ede2340..2711a367c 100644 --- a/PowerShell/Deploy/Setup-Dependencies.ps1 +++ b/PowerShell/Deploy/Setup-Dependencies.ps1 @@ -10,9 +10,9 @@ If (!(Get-PackageProvider -Name:('NuGet') -ListAvailable -ErrorAction:('Silently $PSDependencies = @{ 'PowerShellGet' = @{Repository = 'PSGallery'; RequiredVersion = '3.0.12-beta' } 'PackageManagement' = @{Repository = 'PSGallery'; RequiredVersion = '1.4.8.1' } - 'PSScriptAnalyzer' = @{Repository = 'PSGallery'; RequiredVersion = '1.19.1' } + # 'PSScriptAnalyzer' = @{Repository = 'PSGallery'; RequiredVersion = '1.19.1' } 'PlatyPS' = @{Repository = 'PSGallery'; RequiredVersion = '0.14.2' } - 'Pester' = @{Repository = 'PSGallery'; RequiredVersion = '5.3.3' } + # 'Pester' = @{Repository = 'PSGallery'; RequiredVersion = '5.3.3' } 'AWS.Tools.Common' = @{Repository = 'PSGallery'; RequiredVersion = '4.1.122' } 'AWS.Tools.CodeArtifact' = @{Repository = 'PSGallery'; RequiredVersion = '4.1.122' } }