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:
Houmgaor
2026-02-01 23:40:40 +01:00
parent 0e2502c9dc
commit dc49e5c34a
2 changed files with 133 additions and 1 deletions

View File

@@ -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")