[[action]]
Actions allow execution of various operations at different stages of the package integration. Current supported commands are:
runexecutes an external applicationcopycopy fileswritecreate a custom file with contentscriptcreate and execute a custom shell script
Actions acceps filters that denote at which stage or in which environment the action should run.
The following example will execute a script build-deps on Linux and build-deps.bat on Windows and then copy all binary files from deps/build/ to $TARGET/bin.
[[action]]
platform = ["windows","linux"]
stage = "build"
items = [
{ run = { cmd = "build-deps$BAT" }},
{ copy = { glob = ["deps/build/*$EXE"], to = "$TARGET/bin" }}
]
Filters
Please note that filters can be specified at the top level (for the action) or for any specific action item, allowing filtering at the action and at the item level.
stage property can have the following values:
buildexecute the script before the integration begins (before any files are copied)packageexecute the script once the integration is complete (all files have been copied into the$TARGETfolder)deployexecutes the script after redistributables have been built (useful to automatically publish redistributables)publishexecutes the action only when user invokescargo nw publishcommand.
platform list allows to specify one or more supported platforms:
windowslinuxmacos
arch list specifies the system architecture
ia32x64- (
aarch64is not supported as of writing this document but is planned to be supported when NWJS starts releasing aarch64-compatible builds)
family specifies the platform family and can have the following values:
windowsunix
Action Items
The following operations can be included in the list of action items:
run- executes an application of a command on the underlying operating systemcopy- performs file copywrite- creates and writes content to a filescript- creates and executes a script on the underlying operating system