fix(workflow): use the dev version of the web for beta releases (#7862)

* fix(workflow): use dev version of the web for beta releases

* chore(config): check version string by prefix
pull/7080/merge
Jealous 2025-01-23 22:49:35 +08:00 committed by GitHub
parent 11b6a6012f
commit c2633dd443
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 18 additions and 5 deletions

View File

@ -52,7 +52,12 @@ jobs:
if: steps.cache-musl.outputs.cache-hit != 'true'
run: bash build.sh prepare docker-multiplatform
- name: Build go binary
- name: Build go binary (beta)
if: env.IMAGE_IS_PROD != 'true'
run: bash build.sh beta docker-multiplatform
- name: Build go binary (release)
if: env.IMAGE_IS_PROD == 'true'
run: bash build.sh release docker-multiplatform
- name: Upload artifacts

View File

@ -7,6 +7,9 @@ gitCommit=$(git log --pretty=format:"%h" -1)
if [ "$1" = "dev" ]; then
version="dev"
webVersion="dev"
elif [ "$1" = "beta" ]; then
version="beta"
webVersion="dev"
else
git tag -d beta
version=$(git describe --abbrev=0 --tags)
@ -301,8 +304,12 @@ if [ "$1" = "dev" ]; then
else
BuildDev
fi
elif [ "$1" = "release" ]; then
FetchWebRelease
elif [ "$1" = "release" -o "$1" = "beta" ]; then
if [ "$1" = "beta" ]; then
FetchWebDev
else
FetchWebRelease
fi
if [ "$2" = "docker" ]; then
BuildDocker
elif [ "$2" = "docker-multiplatform" ]; then

View File

@ -50,7 +50,7 @@ func InitConfig() {
log.Fatalf("load config error: %+v", err)
}
LastLaunchedVersion = conf.Conf.LastLaunchedVersion
if conf.Version != "dev" || LastLaunchedVersion == "" {
if strings.HasPrefix(conf.Version, "v") || LastLaunchedVersion == "" {
conf.Conf.LastLaunchedVersion = conf.Version
}
// update config.json struct

View File

@ -5,6 +5,7 @@ import (
"github.com/alist-org/alist/v3/internal/bootstrap/patch"
"github.com/alist-org/alist/v3/internal/conf"
"github.com/alist-org/alist/v3/pkg/utils"
"strings"
)
var LastLaunchedVersion = ""
@ -38,7 +39,7 @@ func compareVersion(majorA, minorA, patchNumA, majorB, minorB, patchNumB int) bo
}
func InitUpgradePatch() {
if conf.Version == "dev" {
if !strings.HasPrefix(conf.Version, "v") {
return
}
if LastLaunchedVersion == conf.Version {