nixpkgs/pkgs/development/tools/semantic-release/default.nix
2024-04-04 06:33:57 +00:00

43 lines
992 B
Nix

{ cctools
, buildNpmPackage
, fetchFromGitHub
, lib
, python3
, stdenv
}:
buildNpmPackage rec {
pname = "semantic-release";
version = "23.0.7";
src = fetchFromGitHub {
owner = "semantic-release";
repo = "semantic-release";
rev = "v${version}";
hash = "sha256-4NhTVp/E9yM7rtOQa03PMhQ/TfOL23XQiixXct9uies=";
};
npmDepsHash = "sha256-2Ne+jgCo7H0dgLSsStuMWqd1aplQClf3GbDYZhIy014=";
dontNpmBuild = true;
nativeBuildInputs = [
python3
] ++ lib.optional stdenv.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 ];
};
}