Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

Commit

Permalink
release: execute gh via bazel (#62553)
Browse files Browse the repository at this point in the history
* use bazel to execute gh

* change gh execution
  • Loading branch information
BolajiOlajide authored May 8, 2024
1 parent f182cc1 commit 58a2e1b
Showing 1 changed file with 13 additions and 21 deletions.
34 changes: 13 additions & 21 deletions release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,6 @@ requirements:
- promoteToPublic.create
# `write_builds` permission is all that's needed here
# You also need to ensure you add access to the Sourcegraph organization on Buildkite.
- name: "GitHub CLI"
cmd: "which gh"
only:
- promoteToPublic.finalize
- name: "GitHub CLI auth status"
cmd: "gh auth status"
only:
- promoteToPublic.finalize

# announce-engineering slack webhook url:
# https://start.1password.com/open/i?a=HEDEDSLHPBFGRBTKAKJWE23XX4&v=dnrhbauihkhjs5ag6vszsme45a&i=pldpna5vivapxe4phewnqd42ji&h=team-sourcegraph.1password.com
Expand Down Expand Up @@ -225,19 +217,19 @@ promoteToPublic:
- name: 'Promote on release registry'
cmd: |
echo "Promoting sourcegraph/sourcegraph {{version}} release on release registry"
body=$(wget --content-on-error -O- --header="Content-Type: application/json" --header="Authorization: ${RELEASE_REGISTRY_TOKEN}" --post-data '' "https://releaseregistry.sourcegraph.com/v1/releases/sourcegraph/{{version}}/promote")
exit_code=$?
body=$(wget --content-on-error -O- --header="Content-Type: application/json" --header="Authorization: ${RELEASE_REGISTRY_TOKEN}" --post-data '' "https://releaseregistry.sourcegraph.com/v1/releases/sourcegraph/{{version}}/promote")
exit_code=$?
if [ $exit_code != 0 ]; then
echo "❌ Failed to promote release on release registry, got:"
echo "--- raw body ---"
echo $body
echo "--- raw body ---"
exit $exit_code
else
echo "Release promoted, see:"
echo $body
fi
if [ $exit_code != 0 ]; then
echo "❌ Failed to promote release on release registry, got:"
echo "--- raw body ---"
echo $body
echo "--- raw body ---"
exit $exit_code
else
echo "Release promoted, see:"
echo $body
fi
- name: 'git:tag'
cmd: |
set -eu
Expand Down Expand Up @@ -281,7 +273,7 @@ promoteToPublic:
- [Release post](https://sourcegraph.com/blog/release/${month_name}-${current_year})
EndOfText
gh release create ${version} --latest --verify-tag -t "Sourcegraph ${tag}" --generate-notes --notes "${releasepost}"
bazel run //dev/tools:gh -- release create ${version} --latest --verify-tag -t "Sourcegraph ${tag}" --generate-notes --notes "${releasepost}"
# tag is usually in the format `5.3.2`
# while version is usually the tag prepended with a v, `v5.3.2`
Expand Down

0 comments on commit 58a2e1b

Please sign in to comment.