-
Notifications
You must be signed in to change notification settings - Fork 538
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: support additional version postfixes (#5096)
* chore: support additional version postfixes * chore: change default version * chore: add comment
- Loading branch information
1 parent
2fa7192
commit 14f31dd
Showing
2 changed files
with
54 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
|
||
# This script determines the appropriate release channel for a project based on | ||
# the current Git branch. The script should always return a string value that | ||
# matches one of the supported channels. | ||
# | ||
# The following release channels are supported: | ||
# - stable | ||
# - rc | ||
# - preview | ||
# - dev | ||
|
||
|
||
# enable support for stable, preview and other release channels | ||
ENABLE_STABLE_CHANNELS=false | ||
|
||
CURRENT_BRANCH="$(git rev-parse --abbrev-ref HEAD)" | ||
if [ $ENABLE_STABLE_CHANNELS == true ]; then # support for stable, preview and release candidate | ||
if [ "$CURRENT_BRANCH" == "main" ]; then | ||
echo "preview" | ||
elif [ "$CURRENT_BRANCH" == "release-candidate" ]; then | ||
echo "rc" | ||
elif [[ "$CURRENT_BRANCH" == release/* ]]; then | ||
echo "stable" | ||
else | ||
echo "dev" | ||
fi | ||
else # legacy release channels | ||
if [ "$CURRENT_BRANCH" == "main" ]; then | ||
echo "stable" | ||
else | ||
echo "dev" | ||
fi | ||
fi | ||
|
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