enable gitea actions

This commit is contained in:
Aleksandr Trushkin
2024-02-02 18:24:00 +03:00
parent 3754441492
commit 91b0dd5c4f
9 changed files with 124 additions and 44 deletions

View File

@ -19,6 +19,7 @@ import (
"strconv"
"time"
rooteway "git.loyso.art/frx/eway"
"git.loyso.art/frx/eway/cmd/cli/components"
"git.loyso.art/frx/eway/internal/crypto"
"git.loyso.art/frx/eway/internal/encoding/fbs"
@ -68,23 +69,7 @@ func setupDI() cli.BeforeFunc {
func releaseDI() cli.AfterFunc {
return func(ctx context.Context, c *cli.Command) error {
log, err := components.GetLogger()
if err != nil {
return fmt.Errorf("getting logger: %w", err)
}
start := time.Now()
defer func() {
since := time.Since(start)
if err == nil {
return
}
log.Err(err).Dur("elapsed", since).Msg("shutdown finished")
}()
return components.Shutdown()
}
}
@ -92,6 +77,7 @@ func setupCLI() *cli.Command {
app := &cli.Command{
Name: "cli",
Description: "a cli for running eway logic",
Version: fmt.Sprintf("%s (%s) %s", rooteway.Version(), rooteway.Commit(), rooteway.BuildTime()),
Flags: []cli.Flag{
&cli.StringFlag{
Name: "config",
@ -117,6 +103,12 @@ func setupCLI() *cli.Command {
return app
}
func newVersionCmd() *cli.Command {
return &cli.Command{
Name: "version",
}
}
func newCryptoCmd() *cli.Command {
return &cli.Command{
Name: "crypto",
@ -143,21 +135,6 @@ func newCryptoEncyptCmd() *cli.Command {
}
}
func newCryptoDecryptCmd() *cli.Command {
return &cli.Command{
Name: "decrypt",
Usage: "decrypt incoming text",
Flags: []cli.Flag{
&cli.StringFlag{
Name: "text",
Aliases: []string{"t"},
Required: true,
},
},
Action: cryptoDeEncryptAction(false),
}
}
func newAppCmd() *cli.Command {
return &cli.Command{
Name: "app",
@ -1022,6 +999,7 @@ func testFBSAction(ctx context.Context, c *cli.Command) error {
func appYMLExporterAction(ctx context.Context, cmd *cli.Command) error {
port := cmd.Int("port")
src := cmd.String("src")
log, err := components.GetLogger()
if err != nil {
return fmt.Errorf("getting logger: %w", err)