From f916ba5fbb94f0ca981a5eac5e757ac4ff6b6e00 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Wed, 17 Jun 2020 13:44:04 +0200 Subject: [PATCH] Use exact versions for "megarepo" deps --- hercules-ci-agent/hercules-ci-agent.cabal | 4 ++-- scripts/releaser | 12 ++++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/hercules-ci-agent/hercules-ci-agent.cabal b/hercules-ci-agent/hercules-ci-agent.cabal index 0b0d3282..64ccf1d5 100644 --- a/hercules-ci-agent/hercules-ci-agent.cabal +++ b/hercules-ci-agent/hercules-ci-agent.cabal @@ -202,8 +202,8 @@ executable hercules-ci-agent , exceptions , filepath , hercules-ci-agent - , hercules-ci-api-core == 0.1.* - , hercules-ci-api-agent == 0.2.* + , hercules-ci-api-core == 0.1.1.0 + , hercules-ci-api-agent == 0.2.1.0 , hostname , http-client , http-client-tls diff --git a/scripts/releaser b/scripts/releaser index 63080f2e..f3a212b4 100755 --- a/scripts/releaser +++ b/scripts/releaser @@ -31,10 +31,18 @@ main = do hSetBuffering stderr LineBuffering gitAssertEmptyStaging -- Disabled because metadata change does not warrant a bump - -- releasePackage "hercules-ci-api-core" mempty - releasePackage "hercules-ci-api-agent" mempty + -- releasePackage "hercules-ci-api-core" (bumpExactVersion "hercules-ci-api-core") + releasePackage "hercules-ci-api-agent" (bumpExactVersion "hercules-ci-api-agent") releasePackage "hercules-ci-agent" bumpVersionInNix +bumpExactVersion :: String -> String -> String -> IO () +bumpExactVersion package old new = do + void $ readProcess "sh" + [ "-c" + , "sed -i $(git ls-files | grep '\\.cabal') -e 's/" <> package <> " == " <> old <> "/" <> package <> " == " <> new <> "/g'" + ] + mempty + bumpVersionInNix :: String -> String -> IO () bumpVersionInNix old new = do void $ readProcess "sed" (["-i", "-e", "s/agentVersion = \"" <> old <> "\"/agentVersion = \"" <> new <> "\"/", "for-upstream/common.nix"]) mempty