From 878b37178d5b55046871ce53371eec5efb52cc78 Mon Sep 17 00:00:00 2001 From: Xe Iaso Date: Fri, 4 Apr 2025 08:15:04 -0400 Subject: implement packaging proof of concept with yeet (#194) * implement packaging proof of concept with yeet Signed-off-by: Xe Iaso * docs/developer: add local dev docs for yeet Signed-off-by: Xe Iaso * apply review feedback Signed-off-by: Xe Iaso * build package artifacts in CI Signed-off-by: Xe Iaso * tell CI to fetch all git metadata Signed-off-by: Xe Iaso * rename package builds job Signed-off-by: Xe Iaso * upload each package individually Signed-off-by: Xe Iaso * split package build CI jobs Signed-off-by: Xe Iaso * fix code injection? Signed-off-by: Xe Iaso * fix ci? Signed-off-by: Xe Iaso * fix security alert Signed-off-by: Xe Iaso * docs/local-dev: point people to yeet v1.13.3 Signed-off-by: Xe Iaso --------- Signed-off-by: Xe Iaso --- yeetfile.js | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'yeetfile.js') diff --git a/yeetfile.js b/yeetfile.js index 0dc9503..94388be 100644 --- a/yeetfile.js +++ b/yeetfile.js @@ -1,5 +1,7 @@ +$`npm run assets`; + ["amd64", "arm64", "riscv64"].forEach(goarch => { - [deb, rpm].forEach(method => method.build({ + [deb, rpm, tarball].forEach(method => method.build({ name: "anubis", description: "Anubis weighs the souls of incoming HTTP requests and uses a sha256 proof-of-work challenge in order to protect upstream resources from scraper bots.", homepage: "https://anubis.techaro.lol", @@ -10,19 +12,16 @@ "./README.md": "README.md", "./LICENSE": "LICENSE", "./docs/docs/CHANGELOG.md": "CHANGELOG.md", + "./docs/docs/admin/policies.md": "policies.md", + "./docs/docs/admin/native-install.mdx": "native-install.mdx", + "./data/botPolicies.json": "botPolicies.json", }, - build: (out) => { - // install Anubis binary - go.build("-o", `${out}/usr/bin/anubis`, "./cmd/anubis"); - - // install systemd unit - yeet.run("mkdir", "-p", `${out}/usr/lib/systemd/system`); - yeet.run("cp", "run/anubis@.service", `${out}/usr/lib/systemd/system/anubis@.service`); + build: ({ bin, etc, systemd, out }) => { + $`go build -o ${bin}/anubis -ldflags '-s -w -extldflags "-static" -X "github.com/TecharoHQ/anubis.Version=${git.tag()}"' ./cmd/anubis`; - // install default config - yeet.run("mkdir", "-p", `${out}/etc/anubis`); - yeet.run("cp", "run/anubis.env.default", `${out}/etc/anubis/anubis-default.env`); + file.install("./run/anubis@.service", `${systemd}/anubis@.service`); + file.install("./run/default.env", `${etc}/default.env`); }, })); }); \ No newline at end of file -- cgit v1.2.3