Skip to content

Commit

Permalink
feat: add additional packages configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
sheerlox committed Nov 30, 2023
1 parent d50c317 commit ac56412
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 14 deletions.
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,29 @@ def deps do
end
```

## Configuration

You can list additional npm packages to be passed to the `npm install` command:

```elixir
config :semantic_release,
additional_packages: [
"@semantic-release/changelog",
"@semantic-release/git",
]
```

This can also be used to override automatically installed package versions:

```elixir
config :semantic_release,
additional_packages: [
"semantic-release-hex@next",
"@semantic-release/changelog",
"@semantic-release/git",
]
```

## Versioning

This project follows the principles of [Semantic Versioning (SemVer)](https://semver.org/).
9 changes: 9 additions & 0 deletions config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,12 @@ import Config

config :nodelix,
version: "20.10.0"

config :semantic_release,
additional_packages: [
"semantic-release-hex@next",
"@semantic-release/changelog",
"@semantic-release/git",
"@semantic-release/exec",
"@insurgent/conventional-changelog-preset"
]
24 changes: 12 additions & 12 deletions lib/mix/tasks/semantic_release.install.ex
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,18 @@ defmodule Mix.Tasks.SemanticRelease.Install do
def run(_) do
Logger.debug("Installing dependencies ...")

Mix.Task.run("nodelix.npm", [
"install",
"--silent",
"--prefix",
SemanticRelease.install_path(),
"--no-save",
"semantic-release",
"@semantic-release/changelog",
"@semantic-release/git",
"@semantic-release/exec",
"semantic-release-hex@next"
])
Mix.Task.run(
"nodelix.npm",
[
"install",
"--silent",
"--prefix",
SemanticRelease.install_path(),
"--no-save",
"semantic-release",
"semantic-release-hex"
] ++ Application.get_env(:semantic_release, :additional_packages, [])
)

Logger.debug("Auditing signatures ...")

Expand Down
2 changes: 0 additions & 2 deletions test/semantic_release_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ defmodule SemanticReleaseTest do
doctest SemanticRelease

setup_all do
IO.puts(SemanticRelease.install_path())

File.rm_rf!(SemanticRelease.install_path())

{branch, code} = System.cmd("git", ["branch", "--show-current"])
Expand Down

0 comments on commit ac56412

Please sign in to comment.