Skip to content

Commit

Permalink
fix: release version (close alist-org#7182)
Browse files Browse the repository at this point in the history
  • Loading branch information
xhofe authored and 2363839605 committed Sep 20, 2024
1 parent 6071105 commit fac0831
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
appName="alist"
builtAt="$(date +'%F %T %z')"
goVersion=$(go version | sed 's/go version //')
gitAuthor=$(git show -s --format='format:%aN <%ae>' HEAD)
gitAuthor="Xhofe <[email protected]>"
gitCommit=$(git log --pretty=format:"%h" -1)
version="3.36 -fix"
webVersion=$(wget -qO- -t1 -T2 "https://api.github.com/repos/alist-org/alist-web/releases/latest" | grep "tag_name" | head -n 1 | awk -F ":" '{print $2}' | sed 's/\"//g;s/,//g;s/ //g')

if [ "$1" = "dev" ]; then
version="dev"
webVersion="dev"
else
git tag -d beta
version=$(git describe --abbrev=0 --tags)
webVersion=$(wget -qO- -t1 -T2 "https://api.github.com/repos/alist-org/alist-web/releases/latest" | grep "tag_name" | head -n 1 | awk -F ":" '{print $2}' | sed 's/\"//g;s/,//g;s/ //g')
fi

echo "backend version: $version"
echo "frontend version: $webVersion"

ldflags="\
-w -s \
-X 'github.com/alist-org/alist/v3/internal/conf.BuiltAt=$builtAt' \
Expand All @@ -14,9 +25,6 @@ ldflags="\
-X 'github.com/alist-org/alist/v3/internal/conf.Version=$version' \
-X 'github.com/alist-org/alist/v3/internal/conf.WebVersion=$webVersion' \
"
<<<<<<< HEAD
go build -ldflags="$ldflags -s -w" .
=======

FetchWebDev() {
curl -L https://codeload.github.com/alist-org/web-dist/tar.gz/refs/heads/dev -o web-dist-dev.tar.gz
Expand Down Expand Up @@ -295,4 +303,3 @@ elif [ "$1" = "zip" ]; then
else
echo -e "Parameter error"
fi
>>>>>>> 73f0b135b6ee288fa0b5aabe7afdf7856e265f03

0 comments on commit fac0831

Please sign in to comment.