feat: artifact push and pull actions
All checks were successful
default / test artifact actions (push) Successful in 26s
All checks were successful
default / test artifact actions (push) Successful in 26s
This commit is contained in:
commit
ae8d20e174
15 changed files with 1319 additions and 0 deletions
38
main.go
Normal file
38
main.go
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
"os/signal"
|
||||
|
||||
"code.geekeey.de/actions/artifacts/internal/pull"
|
||||
"code.geekeey.de/actions/artifacts/internal/push"
|
||||
"code.geekeey.de/actions/sdk"
|
||||
)
|
||||
|
||||
func main() {
|
||||
if len(os.Args) < 2 {
|
||||
fmt.Fprintln(os.Stderr, "usage: artifacts <push|pull>")
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
action := sdk.New()
|
||||
ctx, cancel := signal.NotifyContext(context.Background(), os.Interrupt)
|
||||
defer cancel()
|
||||
|
||||
var err error
|
||||
switch os.Args[1] {
|
||||
case "push":
|
||||
err = push.New(action).Run(ctx)
|
||||
case "pull":
|
||||
err = pull.New(action).Run(ctx)
|
||||
default:
|
||||
err = fmt.Errorf("unknown command %q", os.Args[1])
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
action.Errorf("%s", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue