Skip to content
Merged
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
2 changes: 0 additions & 2 deletions .github/workflows/test-ref-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name: Test reference branch

on:
push:
release:
types: [published]

jobs:
test-ref-branch:
Expand Down
26 changes: 17 additions & 9 deletions actions/build-test-publish/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,17 @@ name: Build, test, publish
description: Build, optionally test, and optionally publish to NPM

inputs:
vars:
description: JSON representation of workflow vars object
node_version:
description: Node version
required: true
terminal_pre_build:
description: If true, start a terminal session before building
required: false
default: 'false'
terminal_post_build:
description: If true, start a terminal session after building
required: false
default: 'false'

runs:
using: composite
Expand All @@ -13,11 +21,11 @@ runs:
- name: Setup node
uses: actions/setup-node@v6
with:
node-version: ${{ fromJSON(inputs.vars).NODE_VERSION }}
node-version: ${{ inputs.node_version }}
registry-url: https://registry.npmjs.org/

- name: Start terminal session (pre build)
if: fromJSON(inputs.vars).TERMINAL_PRE_BUILD == 'true'
if: inputs.terminal_pre_build == 'true'
uses: mxschmitt/action-tmate@v3

- name: Build
Expand All @@ -38,18 +46,18 @@ runs:
echo "version=$version" >> $GITHUB_OUTPUT
echo "label=$label" >> $GITHUB_OUTPUT

npm install
npm clean-install

# If version has a label, build in development mode.
# If version has a label, build in that mode.
if [[ "$label" != "" ]]
then
npm run build:dev
npm run build:$label
else
npm run build:release
npm run build:prod
fi

- name: Start terminal session (post build)
if: fromJSON(inputs.vars).TERMINAL_POST_BUILD == 'true'
if: inputs.terminal_post_build == 'true'
uses: mxschmitt/action-tmate@v3

- name: Test
Expand Down