implement packaging proof of concept with yeet (#194)

* implement packaging proof of concept with yeet

Signed-off-by: Xe Iaso <me@xeiaso.net>

* docs/developer: add local dev docs for yeet

Signed-off-by: Xe Iaso <me@xeiaso.net>

* apply review feedback

Signed-off-by: Xe Iaso <me@xeiaso.net>

* build package artifacts in CI

Signed-off-by: Xe Iaso <me@xeiaso.net>

* tell CI to fetch all git metadata

Signed-off-by: Xe Iaso <me@xeiaso.net>

* rename package builds job

Signed-off-by: Xe Iaso <me@xeiaso.net>

* upload each package individually

Signed-off-by: Xe Iaso <me@xeiaso.net>

* split package build CI jobs

Signed-off-by: Xe Iaso <me@xeiaso.net>

* fix code injection?

Signed-off-by: Xe Iaso <me@xeiaso.net>

* fix ci?

Signed-off-by: Xe Iaso <me@xeiaso.net>

* fix security alert

Signed-off-by: Xe Iaso <me@xeiaso.net>

* docs/local-dev: point people to yeet v1.13.3

Signed-off-by: Xe Iaso <me@xeiaso.net>

---------

Signed-off-by: Xe Iaso <me@xeiaso.net>
This commit is contained in:
Xe Iaso 2025-04-04 08:15:04 -04:00 committed by GitHub
parent a230a58a1d
commit 878b37178d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 342 additions and 17 deletions

View file

@ -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");
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 systemd unit
yeet.run("mkdir", "-p", `${out}/usr/lib/systemd/system`);
yeet.run("cp", "run/anubis@.service", `${out}/usr/lib/systemd/system/anubis@.service`);
// 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`);
},
}));
});