Skip to content
Open
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
66 changes: 66 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Publish

on:
release:
types: [published]

jobs:
publish:
name: Publish npm package on release
runs-on: ubuntu-latest
# Guard rails: only publish from canonical repo, never from forks
if: >-
github.event.repository.fork == false &&
github.repository_owner == 'ImagingDataCommons'
permissions:
contents: read
concurrency:
group: npm-publish-${{ github.ref }}
cancel-in-progress: false
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Install emscript
uses: mymindstorm/setup-emsdk@v14
with:
version: 4.0.19
actions-cache-folder: '.emsdk-cache'

- name: Setup Node with yarn cache
uses: actions/setup-node@v4
with:
node-version: '22.16.0'
cache: 'yarn'
cache-dependency-path: |
package.json
yarn.lock

- name: Install yarn package manager
run: npm install --global yarn

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y liblcms2-dev autoconf

- name: Build and install library
run: |
mkdir build
cd build
cmake ..
make
sudo make install

- name: Build WebAssembly bindings
run: |
yarn run clean
yarn run build

- name: Publish to npm
run: |
npm publish .
env:
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
91 changes: 49 additions & 42 deletions .github/workflows/run_unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,33 +15,34 @@ jobs:
matrix:
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v2
- name: Install build and test dependencies
run: |
export DEBIAN_FRONTEND=noninteractive
export DEBCONF_NONINTERACTIVE_SEEN=true
sudo apt-get update
sudo apt-get install -y --no-install-suggests --no-install-recommends \
autogen \
dh-autoreconf \
build-essential \
clang \
cmake \
git \
liblcms2-dev \
llvm \
libtool \
nodejs \
npm \
pkg-config \
python3 \
shtool \
valgrind
sudo apt-get clean
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Install emscript
uses: mymindstorm/setup-emsdk@v14
with:
version: 4.0.19
actions-cache-folder: '.emsdk-cache'

- name: Setup Node with yarn cache
uses: actions/setup-node@v4
with:
node-version: '22.16.0'
cache: 'yarn'
cache-dependency-path: |
package.json
yarn.lock

- name: Install yarn package manager
run: npm install --global yarn

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y liblcms2-dev autoconf

- name: Build and install library
run: |
mkdir build
Expand All @@ -50,26 +51,13 @@ jobs:
make
sudo make install

- name: Build and install Emscripten SDK
run: |
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
git pull
./emsdk install latest
./emsdk activate latest
source ./emsdk_env.sh

- name: Build WebAssembly bindings
run: |
yarn run clean
sh ./emsdk/emsdk activate latest
source ./emsdk/emsdk_env.sh
yarn run build

- name: Perform npm package publish dry run
run: |
sh ./emsdk/emsdk activate latest
source ./emsdk/emsdk_env.sh
npm publish . --dry-run

macos:
Expand All @@ -78,20 +66,39 @@ jobs:
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v2
- name: Install build and test dependencies
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Install emscript
uses: mymindstorm/setup-emsdk@v14
with:
version: 4.0.19
actions-cache-folder: '.emsdk-cache'

- name: Setup Node with yarn cache
uses: actions/setup-node@v4
with:
node-version: '22.16.0'
cache: 'yarn'
cache-dependency-path: |
package.json
yarn.lock

- name: Install yarn package manager
run: npm install --global yarn

- name: Install dependencies
run: |
brew update
brew upgrade
brew install \
autoconf \
automake \
emscripten \
libtool \
little-cms2 \
llvm \
node \
yarn
llvm

- name: Build and install library
run: |
Expand Down
2 changes: 1 addition & 1 deletion BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ The examples expects the lcms2, dicom, and dicomicc libraries to be already inst
The build dependencies used for building the WASM binding are as follows:

* CMake 3.16
* Emscripten SDK 1.39.4
* Emscripten SDK 4.19.0

Earlier versions may work but have not been tested.

Expand Down