Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .buildkite/pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,11 @@ steps:

sg release run test --workdir=. --config-from-commit

# Promote jobs run only for the promote config commit. Creating the promote
# branch also builds its first commit, the internal config commit, which
# --config-from-commit would otherwise accept, running finalize twice.
- label: "(promote) Release: test"
if: build.branch =~ /^promote\/release-.*/ && build.branch !~ /-update-main$/
if: build.branch =~ /^promote\/release-.*/ && build.branch !~ /-update-main$/ && build.message =~ /^promote-release:/
plugins:
- ssh://git@github.com/sourcegraph/sg-buildkite-plugin.git#main: ~
command: |
Expand All @@ -71,7 +74,7 @@ steps:

sg release run internal finalize --workdir=. --config-from-commit
- label: "(promote) Release: finalize"
if: build.branch =~ /^promote\/release-.*/ && build.branch !~ /-update-main$/
if: build.branch =~ /^promote\/release-.*/ && build.branch !~ /-update-main$/ && build.message =~ /^promote-release:/
plugins:
- ssh://git@github.com/sourcegraph/sg-buildkite-plugin.git#main: ~
command: |
Expand Down
11 changes: 10 additions & 1 deletion release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,16 @@ promoteToPublic:
# Create the final branch holding the tagged commit
git checkout "${promote_branch}"
git switch -c "${release_branch}"
git tag {{version}}
# A retried finalize finds its own tag; only a tag elsewhere is an error
if tagged=$(git rev-parse -q --verify "refs/tags/{{version}}^{commit}"); then
if [ "${tagged}" != "$(git rev-parse HEAD)" ]; then
echo "Tag {{version}} already exists at ${tagged}, not at ${promote_branch} ($(git rev-parse HEAD))" >&2
exit 1
fi
echo "Tag {{version}} already points at ${promote_branch}, not recreating it"
else
git tag {{version}}
fi
git push origin ${release_branch} --tags

# Web URL to the tag
Expand Down
Loading