Skip to content

Commit

Permalink
feat: update
Browse files Browse the repository at this point in the history
  • Loading branch information
RayWangQvQ committed Mar 4, 2023
1 parent ad4804d commit bf2a5b1
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
pwd && ls
cd ./scripts
chmod +x ./publish.sh
. publish.sh
. publish.sh --runtime all
- name: Get release content
id: release_content
Expand Down
40 changes: 37 additions & 3 deletions scripts/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,35 @@ repoDir=$(dirname $PWD)
consoleDir=$repoDir/src/Ray.BiliBiliTool.Console
publishDir=$consoleDir/bin/Publish
version=""
runTime=""
# --------------------------

read_params_from_init_cmd() {
while [ $# -ne 0 ]; do
name="$1"
case "$name" in
-r | --runtime | -[Rr]untime)
shift
runTime="$1"
;;
*)
say_err "Unknown argument \`$name\`"
exit 1
;;
esac
shift
done
}

read_var_from_user() {
# runTime
if [ -z "$runTime" ]; then
read -p 'please input runTime("all" "win-x86" "win-x64" "win-arm64" "linux-x64" "linux-musl-x64" "linux-arm64" "linux-arm" "osx-x64")' runTime
else
echo "runTime: $runTime"
fi
}

get_version() {
version=$(grep -oP '(?<=<Version>).*?(?=<\/Version>)' $repoDir/common.props)
echo -e "current version: $version \n\n"
Expand Down Expand Up @@ -87,6 +114,9 @@ publish_tencentScf() {
}

main() {
read_params_from_init_cmd $*
read_var_from_user

get_version

# dotnet dependent
Expand All @@ -95,12 +125,16 @@ main() {
# self contained
# https://learn.microsoft.com/zh-cn/dotnet/core/rid-catalog
array=("win-x86" "win-x64" "win-arm64" "linux-x64" "linux-musl-x64" "linux-arm64" "linux-arm" "osx-x64")
if [ "$runTime" != "all" ]; then
array=("$runTime")
fi
for i in "${array[@]}"; do
echo "$i"
publish_self_contained $i
done

publish_tencentScf
if [ "$runTime" == "all" ]; then
publish_tencentScf
fi
}

main
main $*

0 comments on commit bf2a5b1

Please sign in to comment.