@@ -19,6 +19,7 @@ import (
1919 "time"
2020
2121 "github.com/evolution-cms/installer/internal/domain"
22+ "github.com/evolution-cms/installer/internal/services/github"
2223 "github.com/evolution-cms/installer/internal/services/release"
2324)
2425
@@ -1506,7 +1507,42 @@ func (e *Engine) maybeOfferSelfUpdate(ctx context.Context, emit func(domain.Even
15061507 CacheTTL : 12 * time .Hour ,
15071508 })
15081509 if err != nil || info .HighestVersion == "" {
1509- return false
1510+ // Fall back to GitHub's "latest" release endpoint (ignores pre-releases),
1511+ // matching the PHP bootstrapper's self-update behavior.
1512+ rel , err2 := github .FetchLatestRelease (ctx , "evolution-cms" , "installer" )
1513+ if err2 != nil || strings .TrimSpace (rel .TagName ) == "" {
1514+ if err2 == nil {
1515+ err2 = err
1516+ }
1517+ if err2 != nil {
1518+ _ = emit (domain.Event {
1519+ Type : domain .EventWarning ,
1520+ StepID : stepID ,
1521+ Source : "install" ,
1522+ Severity : domain .SeverityWarn ,
1523+ Payload : domain.LogPayload {
1524+ Message : "Unable to check for installer updates." ,
1525+ Fields : map [string ]string {"error" : err2 .Error ()},
1526+ },
1527+ })
1528+ }
1529+ return false
1530+ }
1531+
1532+ tagName := strings .TrimSpace (rel .TagName )
1533+ highest := strings .TrimPrefix (strings .TrimPrefix (tagName , "v" ), "V" )
1534+ if highest == "" {
1535+ highest = tagName
1536+ }
1537+ tag := tagName
1538+ if ! strings .HasPrefix (strings .ToLower (tag ), "v" ) && highest != "" {
1539+ tag = "v" + highest
1540+ }
1541+ info = domain.ReleaseInfo {
1542+ Repo : "evolution-cms/installer" ,
1543+ Tag : tag ,
1544+ HighestVersion : highest ,
1545+ }
15101546 }
15111547
15121548 newMaj , newMin , newPatch , ok := parseVersionForCompare (info .HighestVersion )
0 commit comments