Skip to content

Commit

Permalink
fix(workflow): use the dev version of the web for beta releases (Alis…
Browse files Browse the repository at this point in the history
…tGo#7862)

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

* chore(config): check version string by prefix
  • Loading branch information
Lanfei authored Jan 23, 2025
1 parent 11b6a60 commit c2633dd
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/release_docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 9 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion internal/bootstrap/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion internal/bootstrap/patch.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ""
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit c2633dd

Please sign in to comment.