mirror of
https://github.com/AlistGo/alist.git
synced 2025-04-23 22:04:06 +08:00
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
This commit is contained in:
parent
11b6a6012f
commit
c2633dd443
7
.github/workflows/release_docker.yml
vendored
7
.github/workflows/release_docker.yml
vendored
@ -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
|
||||
|
11
build.sh
11
build.sh
@ -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
|
||||
|
@ -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
|
||||
|
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user