depot/third_party/nixpkgs/pkgs/by-name/se/semantic-release/package.nix

43 lines
1,013 B
Nix

{
cctools,
buildNpmPackage,
fetchFromGitHub,
lib,
python3,
stdenv,
}:
buildNpmPackage rec {
pname = "semantic-release";
version = "24.2.0";
src = fetchFromGitHub {
owner = "semantic-release";
repo = "semantic-release";
rev = "v${version}";
hash = "sha256-0FQtTzU7sC9rIVGMyPPK0CP9/LPrCwZcmHV6/rJ7ukU=";
};
npmDepsHash = "sha256-B7QHYLupai0Av8M7UwUrw1eBBhsYrYBtevTwMI27abo=";
dontNpmBuild = true;
nativeBuildInputs = [
python3
] ++ lib.optional stdenv.hostPlatform.isDarwin cctools;
# Fixes `semantic-release --version` output
postPatch = ''
substituteInPlace package.json --replace \
'"version": "0.0.0-development"' \
'"version": "${version}"'
'';
meta = {
description = "Fully automated version management and package publishing";
mainProgram = "semantic-release";
homepage = "https://semantic-release.gitbook.io/semantic-release/";
license = lib.licenses.mit;
maintainers = [ lib.maintainers.sestrella ];
};
}