From d09451ef6007d5eee5a9fcaed5fb1e213e92782c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ro=C5=BCek?= Date: Thu, 4 Jan 2024 20:36:40 +0100 Subject: [PATCH] build(repo): set explict node target for built binaries --- .circleci/config.yml | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ed4c0ade3..d30da9227 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -22,9 +22,10 @@ defaults: node-versions: &node-versions - "12.22" - "14.21" - - &node-maintenance-lts "16.20" - - &node-active-lts "18.17" - - &node-current "20.5" + - "16.20" + - &node-maintenance-lts "18.19" + - &node-active-lts "20.10" + - &node-current "21.5" pkg-cache-path: &pkg-cache-path /tmp/pkg-node-binaries ldid-version: &ldid-version 2.1.5-procursus7 # https://github.com/ProcursusTeam/ldid @@ -65,6 +66,12 @@ commands: parameters: targets: type: string + node-version: + type: enum + enum: + - *node-maintenance-lts + - *node-active-lts + default: *node-maintenance-lts bytecode: type: boolean default: true @@ -78,11 +85,13 @@ commands: environment: PKG_CACHE_PATH: *pkg-cache-path command: | + node_version=$(echo "<< parameters.node-version >>" | awk -F "." '{ print $1 }') + targets=$(echo "<< parameters.targets >>" | awk -v node_version="$node_version" -F "," '{for (i=1;i<=NF;i++) printf "node" node_version "-" $i "," }' | sed "s/,$/\n/") if [ "<< parameters.bytecode >>" = true ] then - yarn workspace @stoplight/spectral-cli pkg . --public --public-packages "*" --targets << parameters.targets >> --output binaries/spectral + yarn workspace @stoplight/spectral-cli pkg . --public --public-packages "*" --targets $targets --output binaries/spectral else - yarn workspace @stoplight/spectral-cli pkg . --no-bytecode --debug --public --public-packages "*" --targets << parameters.targets >> --output binaries/spectral + yarn workspace @stoplight/spectral-cli pkg . --no-bytecode --public --public-packages "*" --targets $targets --output binaries/spectral fi - save_cache: name: Retain pkg cache