The npm Release workflow is designed to be triggered manually via workflow_dispatch with configurable input parameters. It performs a comprehensive npm package release process including tag validation, testing, Git tag creation, package publishing to npm registry, and GitHub release creation.
This workflow is triggered manually via workflow_dispatch with configurable input parameters.
- Runner:
ubuntu-latest - Purpose: Validates that the release tag does not already exist to prevent duplicate releases
- Condition: Only runs if not in dry-run mode (
!inputs.dry-run) - Uses:
netcracker/qubership-workflow-hub/actions/tag-checker@v1.0.7
- Runner:
ubuntu-latest(via reusable workflow) - Purpose: Performs a dry-run test of the npm package publishing process
- Dependencies: Requires
check-tagjob completion - Uses:
Netcracker/qubership-workflow-hub/.github/workflows/re-npm-publish.yml@v2.0.5 - Condition: Always runs regardless of previous job status
- Runner:
ubuntu-latest(via reusable workflow) - Purpose: Publishes the npm package to the registry
- Dependencies: Requires
npm-testjob completion - Condition: Only runs if not in dry-run mode (
!inputs.dry-run) - Uses:
Netcracker/qubership-workflow-hub/.github/workflows/re-npm-publish.yml@v2.0.5
- Runner:
ubuntu-latest(via reusable workflow) - Purpose: Creates a Git tag for the release
- Dependencies: Requires
npm-publishjob completion - Condition: Only runs if not in dry-run mode (
!inputs.dry-run) - Uses:
netcracker/qubership-workflow-hub/.github/workflows/tag-creator.yml@v1.0.7
- Runner:
ubuntu-latest(via reusable workflow) - Purpose: Creates a GitHub release from the Git tag
- Dependencies: Requires
tagjob completion - Condition: Only runs if not in dry-run mode (
!inputs.dry-run) - Uses:
netcracker/qubership-workflow-hub/.github/workflows/release-drafter.yml@v2.0.5
- Tag Validation → Package Test → Publishing → Tag Creation → Release Creation
In dry-run mode:
- Only tag validation and package test are executed
- No publishing, tagging, or release creation occurs
The workflow delegates the actual npm publishing process to the re-npm-publish.yml workflow from the qubership-workflow-hub repository, which performs:
- Repository checkout
- Node.js environment setup
- Dependency installation
- Lerna monorepo detection (if applicable)
- Dependency updates (if required)
- Package version updates in package.json or lerna.json
- Project build
- Test execution
- Changes commit and push
- Package publishing to npm registry
version(string, required): Release version for npm (e.g., 1.0.0)
scope(string, optional): npm scope for the package (default:@netcracker)node-version(string, optional): Node.js version to use (default:22.x)registry-url(string, optional): npm registry URL (default:https://npm.pkg.github.com)update-nc-dependency(boolean, optional): Update @netcracker dependencies (default:false)dry-run(boolean, optional): Run in dry-run mode without actual publishing (default:false)npm-dist-tag(string, optional): npm distribution tag (default:latest)
contents: write- For creating Git tags and GitHub releasespackages: write- For publishing npm packages to the registry
GITHUB_TOKEN- Used for GitHub API operations and npm authentication
Before using this workflow, you need to:
-
Adjust package.json
- Ensure proper project configuration
- Set up scopes and registry information if using scoped packages
-
Create GitHub release configuration
- Add or configure release drafter configuration file
- This is used by the release creation step
-
Review qubership-workflow-hub documentation
- See: npm publish reusable workflow
- Contains detailed npm project publish/release workflow instructions
- Trigger the workflow manually from GitHub Actions
- Provide the release version (e.g., 1.0.0)
- Configure optional parameters as needed
- Leave
dry-runasfalse(default) - Workflow will:
- Validate the tag doesn't exist
- Run tests in dry-run mode
- Publish the package to npm
- Create a Git tag
- Create a GitHub release
- Trigger the workflow manually from GitHub Actions
- Set
dry-runtotrue - Provide any desired parameters
- Workflow will:
- Validate the tag (if specified)
- Run tests without publishing
- Report results without creating tags or releases
- Useful for validating the release process
For Lerna monorepos:
- Ensure the project is properly configured as a Lerna monorepo
- Set
update-nc-dependencytotrueif needed to update @netcracker dependencies - The workflow will automatically detect and handle Lerna configuration
- Tag validation: Prevents duplicate releases by checking for existing tags
- Dry-run support: Test the entire release process without publishing
- Comprehensive testing: Runs tests before publishing to ensure quality
- Monorepo support: Automatically detects and handles Lerna monorepos
- Scoped packages: Supports @netcracker scoped packages
- Distribution tags: Allows setting custom npm distribution tags
- GitHub integration: Creates releases automatically after publishing
- Manual control: Manually triggered for precise release management
- Dependency management: Can update @netcracker dependencies during release
- This workflow is designed for production releases and should be triggered manually when ready to publish
- Version parameter is required for production releases
- In dry-run mode, no actual publishing, tagging, or release creation occurs
- Duplicate release prevention is handled by tag validation
- All operations are logged in the GitHub Actions workflow summary
- Node.js
- npm
- Automation
- Release Management
- npm
- release
- node
- publishing
- automation