Files
yellowjacket/main.go
T
logan caf3e843af feat(ci): add semantic-release pipeline, cross-platform builds, and lefthook git hooks
- Replace single wails.yml with three-workflow pipeline: ci.yml (PR checks),
  release.yml (semantic-release on main), build.yml (versioned builds on tag)
- PR pipeline: conventional commit lint, golangci-lint, govulncheck, go test,
  codegen freshness check, frontend type-check, cross-platform build verification
- Release pipeline: semantic-release with auto-changelog and draft GitHub releases
- Build pipeline: versioned linux/amd64, darwin/universal, windows/amd64 binaries
  with version and commit SHA injected via ldflags
- Add lefthook as go tool for pre-commit (vet, lint, codegen, tsc) and
  pre-push (test, mod verify) git hooks
- Fix golangci-lint gci config to enforce three-group import style
- Upgrade Go to 1.25
- Add version/commit variables to main.go for build-time injection
- Add lint, test, vulncheck, and setup targets to Makefile
2026-02-13 21:26:33 -06:00

84 lines
1.9 KiB
Go

// Package main is the entry point for the Yellowjacket application.
package main
import (
"embed"
"log/slog"
"os"
"github.com/golang-cz/devslog"
"github.com/wailsapp/wails/v2"
"github.com/wailsapp/wails/v2/pkg/options"
"yellowjacket/backend"
"yellowjacket/backend/assets"
"yellowjacket/backend/logging"
"yellowjacket/internal/dev"
)
// version and commit are set at build time via ldflags.
var (
version = "dev"
commit = "unknown"
)
//go:embed all:frontend/dist
var frontendDistAssets embed.FS
func main() {
isDev := dev.IsDev
// create sLogger
var loglevel slog.Level
if isDev {
loglevel = slog.LevelDebug
} else {
loglevel = slog.LevelInfo
}
sLogger := slog.New(devslog.NewHandler(os.Stdout, &devslog.Options{
HandlerOptions: &slog.HandlerOptions{
Level: loglevel,
},
}))
slog.SetDefault(sLogger)
sLogger.Info("starting yellowjacket", "version", version, "commit", commit)
// create asset handler
assetHandler, err := assets.NewAssetHandler(sLogger, frontendDistAssets)
if err != nil {
sLogger.Error("could not create asset handler", "err", err.Error())
os.Exit(1)
}
yjApp, err := backend.NewYellowJacketApp(sLogger, assetHandler)
if err != nil {
sLogger.Error("problem initializing yellowjacket", "err", err.Error())
os.Exit(1)
}
// Create application with options
err = wails.Run(&options.App{
Title: "yellowjacket",
Width: 512,
Height: 384,
Logger: logging.NewLogger(
sLogger,
[]string{},
),
AssetServer: assetHandler.Options,
BackgroundColour: &options.RGBA{R: 27, G: 38, B: 54, A: 1},
OnStartup: yjApp.OnStartup,
OnDomReady: yjApp.OnDomReady,
OnShutdown: yjApp.OnShutdown,
Bind: yjApp.FEBindings,
MinWidth: 512,
MinHeight: 384,
MaxWidth: 0,
MaxHeight: 0,
})
if err != nil {
sLogger.Error("application error", "err", err.Error())
os.Exit(1)
}
}