Publishing docker-to-iac module to NPM
We have created an organization @deploystack for NPM. Publishing in NPM happens automatically through semantic-release
. Config: https://github.com/deploystackio/docker-to-iac/blob/main/.github/workflows/release-pr.yml
Release Process Overview
The release process follows these steps:
- Initiate a release preparation using the GitHub workflow
- Review and merge the release pull request
- Automatic publishing to NPM when the release PR is merged
Starting a Release
Releases can be initiated through the GitHub Actions UI:
- Navigate to the "Actions" tab in the repository
- Select the "Release Process" workflow
- Click "Run workflow"
- Choose the release type:
patch
(bug fixes)minor
(new features)major
(breaking changes)
- Optionally select "Prerelease" for beta versions
- Click "Run workflow"
What Happens During Release Preparation
The workflow performs the following steps:
- Updates the version in package.json based on conventional commits
- Updates the CHANGELOG.md file with details of changes since the last release
- Creates a new branch with these changes (named
release-v{version}
) - Provides a link to create a pull request
Creating the Pull Request
After the workflow completes:
- Follow the link provided in the workflow output to create a pull request
- Important: Add the
release
label to your pull request - Request a review of the PR
Publishing Process
When the pull request with the release
label is merged:
- The GitHub Action automatically creates a Git tag for the new version
- A GitHub release is created with the changelog contents
- The package is built using
npm run build
- The package is published to NPM with public access
Npm Package
The published package is available at: https://www.npmjs.com/package/@deploystack/docker-to-iac
Conventional Commits
The project uses conventional commits to determine version bumps and generate changelogs. Commit messages should follow this pattern:
feat: ...
- A new feature (minor version bump)fix: ...
- A bug fix (patch version bump)chore: ...
- Maintenance changesdocs: ...
- Documentation changesstyle: ...
- Code style changesrefactor: ...
- Code refactoringperf: ...
- Performance improvementstest: ...
- Test updates
Breaking changes should include BREAKING CHANGE:
in the commit message body or footer.
Configuration Files
The release process is configured through several files:
.github/workflows/release-pr.yml
- GitHub Actions workflow.release-it.js
- Configuration for release-itpackage.json
- NPM scripts for the release process