NagyZoltanPeter a7df0d9c56
chore: adjust artifact builds and uploads to contain logosdeliverynode app (#4059)
* feat(nix): add logosdeliverynode build target

Generalize the wakucanary-only binary path in nix/default.nix into an
app-target map so any app binary shares one build/install/rln-bundle
path, and expose a `logosdeliverynode` flake package (with gitVersion
for --version reporting).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* ci(github): build logosdeliverynode in release/pre-release/windows workflows

- release-assets.yml: build logosdeliverynode (POSTGRES=1) so it ships in
  the waku-<arch>-<os>.tar.gz release asset.
- pre-release.yml: add logosdeliverynode to the make targets and to the
  nwaku nightly/RC tarball.
- windows-build.yml: build logosdeliverynode.exe and assert it exists.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* ci(jenkins): build & push logosdeliverynode docker image to harbor

Jenkinsfile.release now builds a second image from the dedicated
logosdeliverynode Dockerfile stage and pushes it to
harbor.status.im/wakuorg/logosdelivery:<IMAGE_TAG> alongside the primary
image. Add a logosdeliverynode stage to the root Dockerfile so the image
entrypoint is /usr/bin/logosdeliverynode rather than the generic
/usr/bin/wakunode symlink. Bump the pipeline timeout to 40m to cover the
extra compile.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Apply suggestions from code review

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-07-28 11:20:05 +01:00

119 lines
3.7 KiB
Nix

{
description = "logos-delivery nim build flake";
nixConfig = {
extra-substituters = [ "https://nix-cache.status.im/" ];
extra-trusted-public-keys = [
"nix-cache.status.im-1:x/93lOfLU+duPplwMSBR+OlY4+mo+dCN7n0mr4oPwgY="
];
};
inputs = {
# Pinning the commit to use same commit across different projects.
# A commit from nixpkgs 25.11 release: https://github.com/NixOS/nixpkgs/tree/release-25.11
# Includes the fetchCargoVendor crates.io CDN fix (nixpkgs 0fb82de3).
nixpkgs.url = "github:NixOS/nixpkgs?rev=535f3e6942cb1cead3929c604320d3db54b542b9";
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
# Zerokit v2.0.2; keep rev in sync with the vendor/zerokit submodule.
zerokit = {
url = "github:vacp2p/zerokit/5e64cb8822bee65eed6cf459f95ae72b80c6ba63";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, rust-overlay, zerokit }:
let
systems = [
"x86_64-linux" "aarch64-linux"
"x86_64-darwin" "aarch64-darwin"
"x86_64-windows"
];
forAllSystems = nixpkgs.lib.genAttrs systems;
lib = nixpkgs.lib;
# Single source of truth for the semver: the `version` field of
# logos_delivery.nimble. Kept in sync with git tags by the version-check CI.
nimbleVersion =
let line = lib.findFirst (l: lib.hasPrefix "version = " l)
"version = \"unknown\""
(lib.splitString "\n" (builtins.readFile ./logos_delivery.nimble));
in lib.removeSuffix "\"" (lib.removePrefix "version = \"" line);
# A flake sandbox has no .git, so `git describe` is impossible; the
# commit comes from the flake metadata instead.
shortRev = self.shortRev or self.dirtyShortRev or "dirty";
nimbleOverlay = final: prev: {
nimble = prev.nimble.overrideAttrs (_: {
version = "0.22.3";
src = prev.fetchFromGitHub {
owner = "nim-lang";
repo = "nimble";
rev = "v0.22.3";
sha256 = "sha256-f7DYpRGVUeSi6basK1lfu5AxZpMFOSJ3oYsy+urYErg=";
};
});
};
pkgsFor = system: import nixpkgs {
inherit system;
overlays = [ (import rust-overlay) nimbleOverlay ];
};
in {
packages = forAllSystems (system:
let
pkgs = pkgsFor system;
zerokitRln = import ./nix/zerokit.nix { inherit zerokit system; };
liblogosdelivery = pkgs.callPackage ./nix/default.nix {
inherit pkgs;
src = ./.;
inherit zerokitRln;
gitVersion = "v${nimbleVersion}-g${builtins.substring 0 6 shortRev}";
};
wakucanary = pkgs.callPackage ./nix/default.nix {
inherit pkgs;
src = ./.;
targets = ["wakucanary"];
inherit zerokitRln;
};
logosdeliverynode = pkgs.callPackage ./nix/default.nix {
inherit pkgs;
src = ./.;
targets = ["logosdeliverynode"];
inherit zerokitRln;
gitVersion = "v${nimbleVersion}-g${builtins.substring 0 6 shortRev}";
};
in {
inherit liblogosdelivery wakucanary logosdeliverynode;
# Expose librln so downstream consumers link the exact same build.
rln = zerokitRln;
default = liblogosdelivery;
}
);
devShells = forAllSystems (system:
let
pkgs = pkgsFor system;
in {
default = pkgs.mkShell {
nativeBuildInputs = with pkgs; [
nim-2_2
nimble
];
};
}
);
};
}