Skip to content
This repository has been archived by the owner on Oct 13, 2024. It is now read-only.

✨ Add skip_install #60

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ You can configure the action further with the following options:
- `package_root`: Directory where NPM/Yarn commands should be run (default: `"."`)
- `build_script_name`: Name of the optional NPM build script which is executed before `electron-builder` (default: `"build"`)
- `skip_build`: Whether the action should execute the NPM build script before running `electron-builder`
- `skip_install`: Whether the action should execute the NPM install script before running build.
- `use_vue_cli`: Whether to run `electron-builder` using the [Vue CLI plugin](https://nklayman.github.io/vue-cli-plugin-electron-builder) instead of calling the command directly
- `args`: Other arguments to pass to the `electron-builder` command, e.g. configuration overrides (default: `""`)
- `max_attempts`: Maximum number of attempts for completing the build and release step (default: `1`)
Expand Down
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ inputs:
description: Whether the action should execute the NPM build script before running `electron-builder`
required: false
default: false
skip_install:
description: Whether the action should execute NPM install script
required: false
default: false
use_vue_cli:
description: Whether to run `electron-builder` using the Vue CLI plugin instead of calling the command directly
required: false
Expand Down
11 changes: 8 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ const runAction = () => {
const pkgRoot = getInput("package_root", true);
const buildScriptName = getInput("build_script_name", true);
const skipBuild = getInput("skip_build") === "true";
const skipInstall = getInput("skip_install") === "true";

const useVueCli = getInput("use_vue_cli") === "true";
const args = getInput("args") || "";
const maxAttempts = Number(getInput("max_attempts") || "1");
Expand Down Expand Up @@ -104,9 +106,12 @@ const runAction = () => {

// Disable console advertisements during install phase
setEnv("ADBLOCK", true);

log(`Installing dependencies using ${useNpm ? "NPM" : "Yarn"}…`);
run(useNpm ? "npm install" : "yarn", pkgRoot);
if (skipInstall) {
log("Skipping install script because `skip_install` option is set");
} else {
log(`Installing dependencies using ${useNpm ? "NPM" : "Yarn"}…`);
run(useNpm ? "npm install" : "yarn", pkgRoot);
}

// Run NPM build script if it exists
if (skipBuild) {
Expand Down