cda7a190c0
Single-version mkPyPiWheelPublish made consumers ship only the default
version per tag. Add a multi-version builder that loops over a fixed
{version,wheel} list (version parsed from the wheel filename, idempotent
409-skip), plus shared parity_pypi_post/parity_wheel_version helpers.
94 lines
2.9 KiB
Nix
94 lines
2.9 KiB
Nix
{
|
|
description = "parity-lib — shared per-archetype publish-app builders for the ~51 parity repos (cluster #192/#193/#194, emmett#44)";
|
|
|
|
inputs = {
|
|
# Shared fleet pin so the ~51 consumers stay binary-cache aligned.
|
|
fleet.url = "git+https://git.oleks.space/oleks/fleet-pins";
|
|
nixpkgs.follows = "fleet/nixpkgs-ci";
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
};
|
|
|
|
outputs =
|
|
{
|
|
self,
|
|
nixpkgs,
|
|
flake-utils,
|
|
...
|
|
}:
|
|
{
|
|
# ---------------------------------------------------------------------
|
|
# lib.* — system-INDEPENDENT entry points. A consumer calls
|
|
# parity.lib.mkParityBuilders { pkgs = <its own pkgs>; }
|
|
# and gets the six mk*Publish builders back, OR uses the per-builder
|
|
# convenience wrappers below which take pkgs as the first argument.
|
|
# ---------------------------------------------------------------------
|
|
lib =
|
|
let
|
|
builders = pkgs: import ./lib/builders.nix { inherit pkgs; };
|
|
wrap =
|
|
name: pkgs: args:
|
|
(builders pkgs).${name} args;
|
|
in
|
|
{
|
|
mkParityBuilders = builders;
|
|
mkPyPiWheelPublish = wrap "mkPyPiWheelPublish";
|
|
mkPyPiWheelPublishMulti = wrap "mkPyPiWheelPublishMulti";
|
|
mkS390xNpmPublish = wrap "mkS390xNpmPublish";
|
|
mkGenericBinaryPublish = wrap "mkGenericBinaryPublish";
|
|
mkNix2ContainerPublish = wrap "mkNix2ContainerPublish";
|
|
mkGoBinaryPublish = wrap "mkGoBinaryPublish";
|
|
mkHelmPublish = wrap "mkHelmPublish";
|
|
};
|
|
}
|
|
// flake-utils.lib.eachDefaultSystem (
|
|
system:
|
|
let
|
|
pkgs = import nixpkgs { inherit system; };
|
|
inherit (pkgs) lib;
|
|
|
|
pipelineDoctor = pkgs.writeShellApplication {
|
|
name = "pipeline-doctor";
|
|
runtimeInputs = with pkgs; [
|
|
coreutils
|
|
gnugrep
|
|
gnused
|
|
findutils
|
|
jq
|
|
];
|
|
text = ''exec bash ${./ci/pipeline-doctor.sh} "$@"'';
|
|
};
|
|
|
|
# Smoke check: instantiate every builder with stub args so the apps eval.
|
|
builders = import ./lib/builders.nix { inherit pkgs; };
|
|
smoke = pkgs.runCommand "parity-lib-smoke" { } ''
|
|
: "${
|
|
builtins.toString (
|
|
lib.attrNames (
|
|
builders.mkPyPiWheelPublish {
|
|
pname = "demo";
|
|
version = "0.0.0";
|
|
wheel = pkgs.hello;
|
|
}
|
|
)
|
|
)
|
|
}"
|
|
touch $out
|
|
'';
|
|
in
|
|
{
|
|
packages = {
|
|
pipeline-doctor = pipelineDoctor;
|
|
default = pipelineDoctor;
|
|
};
|
|
|
|
apps.pipeline-doctor = {
|
|
type = "app";
|
|
program = lib.getExe pipelineDoctor;
|
|
meta.description = "Assert the parity contract for a repo and print local-equivalent commands (cluster #193).";
|
|
};
|
|
|
|
checks.smoke = smoke;
|
|
}
|
|
);
|
|
}
|