feat(ci): add automated npm publish pipeline via semantic-release - #38
Draft
gmenher wants to merge 1 commit into
Draft
feat(ci): add automated npm publish pipeline via semantic-release#38gmenher wants to merge 1 commit into
gmenher wants to merge 1 commit into
Conversation
gmenher
force-pushed
the
feat/npm-publish-pipeline
branch
2 times, most recently
from
August 13, 2026 14:14
d2e3cdd to
2598af0
Compare
Adds a publish workflow gated on CI success via workflow_run trigger. Uses semantic-release to automate versioning and npm publishing based on conventional commits. Prerequisite: NPM_TOKEN secret must be configured in repo settings.
gmenher
force-pushed
the
feat/npm-publish-pipeline
branch
from
August 13, 2026 14:23
2598af0 to
6069a53
Compare
Contributor
Author
|
This PR will move to ready-for-review once someone with admin access adds the Feel free to mark it ready and merge once that's in place (after #36 lands). |
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
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.
Closes #11
Description
Adds an automated npm publish pipeline so that
openshell-dashboardis published to the npm registry on every merge tomainthat passes CI. This enablesodh-dashboard(and any other consumer) to install the package directly from npm instead of relying on git dependencies or local symlinks.Currently, publishing is manual and error-prone — the version is hardcoded and there's no CI gate ensuring tests pass before a release goes out. This PR automates the entire flow using
semantic-release, which determines the next version from conventional commit messages, generates release notes, and publishes atomically.What changed
.github/workflows/publish.yml(new): Publish workflow triggered viaworkflow_runafter the CI workflow completes successfully onmain. Pinssemantic-release@25.0.9via npx. Installs frontend deps, builds the library, and runs semantic-release..releaserc.json(new): semantic-release configuration — commit-analyzer, release-notes-generator, npm (targetingfrontend/as pkgRoot), and github plugin for creating GitHub Releases.frontend/package.json(1 line): Version changed to0.0.0-semantically-released— semantic-release manages the actual version at publish time..gitattributes(new): Markspackage-lock.jsonfiles aslinguist-generatedso GitHub collapses them in future PR diffs.Design decisions
1.
workflow_runinstead ofon: pushwithpaths:The publish workflow does NOT trigger directly on push. Instead, it listens for the CI workflow to complete successfully. This guarantees that lint, typecheck, and unit tests all pass before any package is published. A
paths:filter can't enforce this — it would race with CI.2. Pinned
npx semantic-release@25.0.9instead of rootpackage.jsonAlternative considered: adding a root
package.jsonwith semantic-release as a devDependency. This was rejected because it introduces a 5,600-linepackage-lock.jsonfor a single CI tool. Pinning in the npx call gives version stability without bloating the repo. The plugins are resolved by semantic-release itself from.releaserc.json.3.
0.0.0-semantically-releasedversion placeholderStandard pattern for semantic-release managed packages. The actual version is written by the
@semantic-release/npmplugin during publish. The placeholder prevents accidental manual publishes with a stale version.4. No
id-token: writepermission (OIDC provenance)npm provenance requires
id-token: write. This can be added later when the package is established. For now, we keep permissions minimal.Dependencies
fix/npm-package-publishable) must merge first — it fixes theexportsmap andfilesfield so the published tarball actually works.NPM_TOKENmust be configured in repo Settings → Secrets → Actions before the first publish will succeed.mainwith afeat:orfix:commit will trigger the first release.How Has This Been Tested?
1. Local build validation
Build succeeds. All 10 export paths verified:
2. semantic-release dry run
Result — all plugins loaded correctly:
3. Export map resolution
Result:
4. Why this testing approach
Full end-to-end validation (actual npm publish) is not possible without the
NPM_TOKENsecret configured and a merge tomain. The local validation confirms: