mirror of
https://github.com/Mezeporta/Erupe.git
synced 2026-03-25 00:54:05 +01:00
feat(ci): add release automation workflow
Add GitHub Actions workflow that triggers on version tags (v*) to automatically build release artifacts and create GitHub releases. - Build matrix for Linux and Windows (amd64) - Create proper archives (.tar.gz and .zip) - Inject version via ldflags at build time - Extract release notes from CHANGELOG.md - Detect pre-release tags (-alpha, -beta, -rc) - Add Version variable to main.go for runtime version display
This commit is contained in:
9
main.go
9
main.go
@@ -33,6 +33,9 @@ func cleanDB(db *sqlx.DB) {
|
||||
_ = db.MustExec("DELETE FROM users")
|
||||
}
|
||||
|
||||
// Version is set at build time via -ldflags "-X main.Version=v1.0.0"
|
||||
var Version = "dev"
|
||||
|
||||
var Commit = func() string {
|
||||
if info, ok := debug.ReadBuildInfo(); ok {
|
||||
for _, setting := range info.Settings {
|
||||
@@ -117,7 +120,11 @@ func main() {
|
||||
defer zapLogger.Sync()
|
||||
logger := zapLogger.Named("main")
|
||||
|
||||
logger.Info(fmt.Sprintf("Starting Erupe (9.2-%s)", Commit()))
|
||||
if Version == "dev" {
|
||||
logger.Info(fmt.Sprintf("Starting Erupe (dev-%s)", Commit()))
|
||||
} else {
|
||||
logger.Info(fmt.Sprintf("Starting Erupe (%s-%s)", Version, Commit()))
|
||||
}
|
||||
|
||||
if config.ErupeConfig.Database.Password == "" {
|
||||
preventClose("Database password is blank")
|
||||
|
||||
Reference in New Issue
Block a user