Skip to content

feat: add dev build mode to npm publish workflow#56

Merged
scotwells merged 2 commits intomainfrom
feat/npm-dev-builds
Mar 11, 2026
Merged

feat: add dev build mode to npm publish workflow#56
scotwells merged 2 commits intomainfrom
feat/npm-dev-builds

Conversation

@scotwells
Copy link
Copy Markdown
Contributor

@scotwells scotwells commented Mar 11, 2026

Summary

  • Add release-mode input to publish-npm-package.yaml with two modes:
    • dev (default): publishes x.y.z-dev.{sha} to the dev npm dist-tag. No version bump commit, no git tag.
    • release: existing behavior — auto-bumps version from PR labels, creates git tag, publishes stable version to latest.
  • Skip path filtering for release mode — releases are intentional and should always publish
  • Document the workflow in CLAUDE.md with single-file caller example

Single workflow file for both modes

Callers use one workflow with a dynamic release-mode expression:

name: Publish Package
on:
  push:
    branches: [main]
  release:
    types: [published]

jobs:
  publish:
    uses: datum-cloud/actions/.github/workflows/publish-npm-package.yaml@v1
    with:
      package-name: "@datum-cloud/my-package"
      package-path: packages/my-package
      release-mode: ${{ github.event_name == 'release' && 'release' || 'dev' }}
    secrets: inherit
  • Push to mainrelease-mode: dev → publishes 0.1.2-dev.abc1234 to dev tag
  • GitHub releaserelease-mode: release → bumps version, publishes to latest tag

Backwards compatibility note

The default release-mode is dev. Existing callers that don't pass the input will switch from stable to dev builds. They need to either:

  1. Add release-mode: release to keep current behavior, or
  2. Adopt the single-file pattern above for both dev + release

Test plan

  • Verify workflow YAML passes actionlint
  • Test dev mode: push a change, confirm x.y.z-dev.{sha} published with dev tag
  • Test release mode: create a GitHub release, confirm version bump + stable publish
  • Verify release mode skips path filtering (always publishes)

🤖 Generated with Claude Code

Add a `release-mode` input to the publish-npm-package workflow:

- `dev` (default): publishes x.y.z-dev.{sha} to the `dev` dist-tag
  on every push to main. No version bump commit or git tag created.
- `release`: existing behavior — bumps version, creates git tag,
  publishes stable version to `latest` dist-tag.

This lets consumers iterate quickly on dev builds while controlling
when stable releases are cut.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@scotwells scotwells requested a review from kevwilliams March 11, 2026 18:18
Release events are intentional — skip the dorny/paths-filter check and
always publish. This lets callers use a single workflow file with a
dynamic release-mode expression based on github.event_name.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
scotwells added a commit to datum-cloud/activity that referenced this pull request Mar 11, 2026
Switch to the dev/release dual-mode workflow:
- Push to main publishes x.y.z-dev.{sha} to the `dev` npm dist-tag
- GitHub releases publish stable versions to `latest`

References datum-cloud/actions#56 for the shared workflow change.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@scotwells scotwells merged commit 12c9506 into main Mar 11, 2026
3 checks passed
@scotwells scotwells deleted the feat/npm-dev-builds branch March 11, 2026 18:26
scotwells added a commit to datum-cloud/activity that referenced this pull request Mar 11, 2026
## Summary
- Switch `publish-ui-npm.yaml` to the dual-mode dev/release workflow
pattern
- **Push to main** → publishes `x.y.z-dev.{sha}` to the `dev` npm
dist-tag
- **GitHub release** → publishes stable version to `latest` npm dist-tag
with auto version bump

Currently references `datum-cloud/actions@feat/npm-dev-builds` — update
to the tagged release once
[datum-cloud/actions#56](datum-cloud/actions#56)
is merged and tagged.

## Test plan
- [ ] Merge and verify a dev build is published (e.g.,
`0.1.2-dev.abc1234`)
- [ ] Verify `npm install @datum-cloud/activity-ui@dev` resolves the new
version
- [ ] Create a GitHub release and verify stable publish works

🤖 Generated with [Claude Code](https://claude.com/claude-code)
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