Skip to content

Update github actions#8

Open
rflamand wants to merge 11 commits intoImagingDataCommons:masterfrom
rflamand:feature/rflamand/add_github_actions
Open

Update github actions#8
rflamand wants to merge 11 commits intoImagingDataCommons:masterfrom
rflamand:feature/rflamand/add_github_actions

Conversation

@rflamand
Copy link
Contributor

@rflamand rflamand commented Dec 11, 2025

Update the github actions in this repository. The updates include:

  • Simplifying the existing run_unit_test.yml using pre-existing actions. These actions will setup emsdk.
  • Fix version for emsdk to 4.0.19. Also update BUILDING to represent this.
  • Create new action publish.yml that will publish a package to npm when a new release has been published. This will require the NODE_AUTH_TOKEN to be set in the project's secrets. Note that I've added some guard rails, mainly this actions will only run if the project is not a fork and the owner is ImagingDataCommons.

This PR tackles #7 .

@rflamand
Copy link
Contributor Author

@fedorov Is there anyone who can review this PR (and the other)?

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates GitHub Actions workflows to modernize CI/CD infrastructure and add automated npm publishing. The changes address issue #7 by implementing a publish workflow that will automatically publish the package to npm when a release is created. The Emscripten SDK version is also updated from 1.39.4 to 4.19.0.

Changes:

  • Simplified run_unit_tests.yml to use pre-existing actions for emsdk, Node.js, and dependency caching
  • Updated Emscripten SDK version from 1.39.4 to 4.19.0 in documentation
  • Added new publish.yml workflow to automatically publish npm packages on release with appropriate guard rails

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 7 comments.

File Description
BUILDING.md Updated documented Emscripten SDK version from 1.39.4 to 4.19.0
.github/workflows/run_unit_tests.yml Modernized workflow using pre-existing actions, simplified emsdk setup, updated action versions
.github/workflows/publish.yml New workflow for automated npm package publishing on release with repository ownership guards

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@fedorov
Copy link
Member

fedorov commented Jan 27, 2026

@rflamand can you please review comments from Copilot?

@rflamand
Copy link
Contributor Author

@rflamand can you please review comments from Copilot?

@fedorov thanks for the swift response. I've updated the code based on copilot's review.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 10 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

with:
version: 4.0.19
actions-cache-folder: '.emsdk-cache'

Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line appears to contain trailing whitespace. Remove the trailing spaces for cleaner formatting and consistency with YAML best practices.

Copilot uses AI. Check for mistakes.
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y liblcms2-dev autoconf
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CMake is required for the build (minimum version 3.16 per BUILDING.md) but is not explicitly installed in the dependencies step. While ubuntu-latest typically includes cmake, it's better to explicitly install it to ensure the required version is available and to make the dependency explicit. Add cmake to the apt-get install command on line 44.

Suggested change
sudo apt-get install -y liblcms2-dev autoconf
sudo apt-get install -y liblcms2-dev autoconf cmake

Copilot uses AI. Check for mistakes.
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y liblcms2-dev autoconf
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CMake is required for the build (minimum version 3.16 per BUILDING.md) but is not explicitly installed in the dependencies step. While ubuntu-latest typically includes cmake, it's better to explicitly install it to ensure the required version is available and to make the dependency explicit. Add cmake to the apt-get install command on line 48.

Suggested change
sudo apt-get install -y liblcms2-dev autoconf
sudo apt-get install -y liblcms2-dev autoconf cmake

Copilot uses AI. Check for mistakes.
run: |
sudo apt-get update
sudo apt-get install -y liblcms2-dev autoconf

Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line appears to contain trailing whitespace. Remove the trailing spaces for cleaner formatting and consistency with YAML best practices.

Suggested change

Copilot uses AI. Check for mistakes.
run: |
sudo apt-get update
sudo apt-get install -y liblcms2-dev autoconf

Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line appears to contain trailing whitespace. Remove the trailing spaces for cleaner formatting and consistency with YAML best practices.

Suggested change

Copilot uses AI. Check for mistakes.
Comment on lines 33 to 36
cache: 'yarn'
cache-dependency-path: |
package.json
yarn.lock
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The yarn cache configuration references yarn.lock in the cache-dependency-path, but this file does not exist in the repository. The cache will not work correctly without a lock file. Either remove the cache configuration or ensure yarn.lock is committed to the repository. If you want to use yarn caching, run yarn install locally to generate yarn.lock and commit it.

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are no dependencies so caching doesn't actually make sense. Removed the caching fields.

Comment on lines 84 to 87
cache: 'yarn'
cache-dependency-path: |
package.json
yarn.lock
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The yarn cache configuration references yarn.lock in the cache-dependency-path, but this file does not exist in the repository. The cache will not work correctly without a lock file. Either remove the cache configuration or ensure yarn.lock is committed to the repository. If you want to use yarn caching, run yarn install locally to generate yarn.lock and commit it.

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are no dependencies so caching doesn't actually make sense. Removed the caching fields.

Comment on lines 63 to 65
- name: Publish to npm
run: |
npm publish .
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The publish workflow does not verify that the version in package.json matches the release tag before publishing. Consider adding a validation step after checkout to ensure version consistency. For example, extract the version from package.json and compare it with the GitHub release tag to prevent publishing incorrect versions.

Copilot uses AI. Check for mistakes.
llvm \
node \
yarn
llvm
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CMake is required for the build (minimum version 3.16 per BUILDING.md) but is not explicitly installed in the dependencies step. While macos-latest typically includes cmake, it's better to explicitly install it to ensure the required version is available and to make the dependency explicit. Add cmake to the brew install command.

Suggested change
llvm
llvm \
cmake

Copilot uses AI. Check for mistakes.
with:
version: 4.0.19
actions-cache-folder: '.emsdk-cache'

Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line appears to contain trailing whitespace. Remove the trailing spaces for cleaner formatting and consistency with YAML best practices.

Suggested change

Copilot uses AI. Check for mistakes.
@fedorov
Copy link
Member

fedorov commented Jan 28, 2026

@rflamand more issues identified ... don't ask me why it didn't complain about cmake and lock earlier ...

Also: I have never ever published an npm package from scratch. There is no npm package for this one yet. Do you know if this is supposed to work and create that package "de novo"?

For the dicom-microscopy-viewer package, I create a token that has permission limited to that package. But in this case, there is no existing package to limit permissions, so it would need to have unlimited permissions.

@igoroctaviano maybe you know?

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@rflamand
Copy link
Contributor Author

@rflamand more issues identified ... don't ask me why it didn't complain about cmake and lock earlier ...

Also: I have never ever published an npm package from scratch. There is no npm package for this one yet. Do you know if this is supposed to work and create that package "de novo"?

For the dicom-microscopy-viewer package, I create a token that has permission limited to that package. But in this case, there is no existing package to limit permissions, so it would need to have unlimited permissions.

@igoroctaviano maybe you know?

I'm not 100% sure on this, I have also never published an npm repo from scratch. However, this is already published on npm, no? I would think that this is the npm package or do you mean something else?

@pieper
Copy link
Member

pieper commented Jan 28, 2026

I recently updated the npm publishing part of dcmjs if you want to look at a recent example github action.

@rflamand
Copy link
Contributor Author

I recently updated the npm publishing part of dcmjs if you want to look at a recent example github action.

Interesting, had not heard of semantic release before. @fedorov is this something we also want for libdicomicc or will we keep it at manual releases (for now)?

@fedorov
Copy link
Member

fedorov commented Jan 28, 2026

However, this is already published on npm, no? I would think that this is the npm package or do you mean something else?

OH! I missed that! So this and other related packages were originally developed by @hackermd when he was at MGH. He since moved to industry, and added me to the packages that we took under the IDC umbrella. Apparently, this specific package was missed... I am afraid we won't be able to do anything unless I get a response from Markus. I will email him right away to either transfer this one to me, or add me as a maintainer... Sorry I didn't realize this until now!

@fedorov
Copy link
Member

fedorov commented Jan 28, 2026

I recently updated the npm publishing part of dcmjs if you want to look at a recent example github action.

Interesting, had not heard of semantic release before. @fedorov is this something we also want for libdicomicc or will we keep it at manual releases (for now)?

I really have zero experience, I am fine either way. The easiest sounds good to me! All I can add is that this publish workflow we use in dicom-microscopy-viewer succeeded as recently as Jan 15, 2026, and it does not use semantic release: https://github.com/ImagingDataCommons/dicom-microscopy-viewer/blob/master/.github/workflows/publish.yml.

@fedorov
Copy link
Member

fedorov commented Feb 2, 2026

@rflamand I heard back from @hackermd - he is in the process of recovering his access to npm and setting up 2FA... I am not sure we can do much until that is sorted out.

@rflamand
Copy link
Contributor Author

rflamand commented Feb 3, 2026

@rflamand I heard back from @hackermd - he is in the process of recovering his access to npm and setting up 2FA... I am not sure we can do much until that is sorted out.

No worries, thanks for looking into it!

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.

3 participants