🚀 Update build and release workflows
This commit is contained in:
@@ -20,6 +20,8 @@ const (
|
||||
ModShift = darwin.ModShift
|
||||
ModOption = darwin.ModOption
|
||||
ModCmd = darwin.ModCmd
|
||||
ModAlt = darwin.ModOption // Alias for ModOption (Alt key on macOS)
|
||||
ModWin = darwin.ModCmd // Alias for ModCmd (Cmd key is like Win key)
|
||||
)
|
||||
|
||||
// Key represents a key.
|
||||
|
||||
@@ -19,6 +19,7 @@ const (
|
||||
ModCtrl = linux.ModCtrl
|
||||
ModShift = linux.ModShift
|
||||
ModAlt = linux.ModAlt // Alias for Mod1
|
||||
ModWin = linux.Mod4 // Super/Windows key is typically Mod4 on Linux
|
||||
Mod1 = linux.Mod1
|
||||
Mod2 = linux.Mod2
|
||||
Mod3 = linux.Mod3
|
||||
|
||||
@@ -218,23 +218,3 @@ func NewDefaultAppConfig() *AppConfig {
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
// GetVersion 获取配置版本
|
||||
func (ac *AppConfig) GetVersion() string {
|
||||
return ac.Metadata.Version
|
||||
}
|
||||
|
||||
// SetVersion 设置配置版本
|
||||
func (ac *AppConfig) SetVersion(version string) {
|
||||
ac.Metadata.Version = version
|
||||
}
|
||||
|
||||
// SetLastUpdated 设置最后更新时间
|
||||
func (ac *AppConfig) SetLastUpdated(timeStr string) {
|
||||
ac.Metadata.LastUpdated = timeStr
|
||||
}
|
||||
|
||||
// GetDefaultConfig 获取默认配置
|
||||
func (ac *AppConfig) GetDefaultConfig() any {
|
||||
return NewDefaultAppConfig()
|
||||
}
|
||||
|
||||
@@ -302,7 +302,9 @@ func (s *SelfUpdateService) handleUpdateSuccess(result *SelfUpdateResult) {
|
||||
if err := s.configService.Set("updates.version", result.LatestVersion); err != nil {
|
||||
s.logger.Error("update config version failed", "error", err)
|
||||
}
|
||||
|
||||
if err := s.configService.Set("metadata.version", result.LatestVersion); err != nil {
|
||||
s.logger.Error("update config version failed", "error", err)
|
||||
}
|
||||
// 执行配置迁移
|
||||
if err := s.configService.MigrateConfig(); err != nil {
|
||||
s.logger.Error("migrate config failed", "error", err)
|
||||
|
||||
Reference in New Issue
Block a user