Skip to content

Harden reusable npm release workflow for monorepos and build failures #1

@DexterStorey

Description

@DexterStorey

Context

While wiring @rubriclab/concrete to the shared rubriclab/package/.github/workflows/release-package.yml@main workflow, we had to add a package-local prepublishOnly guard because the reusable workflow currently does not fail safely in a few release-critical cases.

Issues

  • The build step probes by running bun run build; when the build command exists but fails, the workflow can fall through as if no build script exists.
  • Monorepo packages need separate install and publish/build directories, or at least a first-class package-directory input that is used consistently.
  • The CLI should support version/changelog updates for a package directory without requiring callers to cd into the package first.
  • CI installs should support frozen lockfiles for deterministic releases.

Requested behavior

  • Detect whether a build script exists without executing it as the probe.
  • If a build script exists and fails, fail the release job hard.
  • Add explicit monorepo-safe inputs for install directory and package publish directory.
  • Add a CLI option for package-directory version/changelog bumps.
  • Prefer frozen installs in the reusable workflow.

Concrete workaround

Concrete is using the workflow as-is, but adds prepublishOnly to run typecheck, tests, lint, and npm pack --dry-run --json before npm publish can proceed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions