Skip to content

Commit

Permalink
fix: force node.js installation on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
sheerlox committed Dec 10, 2023
1 parent 857b472 commit 6fc201d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/mix/tasks/semantic_release.ex
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ defmodule Mix.Tasks.SemanticRelease do
"""

@shortdoc "Runs Semantic Release"
@requirements ["nodelix.install", "semantic_release.install"]
@requirements ["semantic_release.install"]

use Mix.Task
require Logger
Expand Down
8 changes: 8 additions & 0 deletions lib/mix/tasks/semantic_release.install.ex
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ defmodule Mix.Tasks.SemanticRelease.Install do

@impl Mix.Task
def run(_) do
node_version = Nodelix.VersionManager.latest_lts_version()

# force installation on CI because using the cached version fails
if not Nodelix.VersionManager.is_installed?(node_version) or
System.get_env("CI") == "true" do
Nodelix.VersionManager.install(node_version)
end

Logger.debug("Installing dependencies ...")

Mix.Tasks.Nodelix.Npm.run(
Expand Down

0 comments on commit 6fc201d

Please sign in to comment.