diff --git a/Update-Versions.ps1 b/Update-Versions.ps1 index 1b91132..4660b48 100644 --- a/Update-Versions.ps1 +++ b/Update-Versions.ps1 @@ -42,16 +42,10 @@ try { Push-Location $repo } - # Get my versions from generate/definitions/versions.json - $versions = Get-Content $PSScriptRoot/generate/definitions/versions.json -Encoding utf8 | ConvertFrom-Json - # Get new versions - $versionsNew = Invoke-WebRequest https://api.github.com/repos/powershell/powershell/git/refs/tags | ConvertFrom-Json | % { $_.ref -replace 'refs/tags/v', ''} | ? { $_ -match '^\d+\.\d+\.\d+$' } | Sort-Object { [version]$_ } -Descending - # Get changed versions - $versionsChanged = Get-VersionsChanged -Versions $versions -VersionsNew $versionsNew -AsObject -Descending # Update versions.json, and open PRs with CI disabled - $prs = Update-DockerImageVariantsVersions -VersionsChanged $versionsChanged -CommitPreScriptblock { Move-Item .github .github.disabled -Force } -PR:$PR -WhatIf:$WhatIfPreference + $prs = Update-DockerImageVariantsVersions -CommitPreScriptblock { Move-Item .github .github.disabled -Force } -PR:$PR -WhatIf:$WhatIfPreference # Update versions.json, update PRs with CI, merge PRs one at a time, release and close milestone - $return = Update-DockerImageVariantsVersions -VersionsChanged $versionsChanged -PR:$PR -AutoMergeQueue:$AutoMergeQueue -AutoRelease:$AutoRelease -AutoReleaseTagConvention $AutoReleaseTagConvention -WhatIf:$WhatIfPreference + $return = Update-DockerImageVariantsVersions -PR:$PR -AutoMergeQueue:$AutoMergeQueue -AutoRelease:$AutoRelease -AutoReleaseTagConvention $AutoReleaseTagConvention -WhatIf:$WhatIfPreference }catch { throw }finally { diff --git a/generate/definitions/VARIANTS.ps1 b/generate/definitions/VARIANTS.ps1 index f77973b..1a6bb27 100644 --- a/generate/definitions/VARIANTS.ps1 +++ b/generate/definitions/VARIANTS.ps1 @@ -4,7 +4,7 @@ $local:VERSIONS = @( Get-Content $PSScriptRoot/versions.json -Encoding utf8 -raw $local:BASE_IMAGE_TAGS = @( $r = Invoke-RestMethod https://mcr.microsoft.com/v2/powershell/tags/list - foreach ($v in $local:VERSIONS) { + foreach ($v in $local:VERSIONS.pwsh.versions) { $v = [version]$v $r.tags | ? { $_ -match "^(lts-)?$( $v.Major )\.$( $v.Minor )(\.\d+)?-alpine-\d+\.\d+" } | Select-Object -Last 1 } @@ -13,7 +13,7 @@ $local:BASE_IMAGE_TAGS = @( '6.2.4-alpine-3.8' '6.1.3-alpine-3.8' - foreach ($v in $local:VERSIONS) { + foreach ($v in $local:VERSIONS.pwsh.versions) { $v = [version]$v $r.tags | ? { $_ -match "^(lts-)?$( $v.Major )\.$( $v.Minor )(\.\d+)?-ubuntu-\d+\.\d+$" } | Select-Object -Last 1 } diff --git a/generate/definitions/versions.json b/generate/definitions/versions.json index 307c059..e322ba9 100644 --- a/generate/definitions/versions.json +++ b/generate/definitions/versions.json @@ -1,4 +1,7 @@ -[ - "7.3.7", - "7.2.14" -] +{ + "pwsh": { + "versions": ["7.3.7", "7.2.14"], + "versionsChangeScope": "minor", + "versionsNewScript": "Invoke-WebRequest https://api.github.com/repos/powershell/powershell/git/refs/tags | ConvertFrom-Json | % { $_.ref -replace 'refs/tags/v', ''} | ? { $_ -match '^\\d+\\.\\d+\\.\\d+$' } | Sort-Object { [version]$_ } -Descending" + } +}