Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automate updating purescript-docs-search version #519

Merged
merged 1 commit into from
Dec 2, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions app/Curator.hs
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ main = withBinaryFile "curator.log" AppendMode $ \configHandle -> do
spawnThread "releaseCheckDocsSearch" $ checkLatestRelease token docsSearchRepo
-- spago repo
spawnThread "spagoUpdatePackageSets" $ spagoUpdatePackageSets token
spawnThread "spagoUpdateDocsSearch" $ spagoUpdateDocsSearch token
-- TODO: update purescript-metadata repo on purs release
spawnThread "spagoUpdatePurescript" $ spagoUpdatePurescriptVersion token
-- package-sets-metadata repo
Expand Down Expand Up @@ -310,6 +311,19 @@ spagoUpdatePurescriptVersion token (NewRepoRelease address newTag) | address ==
]
spagoUpdatePurescriptVersion _ _ = pure ()


-- | Whenever there's a new release of the purescript-docs-search, update our version of it
spagoUpdateDocsSearch :: GitHub.AuthMethod am => am -> Message -> Curator ()
spagoUpdateDocsSearch token (NewRepoRelease address newTag) | address == docsSearchRepo = do
let prTitle = "Update to purescript-docs-search@" <> newTag
let prBranchName = "spacchettibotti-docs-search-" <> newTag
runAndOpenPR token PullRequest{ prBody = "", prAddress = spagoRepo, ..} (const $ pure ())
[ "sed -e 's/docsSearchVersion = .*/docsSearchVersion = " <> surroundQuote newTag <> "/g' -i src/Spago/Prelude.hs"
, "git add src"
]
spagoUpdateDocsSearch _ _ = pure ()


-- | Take the latest package set from package-sets master, get a list of all the
-- packages in there, and thenn query their commits and tags. Once done, send
-- the package on the bus.
Expand Down