Skip to content

fix(ci): create the pack destination before npm pack - #17

Merged
alexanderolvera merged 1 commit into
mainfrom
fix/pack-destination-mkdir
Aug 9, 2026
Merged

fix(ci): create the pack destination before npm pack#17
alexanderolvera merged 1 commit into
mainfrom
fix/pack-destination-mkdir

Conversation

@alexanderolvera

Copy link
Copy Markdown
Owner

The first real run of the release pipeline (tag v2.0.1, run 31337884584) failed. Nothing was published — verify died before uploading, so publish was skipped and never reached the approval gate.

Cause

npm error code ENOENT
npm error path .../release-artifact/dfhack-remote-node-2.0.1.tgz

npm pack --pack-destination <dir> writes the tarball into <dir> but does not create it. The step assumed npm would mkdir -p on its way. Nothing before it creates release-artifact/ either, so the very first invocation was always going to fail — the bug just couldn't surface until a tag was actually pushed.

Reproduced locally both ways:

$ npm pack --pack-destination ./__no_such_dir     # ENOENT
$ mkdir -p ./__no_such_dir && npm pack ...        # dfhack-remote-node-2.0.1.tgz

Fix

mkdir -p release-artifact before the pack, under set -euo pipefail.

Verification

Simulated every verify step locally against this branch — version match, republish guard, npm ci, build, typecheck, lint, test, pack, and the publish job's exactly-one-tarball guard. All pass, and the pack now produces release-artifact/dfhack-remote-node-2.0.1.tgz.

Once merged, v2.0.1 gets retagged onto the fix and re-pushed. The tag can be reused because nothing was ever published under it.

`npm pack --pack-destination ./release-artifact` fails with ENOENT when the
directory does not exist — npm writes the tarball there but never creates the
path. The v2.0.1 tag hit this on the first real run of the pipeline: verify
built and tested cleanly, then died at the pack step, so publish never ran.

Reproduced locally: packing into a missing directory ENOENTs, packing into one
created first succeeds.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings August 9, 2026 21:55
@alexanderolvera
alexanderolvera merged commit b6ad9fa into main Aug 9, 2026
2 checks passed
@alexanderolvera
alexanderolvera deleted the fix/pack-destination-mkdir branch August 9, 2026 21:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 fixes the release workflow’s verify job so npm pack --pack-destination can successfully write the publishable tarball by ensuring the destination directory exists first. This aligns the pipeline with how npm pack behaves (it does not create --pack-destination automatically), preventing the first-tag release run from failing early.

Changes:

  • Add an explicit mkdir -p release-artifact before running npm pack --pack-destination ./release-artifact.
  • Run the pack step under set -euo pipefail (consistent with other multi-line run steps in the workflow).
  • Document the reason for the directory creation directly above the pack step.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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.

2 participants