Skip to content

Commit

Permalink
fix release script (digital-asset#4275)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
Robin Krom and cocreature authored Jan 30, 2020
1 parent a1f8aeb commit eacacbf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
14 changes: 8 additions & 6 deletions release/src/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 2 additions & 0 deletions release/src/Util.hs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ module Util (
resolvePomData,
loggedProcess_,
isDeployJar,

osName
) where


Expand Down

0 comments on commit eacacbf

Please sign in to comment.