From e3c1093494bdc196e8afb3ab76123140932229be Mon Sep 17 00:00:00 2001 From: godcong Date: Thu, 15 Aug 2024 17:18:38 +0800 Subject: [PATCH] feat(release): set up goreleaser for automated releases Set up a CI/CD workflow using goreleaser to automate the process of creating releases. This includes defining build targets, snapshots, and release archives, as well as integrating with GitHub for publishing. The goreleaser configuration ensures that releases are generated for multiple platforms and architectures. --- cmd/init.go | 5 +---- config/app.go | 3 +++ config/backend.go | 3 +++ config/config.go | 13 +++++++++++++ config/database.go | 3 +++ config/extention.go | 3 +++ config/fontend.go | 3 +++ main.go | 2 +- 8 files changed, 30 insertions(+), 5 deletions(-) diff --git a/cmd/init.go b/cmd/init.go index 06c090f..5868eb0 100644 --- a/cmd/init.go +++ b/cmd/init.go @@ -1,9 +1,6 @@ // Copyright (c) 2024 OrigAdmin. All rights reserved. -// Package cmd defines a CLI command to start a server with various flags and options, including the -// ability to run as a daemon. -// It includes functions to create and manage the command, as well as the logic to run the server. -// It also includes a function to create a new server instance and start it. +// Package cmd defines a CLI command to init the project template. package cmd import ( diff --git a/config/app.go b/config/app.go index 059a9b5..1b56509 100644 --- a/config/app.go +++ b/config/app.go @@ -1,3 +1,6 @@ +// Copyright (c) 2024 OrigAdmin. All rights reserved. + +// Package config is the config package for origen package config type App struct { diff --git a/config/backend.go b/config/backend.go index a4d6cc2..2484307 100644 --- a/config/backend.go +++ b/config/backend.go @@ -1,3 +1,6 @@ +// Copyright (c) 2024 OrigAdmin. All rights reserved. + +// Package config is the config package for origen package config type Backend struct { diff --git a/config/config.go b/config/config.go index fdbfabc..e108690 100644 --- a/config/config.go +++ b/config/config.go @@ -1,3 +1,6 @@ +// Copyright (c) 2024 OrigAdmin. All rights reserved. + +// Package config is the config package for origen package config import ( @@ -66,3 +69,13 @@ var ( func C() Config { return config } + +// LoadGlobal loads config from file +func LoadGlobal(path string) { + once.Do(func() { + err := Load(path, &config) + if err != nil { + panic(err) + } + }) +} diff --git a/config/database.go b/config/database.go index bae6bc9..6d02ad9 100644 --- a/config/database.go +++ b/config/database.go @@ -1,3 +1,6 @@ +// Copyright (c) 2024 OrigAdmin. All rights reserved. + +// Package config is the config package for origen package config type Database struct { diff --git a/config/extention.go b/config/extention.go index 95088f6..e9fe233 100644 --- a/config/extention.go +++ b/config/extention.go @@ -1,3 +1,6 @@ +// Copyright (c) 2024 OrigAdmin. All rights reserved. + +// Package config is the config package for origen package config type Extension struct { diff --git a/config/fontend.go b/config/fontend.go index 8cce03b..ac4bb67 100644 --- a/config/fontend.go +++ b/config/fontend.go @@ -1,3 +1,6 @@ +// Copyright (c) 2024 OrigAdmin. All rights reserved. + +// Package config is the config package for origen package config type Fontend struct { diff --git a/main.go b/main.go index c10d761..a87eaa5 100644 --- a/main.go +++ b/main.go @@ -3,7 +3,7 @@ //go:generate swag init --parseDependency --generalInfo ./main.go --output ./docs // #go:generate docker run --rm -v "${PWD}:/local" openapitools/openapi-generator-cli generate --git-repo-id swagger-api --git-user-id origadmin -i /local/docs/swagger.json -g go-gin-server -o /local/docs/v3 -// Package main is the main package +// Package main is the main package for origen package main import (