-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
31 changed files
with
1,156 additions
and
217 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: Release Notify | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
discord: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: sarisia/actions-status-discord@v1 | ||
with: | ||
webhook: ${{ secrets.DISCORD_WEBHOOK }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
//go:build !windows | ||
|
||
package apitest | ||
|
||
import ( | ||
"errors" | ||
"os/exec" | ||
"syscall" | ||
) | ||
|
||
func isConnRefused(err error) bool { | ||
return errors.Is(err, syscall.ECONNREFUSED) | ||
} | ||
|
||
func setpgid(cmd *exec.Cmd) { | ||
cmd.SysProcAttr = &syscall.SysProcAttr{Setpgid: true} | ||
// cmd.SysProcAttr = &syscall.SysProcAttr{} | ||
} | ||
|
||
func terminateProcess(cmd *exec.Cmd) error { | ||
err := syscall.Kill(-cmd.Process.Pid, syscall.SIGKILL) | ||
if err != nil && !errors.Is(err, syscall.ESRCH) { | ||
return err | ||
} | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
//go:build windows | ||
|
||
package apitest | ||
|
||
import ( | ||
"errors" | ||
"os" | ||
"os/exec" | ||
"syscall" | ||
|
||
"golang.org/x/sys/windows" | ||
) | ||
|
||
// based on: https://github.com/go-cmd/cmd/blob/500562c204744af1802ae24316a7e0bf88dcc545/cmd_windows.go | ||
|
||
func isConnRefused(err error) bool { | ||
return errors.Is(err, syscall.ECONNREFUSED) || errors.Is(err, windows.WSAECONNREFUSED) | ||
} | ||
|
||
func setpgid(cmd *exec.Cmd) { | ||
cmd.SysProcAttr = &syscall.SysProcAttr{} | ||
} | ||
|
||
func terminateProcess(cmd *exec.Cmd) error { | ||
p, err := os.FindProcess(cmd.Process.Pid) | ||
if err != nil { | ||
return err | ||
} | ||
return p.Kill() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.