Skip to content

feat(build-and-distribute): add NPM_BUILD_SCRIPT input to allow custom build scripts#234

Open
luislard wants to merge 1 commit intomainfrom
feat/207_allow_dev_build
Open

feat(build-and-distribute): add NPM_BUILD_SCRIPT input to allow custom build scripts#234
luislard wants to merge 1 commit intomainfrom
feat/207_allow_dev_build

Conversation

@luislard
Copy link
Contributor

@luislard luislard commented Mar 20, 2026

Summary

  • Add optional NPM_BUILD_SCRIPT input to build-and-distribute workflow (defaults to empty, falls back to build)
  • Update the "Compile assets" step to use the input with || 'build' fallback
  • Document the new input and provide a conditional usage example in docs

Usage example

with:
  NPM_BUILD_SCRIPT: ${{ (github.ref_name == 'dev/main' || github.ref_name == 'dev/beta' || github.ref_type == 'tag') && 'build' || 'build:dev' }}

Test plan

  • Verify workflow runs npm run build when NPM_BUILD_SCRIPT is not provided
  • Verify workflow runs the specified script when NPM_BUILD_SCRIPT is set

Closes #207

…m build scripts

Add optional NPM_BUILD_SCRIPT input so callers can override the default
`build` npm script — e.g. to run `build:dev` on feature branches and
`build` on stable branches/tags.

- Add NPM_BUILD_SCRIPT workflow input (default: empty, falls back to 'build')
- Update "Compile assets" step to use the input with || fallback
- Document new input and provide conditional usage example in docs
@luislard luislard requested a review from a team as a code owner March 20, 2026 10:43
@luislard
Copy link
Contributor Author

Quick question, if we go in the MODE direction:

Let's say we set MODE: dev
Is it desired to also affect the composer installation? because now the composer args are default to --no-dev.

There may be a caveat: the cache will need to be handled differently because we now have two build types, dev and prod.

If the MODE only affects the assets build, I think it is easier to keep it with only NPM_BUILD_SCRIPT. Otherwise, we would have to declare more inputs:

MODE: dev
COMPILE_SCRIPT_DEV: 'build:dev'
COMPILE_SCRIPT_PRD: 'build'

With the NPM_BUILD_SCRIPT

NPM_BUILD_SCRIPT:   ${{ (github.ref_name == 'dev/main' || github.ref_name == 'dev/beta' || github.ref_type == 'tag') && 'build' || 'build:dev' }}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request]: build-and-distribute should allow for building debuggable assets

1 participant