fix release script (#4275)

* fix release script

only upload from the linux machine and escape arguments to `publish`,
otherwise they get interpreted by bazel.

CHANGELOG_BEGIN
CHANGELOG_END

* Update release/src/Main.hs

Co-Authored-By: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>

* Update release/src/Main.hs

Co-Authored-By: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>

* bracket -> bracket_

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
This commit is contained in:
Robin Krom 2020-01-30 10:51:39 +01:00 committed by GitHub
parent a1f8aeba88
commit eacacbf44e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 6 deletions

View File

@ -116,12 +116,14 @@ main = do
-- We can't put an .npmrc file in the root of the directory because other bazel npm
-- code picks it up and looks for the token which is not yet set before the release
-- phase.
$logDebug "Uploading npm packages"
liftIO $ bracket
(writeFile npmrcPath "//registry.npmjs.org/:_authToken=${NPM_TOKEN}")
(\() -> Dir.removeFile npmrcPath)
(\() -> forM_ npmPackages
$ \rule -> liftIO $ callCommand $ "bazel run " <> rule <> ":npm_package.publish --access public")
-- Only upload from the linux machine.
when (osName == "linux") $ do
$logDebug "Uploading npm packages"
liftIO $ bracket_
(writeFile npmrcPath "//registry.npmjs.org/:_authToken=${NPM_TOKEN}")
(Dir.removeFile npmrcPath)
(forM_ npmPackages
$ \rule -> liftIO $ callCommand $ "bazel run " <> rule <> ":npm_package.publish -- --access public")
-- set variables for next steps in Azure pipelines
liftIO . putStrLn $ "##vso[task.setvariable variable=has_released;isOutput=true]true"

View File

@ -26,6 +26,8 @@ module Util (
resolvePomData,
loggedProcess_,
isDeployJar,
osName
) where