Skip to content

Conversation

@yoannmoinet
Copy link
Member

@yoannmoinet yoannmoinet commented Jan 16, 2026

Add Multi-Channel Publishing Support to GitHub Actions Workflow

Summary

This PR enhances the NPM publish workflow to support publishing packages to different NPM distribution channels (latest and dev), enabling development releases and pre-releases without affecting the stable release channel.

Changes

Workflow Dispatch Inputs

Added two new input parameters for manual workflow triggers:

  1. channel (required, default: dev):

    • Choice between latest or dev
    • Determines which NPM distribution tag to use when publishing
  2. version (optional):

    • Allows specifying a custom version to publish
    • Only restricted for latest channel on master branch
    • If empty, uses the current version in package.json

Validation Rules

  • Branch Restriction: The latest channel can only be published from the master branch

    • Prevents accidental production releases from feature branches
    • dev channel can be published from any branch
  • Version Override Restriction: Custom version cannot be provided when publishing to latest channel from master branch

    • For latest channel on master, the version from package.json must be used
    • Ensures the canonical production version is always published to latest
    • Other channels on master (e.g., dev) can use custom versions
    • Feature branches can always override version for testing
  • Version Format Validation: For dev channel publishes, enforces version format X.Y.Z-dev.N

    • Example: 3.0.9-dev.0, 3.0.9-dev.1, etc.
    • Workflow fails if dev channel is used with incorrect version format

Publishing Logic

  • dev channel: Publishes with --tag dev flag

    • Users install with: npm install @datadog/webpack-plugin@dev
  • latest channel: Publishes without tag (default latest)

    • Users install with: npm install @datadog/webpack-plugin

Logging Updates

  • Log messages now include the channel information
  • Datadog log payload includes channel field for better observability

Usage Examples

Publish development release from feature branch

  1. [optional] Create version 3.0.9-dev.0 in your branch
  2. Trigger workflow_dispatch with:
    • channel: dev
    • version: 3.0.9-dev.0 (or leave empty to use current version)

Publish stable release from master

  1. Ensure you're on master branch
  2. Update version in package.json if needed (you can use bump.yaml for it)
  3. Trigger workflow_dispatch with:
    • channel: latest
    • version: leave empty (will use package.json version)

Publish dev release from master with custom version

  1. Ensure you're on master branch
  2. Trigger workflow_dispatch with:
    • channel: dev
    • version: 3.0.9-dev.0 (custom version allowed for non-latest channels)

Automatic release (unchanged)

  • GitHub releases continue to trigger the workflow automatically
  • Publishes to latest channel by default

@datadog-datadog-prod-us1
Copy link

datadog-datadog-prod-us1 bot commented Jan 16, 2026

✅ Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: b4f55db | Docs | Datadog PR Page | Was this helpful? Give us feedback!

@yoannmoinet yoannmoinet marked this pull request as ready for review January 16, 2026 15:48
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