-
Notifications
You must be signed in to change notification settings - Fork 0
Add GitHub Actions for publishing packages to NPM registry #692
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Add publish-radfish.yml workflow for @nmfs-radfish/radfish package - Add publish-react-radfish.yml workflow for @nmfs-radfish/react-radfish package - Include admin permission checks, version bumping, testing, and publishing steps - Add rollback mechanisms for failed publishes
- Remove babel.config.js and jest.config.js - Update package.json to use vitest instead of jest - Replace jest imports with vitest imports in all test files - Remove Jest-related dependencies and add vitest dependencies - Clean up unnecessary dependencies from radfish package
- Add publishConfig for npm registry publishing - Add React as peer dependency - Configure package for public access
- Change tag format from @nmfs-radfish/[package]@[version] to [package]@[version] - Update both radfish and react-radfish workflows - Cleaner tag names since repository is already nmfs-radfish namespaced
- Add [package-name]@latest tags that get updated with each new version - Force push latest tags to always point to the most recent release - Provides a stable reference for the current version of each package
- For prereleases: only create/update beta tag - For stable releases: only create/update latest tag - Prevents latest tag from being updated by prereleases - Allows beta tag to become stale between prerelease cycles
- For prereleases: npm publish --tag beta - For stable releases: npm publish (defaults to latest tag) - Ensures npm registry tags match git tag behavior
jaygiang
previously approved these changes
Jul 14, 2025
Collaborator
jaygiang
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM ✅
- Update workflows to use github.ref instead of hardcoded main branch - Change step name from 'Checkout main branch' to 'Checkout repository' - Ensures workflows run against the current branch's code and dependencies - Fixes Jest vs Vitest test runner issue when running from feature branches
- Change from ^1.0.0 to >=1.0.0 <2.0.0 for @nmfs-radfish/radfish - Allows independent versioning of packages within major version - Prevents npm version bump conflicts in monorepo workspace - Commits to semantic versioning within v1.x.x releases
- Regenerate lockfile to reflect peer dependency change from ^1.0.0 to >=1.0.0 <2.0.0 - Should resolve npm version bump conflicts in workspace
- Change from >=1.0.0 <2.0.0 to ^1.0.0-0 for @nmfs-radfish/radfish - ^1.0.0-0 allows prereleases like 1.1.2-rc.1 while maintaining semver compatibility - Should resolve npm version bump issues with prerelease versions
- Add --legacy-peer-deps to npm version commands in both workflows - Resolves peer dependency conflicts when bumping prerelease versions - Allows using standard ^1.0.0 peer dependency format
- Replace separate version + prerelease inputs with single version_type dropdown - Remove complex conditional logic for determining version bump type - Auto-detect prerelease status from resulting version for npm publish tags - Remove redundant 'Navigate to package directory' steps - Eliminate ambiguity: users now explicitly choose exact version bump behavior Examples: - prerelease: 1.1.2-rc.1 → 1.1.2-rc.2 - preminor: 1.1.2-rc.1 → 1.2.0-rc.1 - minor: 1.1.2 → 1.2.0
- npm version command outputs multiline content that breaks GitHub Actions - Now run npm version to update package.json, then use jq to get clean version - Eliminates multiline output issues and removes 'v' prefix automatically - Results in clean version strings like '1.1.2-rc.3' instead of 'v1.1.2-rc.3\n...' - Fixes 'Unable to process file command output successfully' error
- Workflows were failing when run on feature branches because they tried to push to 'main' - Changed 'git push origin main' to 'git push origin HEAD' to push current branch - Now workflows work correctly on any branch, including feature branches for testing
- Ready to run workflow with prerelease version type - npm version prerelease will increment to 1.1.2-rc.1
- Resolves peer dependency conflicts during npm install - react-radfish has peer dependency ^1.0.0 but workspace has 1.1.1 - --legacy-peer-deps allows npm to proceed with installation
jaygiang
previously approved these changes
Aug 12, 2025
Collaborator
jaygiang
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved ✅
jaygiang
approved these changes
Aug 12, 2025
Collaborator
jaygiang
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM ✅
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR allows anyone with admin repo access to publish
@nmfs-radfish/radfishand@nmfs-radfish/react-radfishpackages to NPM.Simplified @nmfs-radfish/radfish package's test dependencies by migrating from Jest → Vitest. The ESM update from #691 fixed running tests from downstream applications, but caused issues when running the packages own test suite.
Also resolves #685.
When workflows require the:
This helps to determine the tags that will be created and updated when pushing to both npm and github.
Additionally, a GitHub release will be drafted to reference the [package]@[version] tag.