mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore(scripts): auto create autoversion PR from release script (#13074)
Ref #12465
This commit is contained in:
+11
-5
@@ -381,12 +381,18 @@ func (r *releaseCommand) autoversionFile(ctx context.Context, file, channel, ver
|
||||
}
|
||||
}
|
||||
if matchRe != nil {
|
||||
// Apply matchRe and find the group named "version", then replace it with the new version.
|
||||
// Utilize the index where the match was found to replace the correct part. The only
|
||||
// match group is the version.
|
||||
// Apply matchRe and find the group named "version", then replace it
|
||||
// with the new version.
|
||||
if match := matchRe.FindStringSubmatchIndex(line); match != nil {
|
||||
logger.Info(ctx, "updating version number", "line_number", i+1, "match", match)
|
||||
lines[i] = line[:match[2]] + version + line[match[3]:]
|
||||
vg := matchRe.SubexpIndex("version")
|
||||
if vg == -1 {
|
||||
logger.Error(ctx, "version group not found in match", "num_subexp", matchRe.NumSubexp(), "subexp_names", matchRe.SubexpNames(), "match", match)
|
||||
return xerrors.Errorf("bug: version group not found in match")
|
||||
}
|
||||
start := match[vg*2]
|
||||
end := match[vg*2+1]
|
||||
logger.Info(ctx, "updating version number", "line_number", i+1, "match_start", start, "match_end", end, "old_version", line[start:end])
|
||||
lines[i] = line[:start] + version + line[end:]
|
||||
matchRe = nil
|
||||
break
|
||||
}
|
||||
|
||||
@@ -191,7 +191,7 @@ fi
|
||||
|
||||
# Ensure the ref is in the release branch.
|
||||
branch_contains_ref=$(git branch --contains "${ref}" --list "${release_branch}" --format='%(refname)')
|
||||
if [[ -z $branch_contains_ref ]]; then
|
||||
if ((!dry_run)) && [[ -z $branch_contains_ref ]]; then
|
||||
error "Provided ref (${ref_name}) is not in the required release branch (${release_branch})."
|
||||
fi
|
||||
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
# Some documentation
|
||||
|
||||
1. Run the following command to install the chart in your cluster.
|
||||
|
||||
For the **mainline** Coder release:
|
||||
|
||||
<!-- autoversion(mainline): "--version [version] # trailing comment!" -->
|
||||
|
||||
```shell
|
||||
helm install coder coder-v2/coder \
|
||||
--namespace coder \
|
||||
--values values.yaml \
|
||||
--version 2.10.0 # trailing comment!
|
||||
```
|
||||
@@ -0,0 +1,14 @@
|
||||
# Some documentation
|
||||
|
||||
1. Run the following command to install the chart in your cluster.
|
||||
|
||||
For the **mainline** Coder release:
|
||||
|
||||
<!-- autoversion(mainline): "--version [version] # trailing comment!" -->
|
||||
|
||||
```shell
|
||||
helm install coder coder-v2/coder \
|
||||
--namespace coder \
|
||||
--values values.yaml \
|
||||
--version 2.11.1 # trailing comment!
|
||||
```
|
||||
Reference in New Issue
Block a user