Switch remote deploy to vendored source builds

Move remote deployment to a vendored source bundle built on the target host via Docker so redeploys no longer require local cross-compilation or host Go installation.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
GitHub Actions
2026-05-08 12:19:18 +08:00
parent bb27566e38
commit c1a0fe2949
1320 changed files with 497125 additions and 11 deletions

View File

@@ -0,0 +1,38 @@
package signal
import (
"os"
gosignal "os/signal"
"sync"
"syscall"
)
var signalChannel = make(chan os.Signal, 2)
var (
callbacks []func()
lock sync.Mutex
)
func OnShutdown(callback func()) {
lock.Lock()
defer lock.Unlock()
callbacks = append(callbacks, callback)
}
// Start the Signal Manager
func Start() {
// Hook into interrupts
gosignal.Notify(signalChannel, os.Interrupt, syscall.SIGTERM, syscall.SIGINT)
// Spin off signal listener and wait for either a cancellation
// or signal
go func() {
<-signalChannel
println("")
println("Ctrl+C detected. Shutting down...")
for _, callback := range callbacks {
callback()
}
}()
}