Skip to content

Commit

Permalink
Update to NodeJS 16.20 (#11)
Browse files Browse the repository at this point in the history
Our packaging library is deprecated so node 16 is as far as we can go
for now.
👀 https://github.com/vercel/pkg

---------

Co-authored-by: Alexander Graf <[email protected]>
  • Loading branch information
SxDx and otherguy authored Jul 8, 2024
1 parent 6986318 commit 3dca0d9
Show file tree
Hide file tree
Showing 5 changed files with 7,654 additions and 3,574 deletions.
107 changes: 68 additions & 39 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
---
version: 2.1

orbs:
node: circleci/node@2.0.0
win: circleci/windows@2.2.0 # The Windows orb give you everything you need to start using the Windows executor.
node: circleci/node@5.2
win: circleci/windows@5.0

executors:
linux:
docker:
- image: cimg/base:2021.04
- image: cimg/base:current
resource_class: medium
macos:
macos:
xcode: 13.4.1
windows: win/default
xcode: 15.4.0
resource_class: macos.m1.medium.gen1


filters: &filters
tags:
only: /^\d+\.\d+\.\d+$/

# Matrices work with jobs that take parameters
jobs:

build:
parameters:
os:
Expand All @@ -26,72 +31,96 @@ jobs:
type: boolean
executor: << parameters.os >>
steps:
# Install Rosetta if on Apple Silicon
- when:
condition:
equal: ["macos", << parameters.os >>]
steps:
- run:
name: Install Rosetta
command: softwareupdate --install-rosetta --agree-to-license
- run:
name: Install dependencies
command: |
arch -arm64 brew install pkg-config cairo pango jpeg \
giflib librsvg
- run:
name: Install Setuptools
command: |
pip install --upgrade pip setuptools
pyenv rehash
- checkout
- node/install:
install-npm: true
node-version: 14.15.3
npm-version: 8.3.1
node-version: 16.20.2
- run:
name: Verify Versions
command: |
node --version
npm --version
- run: npm i
- run: npm i --prefix=$HOME/.local -g pkg
- run: ls -la $HOME/.local
- run: ls -la $HOME/.local/bin
- run: echo 'export PATH=$HOME/.local/bin:$PATH' >> $BASH_ENV
- run: echo $PATH
- run: which pkg
- run: npm run build
- run: tar -czvf dist/removebg_cli_VERSION_<< parameters.os >>.tar.gz dist/removebg
- store_artifacts:
- run:
name: Install
command: |
npm i
npm i --prefix=$HOME/.local -g pkg
ls -la $HOME/.local
ls -la $HOME/.local/bin
echo 'export PATH=$HOME/.local/bin:$PATH' >> $BASH_ENV
- run:
name: Build
command: |
echo "Path: $PATH"
echo "pkg location: $(which pkg)"
npm run build
tar -czvf dist/removebg_cli_VERSION_<< parameters.os >>.tar.gz dist/removebg
- store_artifacts:
path: dist
- persist_to_workspace:
root: .
paths:
- dist/*
- test/*
- test/*

build-windows:
executor: windows
executor: win/default
steps:
- checkout
- run: nvm install 16.3.2
- run: nvm use 16.3.2
- run:
name: Install Node
command: |
nvm install 16.20.2
nvm use 16.20.2
- run:
name: Verify Versions
command: |
node --version
npm --version
- run: npm install
- run: dir
- run: npm i -g pkg
- run: npm run build
- run: Compress-Archive -LiteralPath dist\removebg.exe -DestinationPath dist\removebg_cli_VERSION_windows.zip
- store_artifacts:
- run:
name: Install
command: |
npm install
dir
npm i -g pkg
- run:
name: Build
command: |
npm run build
Compress-Archive -LiteralPath dist\removebg.exe -DestinationPath dist\removebg_cli_VERSION_windows.zip
- store_artifacts:
path: dist
- persist_to_workspace:
root: .
paths:
- dist/*
- test/*
- test/*

workflows:
build:
ci:
jobs:
# A "matrix" here is essentially syntactic sugar for invoking a certain
# job many times with different combinations of parameters.
- build:
# The "matrix" block signifies that this job should be expanded into a
# series of jobs, each with a different combination of parameter values
matrix:
parameters:
os: [linux, macos] # <-- YAML shorthand for lists of values
# By default each job will be suffixed with "-<< param-1 >>-<< param-2 >>-..."
# to avoid collisions, but you can optionally change the naming scheme
os: [linux, macos]
name: build-on-<< matrix.os >>
# Any other parameter values expressed here will be passed through to
# each invocation
run_integration_tests: true
filters: *filters
- build-windows:
Expand Down
1 change: 0 additions & 1 deletion .tool-version

This file was deleted.

1 change: 1 addition & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodejs 16.20.2
Loading

0 comments on commit 3dca0d9

Please sign in to comment.