-
Notifications
You must be signed in to change notification settings - Fork 642
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Kay Yan <[email protected]>
- Loading branch information
Showing
1 changed file
with
24 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 |
---|---|---|
|
@@ -64,15 +64,37 @@ jobs: | |
<(sed -E 's/^go([0-9]+)[.]([0-9]+)([.]([0-9]+))?(([a-z]+)([0-9]+))?/\1.\2\n\4\n\6\n\7/i' \ | ||
<(curl -fsSL "https://go.dev/dl/?mode=json&include=all" | jq -rc .[0].version) \ | ||
) | ||
echo "${norm[0]}" | ||
echo "${norm[1]}" | ||
echo "${norm[2]}" | ||
echo "${norm[3]}" | ||
# Serialize version, making sure we have a patch version, and separate possible rcX into .rc-X | ||
[ "${norm[1]}" != "" ] || norm[1]="0" | ||
norm[1]=".${norm[1]}" | ||
[ "${norm[2]}" == "" ] || norm[2]="-${norm[2]}" | ||
[ "${norm[3]}" == "" ] || norm[3]=".${norm[3]}" | ||
if [ -n "${norm[3]}" ]; then | ||
echo "norm3 meet" | ||
length=${#norm[3]} | ||
echo "Character length $length" | ||
for ((i = 0; i < length; i++)); do | ||
char="${norm[3]:i:1}" | ||
echo "Character at position $i: $char" | ||
ascii_value=$(printf "%d" "'$char") | ||
echo "ASCII value of $char: $ascii_value" | ||
done | ||
norm[3]="${norm[3]//+([[:space:]])/}" # 移除所有空白字符 | ||
[ "${norm[3]}" == "" ] || norm[3]=".${norm[3]}" | ||
fi | ||
# Save it | ||
IFS= | ||
echo "GO_VERSION=${norm[*]}" >> $GITHUB_ENV | ||
echo "${norm[0]}" | ||
echo "${norm[1]}" | ||
echo "${norm[2]}" | ||
echo "${norm[3]}" | ||
echo "${norm[*]}" | ||
- uses: actions/[email protected] | ||
with: | ||
fetch-depth: 1 | ||
|