1 Star 0 Fork 0

ChinaLym/docker-pagefind

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
Update-Versions.ps1 2.18 KB
一键复制 编辑 原始数据 按行查看 历史
# This script is to update versions in versions.json, create PR(s) for each bumped version, merge PRs, and release
# It may be run manually or as a cron
# Use -WhatIf for dry run
[CmdletBinding(SupportsShouldProcess)]
param (
[Parameter(HelpMessage="Whether to clone a temporary repo before opening PRs. Useful in development")]
[switch]$CloneTempRepo
,
[Parameter(HelpMessage="Whether to open a PR for each updated version in versions.json")]
[switch]$PR
,
[Parameter(HelpMessage="Whether to merge each PR one after another (note that this is not GitHub merge queue which cannot handle merge conflicts). The queue ensures each PR is rebased to prevent merge conflicts")]
[switch]$AutoMergeQueue
,
[Parameter(HelpMessage="Whether to create a tagged release and closing milestone, after merging all PRs")]
[switch]$AutoRelease
,
[Parameter(HelpMessage="-AutoRelease tag convention")]
[ValidateSet('calver', 'semver')]
[string]$AutoReleaseTagConvention = 'calver'
)
$ErrorActionPreference = 'Stop'
Set-StrictMode -Version Latest
# Install modules
@(
'Generate-DockerImageVariantsHelpers'
'Powershell-Yaml'
) | % {
if (! (Get-InstalledModule $_ -ErrorAction SilentlyContinue) ) {
Install-Module $_ -Scope CurrentUser -Force
}
}
# Override with development module if it exists
if (Test-Path ../Generate-DockerImageVariantsHelpers/src/Generate-DockerImageVariantsHelpers) {
Import-module ../Generate-DockerImageVariantsHelpers/src/Generate-DockerImageVariantsHelpers -Force
}
try {
if ($CloneTempRepo) {
$repo = Clone-TempRepo
Push-Location $repo
}
# Update versions.json, and open PRs with CI disabled
$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 -PR:$PR -AutoMergeQueue:$AutoMergeQueue -AutoRelease:$AutoRelease -AutoReleaseTagConvention $AutoReleaseTagConvention -WhatIf:$WhatIfPreference
}catch {
throw
}finally {
if ($CloneTempRepo) {
Pop-Location
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ChinaLym/docker-pagefind.git
git@gitee.com:ChinaLym/docker-pagefind.git
ChinaLym
docker-pagefind
docker-pagefind
master

搜索帮助