Conversation
|
@fedorov Is there anyone who can review this PR (and the other)? |
There was a problem hiding this comment.
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.ymlto 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.ymlworkflow 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.
|
@rflamand can you please review comments from Copilot? |
There was a problem hiding this comment.
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.
.github/workflows/publish.yml
Outdated
| with: | ||
| version: 4.0.19 | ||
| actions-cache-folder: '.emsdk-cache' | ||
|
|
There was a problem hiding this comment.
This line appears to contain trailing whitespace. Remove the trailing spaces for cleaner formatting and consistency with YAML best practices.
.github/workflows/run_unit_tests.yml
Outdated
| - name: Install dependencies | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y liblcms2-dev autoconf |
There was a problem hiding this comment.
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.
| sudo apt-get install -y liblcms2-dev autoconf | |
| sudo apt-get install -y liblcms2-dev autoconf cmake |
.github/workflows/publish.yml
Outdated
| - name: Install dependencies | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y liblcms2-dev autoconf |
There was a problem hiding this comment.
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.
| sudo apt-get install -y liblcms2-dev autoconf | |
| sudo apt-get install -y liblcms2-dev autoconf cmake |
.github/workflows/run_unit_tests.yml
Outdated
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y liblcms2-dev autoconf | ||
|
|
There was a problem hiding this comment.
This line appears to contain trailing whitespace. Remove the trailing spaces for cleaner formatting and consistency with YAML best practices.
.github/workflows/publish.yml
Outdated
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y liblcms2-dev autoconf | ||
|
|
There was a problem hiding this comment.
This line appears to contain trailing whitespace. Remove the trailing spaces for cleaner formatting and consistency with YAML best practices.
.github/workflows/run_unit_tests.yml
Outdated
| cache: 'yarn' | ||
| cache-dependency-path: | | ||
| package.json | ||
| yarn.lock |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
There are no dependencies so caching doesn't actually make sense. Removed the caching fields.
.github/workflows/run_unit_tests.yml
Outdated
| cache: 'yarn' | ||
| cache-dependency-path: | | ||
| package.json | ||
| yarn.lock |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
There are no dependencies so caching doesn't actually make sense. Removed the caching fields.
.github/workflows/publish.yml
Outdated
| - name: Publish to npm | ||
| run: | | ||
| npm publish . |
There was a problem hiding this comment.
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.
.github/workflows/run_unit_tests.yml
Outdated
| llvm \ | ||
| node \ | ||
| yarn | ||
| llvm |
There was a problem hiding this comment.
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.
| llvm | |
| llvm \ | |
| cmake |
.github/workflows/run_unit_tests.yml
Outdated
| with: | ||
| version: 4.0.19 | ||
| actions-cache-folder: '.emsdk-cache' | ||
|
|
There was a problem hiding this comment.
This line appears to contain trailing whitespace. Remove the trailing spaces for cleaner formatting and consistency with YAML best practices.
|
@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? |
There was a problem hiding this comment.
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.
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? |
|
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)? |
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! |
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 |
Update the github actions in this repository. The updates include:
run_unit_test.ymlusing pre-existing actions. These actions will setupemsdk.emsdkto 4.0.19. Also updateBUILDINGto represent this.publish.ymlthat will publish a package to npm when a new release has been published. This will require theNODE_AUTH_TOKENto 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 isImagingDataCommons.This PR tackles #7 .