-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Add script/determine-release-channel (#18476)
- Refactor duplicated inline script from ci.yml to `script/determine-release-channel` - Remove references to non-existent '-nightly' release tags Release Notes: - N/A
- Loading branch information
Showing
3 changed files
with
43 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
if [ -z "${GITHUB_ACTIONS-}" ]; then | ||
echo "Error: This script must be run in a GitHub Actions environment" | ||
exit 1 | ||
elif [ -z "${GITHUB_REF-}" ]; then | ||
# This should be the release tag 'v0.x.x' | ||
echo "Error: GITHUB_REF is not set" | ||
exit 1 | ||
fi | ||
|
||
version=$(script/get-crate-version zed) | ||
channel=$(cat crates/zed/RELEASE_CHANNEL) | ||
echo "Publishing version: ${version} on release channel ${channel}" | ||
echo "RELEASE_CHANNEL=${channel}" >> $GITHUB_ENV | ||
|
||
expected_tag_name="" | ||
case ${channel} in | ||
stable) | ||
expected_tag_name="v${version}";; | ||
preview) | ||
expected_tag_name="v${version}-pre";; | ||
*) | ||
echo "can't publish a release on channel ${channel}" | ||
exit 1;; | ||
esac | ||
if [[ $GITHUB_REF_NAME != $expected_tag_name ]]; then | ||
echo "invalid release tag ${GITHUB_REF_NAME}. expected ${expected_tag_name}" | ||
exit 1 | ||
fi |