Unverified Commit ca5d7475 authored by Pol Dellaiera's avatar Pol Dellaiera Committed by GitHub
Browse files

paratest: 7.13.0 -> 7.19.1; add updateScript; add myself as maintainer (#496273)

parents dc693182 93151a14
Loading
Loading
Loading
Loading
+470 −354

File changed.

Preview size limit exceeded, changes collapsed.

+9 −4
Original line number Diff line number Diff line
@@ -8,17 +8,19 @@
(php.withExtensions ({ enabled, all }: enabled ++ [ all.pcov ])).buildComposerProject2
  (finalAttrs: {
    pname = "paratest";
    version = "7.13.0";
    version = "7.19.1";

    src = fetchFromGitHub {
      owner = "paratestphp";
      repo = "paratest";
      tag = "v${finalAttrs.version}";
      hash = "sha256-X4sgMxRiuAk/YkOcUOnanUsdCFp0RHUIuv2OCqP5Z3w=";
      hash = "sha256-DksiwFMgoPk0BNOVc9Bn22a2blzNw/63fGBT3dlK7Mg=";
    };

    composerLock = ./composer.lock;
    vendorHash = "sha256-6fF9YbHoU1+YbSuTKXGmJqkoxdyK30YOv7gZKJVfoas=";
    vendorHash = "sha256-VdJVbAKkbWKZEJ16ZbJ/lmc6ZzPmztXjZ/LAEmRI93o=";

    passthru.updateScript = ./update.sh;

    nativeInstallCheckInputs = [
      versionCheckHook
@@ -31,6 +33,9 @@
      homepage = "https://github.com/paratestphp/paratest";
      license = lib.licenses.mit;
      mainProgram = "paratest";
      maintainers = [ lib.maintainers.patka ];
      maintainers = [
        lib.maintainers.patka
        lib.maintainers.piotrkwiecinski
      ];
    };
  })
+29 −0
Original line number Diff line number Diff line
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl jq php.packages.composer nix-update coreutils

set -eou pipefail

PACKAGE_NAME="paratest"
PACKAGE_VERSION=$(nix eval --raw -f. $PACKAGE_NAME.version)
PACKAGE_DIR="$(dirname "${BASH_SOURCE[0]}")"

# Get latest version from git
GIT_VERSION="$(curl --silent ${GITHUB_TOKEN:+-u ":$GITHUB_TOKEN"} "https://api.github.com/repos/paratestphp/paratest/releases/latest" | jq '.tag_name' --raw-output)"
NEW_VERSION="${GIT_VERSION#v}"

# Fail if package and git version are the same
if [[ "$PACKAGE_VERSION" == "$NEW_VERSION" ]]; then
    echo "${PACKAGE_NAME} is up-to-date: ${PACKAGE_VERSION}"
    exit 0
fi

# Generate composer.lock file
TMPDIR=$(mktemp -d)
trap 'rm -rf -- "${TMPDIR}"' EXIT

git clone --depth 1 --branch "${GIT_VERSION}" https://github.com/paratestphp/paratest.git "${TMPDIR}/paratest"
composer -d "${TMPDIR}/paratest" install --ignore-platform-req=ext-pcov
cp "${TMPDIR}/paratest/composer.lock" "${PACKAGE_DIR}/composer.lock"

# update package.nix version, hash and vendorHash
nix-update $PACKAGE_NAME --version="${NEW_VERSION}"