Template
ci: release workflows — npm setup + archive from source dir (not dist) #35
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Audit and fix the release workflows so npm/MCP repos have a correct Node/npm setup and so the release archive is built from the source directory (per design), not from
dist/.Findings
npm-auto-release.yml: hassetup-node+npm ci+npm run build, but:dist:tar -czf "…tar.gz" -C dist .— this contradicts "the release system zips from the source directory."src/**andsrc/index.ts.registry-urlconfigured.pre-release.yml: PHP/Joomla-only (installsphp-cli,mbstring,composer); zero Node/npm setup. If npm repos inherit this generic pre-release, they have no Node path.Requirements
npm-auto-release.yml:resolve-source-dircomposite action; archive from the resolvedsource_dirinstead ofdist.src/**/src/index.tswith the resolved dir (entry file derived from it).registry-url: 'https://registry.npmjs.org'where npm auth is needed; verify Node setup is complete for the release path.pre-release.yml: decide the npm path — either gate the PHP/Joomla steps to Joomla repos and add a Node-aware branch, or split out a dedicatednpm-pre-release.yml. Ensure any release workflow that runs for npm repos performssetup-node→ install → build.Acceptance Criteria
npm-auto-release.ymlarchives from the resolved source dir (notdist).src/literal remains innpm-auto-release.yml.registry-urlpresent where npm publish/auth occurs.pre-release.yml).Notes
resolve-source-dircomposite action (metadata source-dir resolver issue). Author in parallel; merge the resolver first so CI references resolve.Authored-by: Moko Consulting
Scope refinement (release artifacts): npm releases must attach two ZIP artifacts, mirroring the Joomla release convention:
${REPO_NAME}-${VERSION}.zip— the whole repository (tracked files only; no.git/node_modules/dist). Built viagit archive --format=zip HEAD.${REPO_NAME}-${VERSION}-source.zip— the resolved source-directory subtree only (like Joomla's element zip). Built viagit archive --format=zip HEAD:<resolved_source_dir>.Both are uploaded to the release. This replaces the single
.tar.gzartifact. Packaging must run after the release/version-badge commit so both zips reflect the released tree.Authored-by: Moko Consulting
Status: implemented, pending testing (merged to
devvia PR #38, promoted tomainvia #39).Testing checklist (run
npm-auto-release.ymlin a child repo):${REPO}-${VERSION}.zip(full repo) and${REPO}-${VERSION}-source.zip(source subtree).source/contents; full-repo zip excludes.git/node_modules.gh release uploadfailure fails the job (no green release with missing artifacts)..resolved source dir → job errors instead of shipping a misleading source zip.pre-release.ymlon an npm repo emits the "not applicable" notice and does not install the PHP toolchain or callphp.Authored-by: Moko Consulting