From e50fb97030eb8921aeff32d9e22bf737c81bdb37 Mon Sep 17 00:00:00 2001 From: Andrew <51118083+ArionThinker@users.noreply.github.com> Date: Mon, 4 Dec 2023 19:08:36 +0200 Subject: [PATCH] +sing-box.app (#4294) * new file: projects/sing-box.sagernet.org/config.json new file: projects/sing-box.sagernet.org/package.yml * rename * go version --------- Co-authored-by: Jacob Heider --- projects/sing-box.app/config.json | 8 +++++++ projects/sing-box.app/package.yml | 40 +++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 projects/sing-box.app/config.json create mode 100644 projects/sing-box.app/package.yml diff --git a/projects/sing-box.app/config.json b/projects/sing-box.app/config.json new file mode 100644 index 00000000..0a78f1c7 --- /dev/null +++ b/projects/sing-box.app/config.json @@ -0,0 +1,8 @@ +{ + "log": { + "disabled": false, + "level": "info", + "output": "box.log", + "timestamp": true + } +} \ No newline at end of file diff --git a/projects/sing-box.app/package.yml b/projects/sing-box.app/package.yml new file mode 100644 index 00000000..8891cd20 --- /dev/null +++ b/projects/sing-box.app/package.yml @@ -0,0 +1,40 @@ +distributable: + url: https://github.com/SagerNet/sing-box/archive/v{{version}}.tar.gz + strip-components: 1 +display-name: sing-box +versions: + github: SagerNet/sing-box +build: + dependencies: + go.dev: ^1.20 + script: + - go build $GO_ARGS -ldflags="$LDFLAGS" ./cmd/sing-box + env: + GO_ARGS: + - -trimpath + - -o="{{prefix}}/bin/sing-box" + LDFLAGS: + - -s + - -w + - -X github.com/sagernet/sing-box/constant.Version={{version}} + linux: + LDFLAGS: + - -buildmode=pie +provides: + - bin/sing-box +test: + dependencies: + linux: + gitlab.com/procps-ng/procps: '*' + script: + - sing-box version | grep {{version}} + - sing-box check -c $PWD/config.json + - sing-box run & + - sleep 1 + - cat box.log | grep 'sing-box started' + - $KILL sing-box + env: + darwin: + KILL: killall + linux: + KILL: pkill