-
Check package name availability:
npm search openqa
If "openqa" is taken, you'll need to use a scoped name like
@auto-browse/openqa -
Login to npm:
npm login
# In openqa repo
npm pack
# Creates: openqa-0.0.1.tgz
# In test project
npm install /path/to/openqa-0.0.1.tgz
npm install playwright-bdd @playwright/test
npx openqa init playwright-bdd# In openqa repo
npm version 0.0.2-beta.0
npm publish --tag beta
# In test project
npm install openqa@beta-
Verify package contents:
npm pack --dry-run
This shows what files will be included in the package.
-
Publish to npm:
npm publish
For first-time publish of a public package:
npm publish --access public
After publishing to npm, create a GitHub release:
- Go to GitHub Actions in your repository
- Run the "Release" workflow manually
- The workflow will automatically:
- Create a git tag (v0.0.1)
- Create a GitHub release
- Link to the npm package
Or manually create a release:
git tag v0.0.1
git push origin v0.0.1Then create the release on GitHub UI.
Before publishing, ensure:
- ✅ All tests pass
- ✅ Tested with
npm linkornpm pack - ✅ CLI tool works:
npx openqa init playwright-bdd - ✅ README is up to date
- ✅ Branch merged to main
- ✅ Version bumped appropriately
When releasing new versions:
-
Merge feature branch to main:
git checkout main git merge feat/your-feature
-
Update version in package.json:
npm version patch # 0.0.1 -> 0.0.2 (bug fixes) npm version minor # 0.0.1 -> 0.1.0 (new features) npm version major # 0.0.1 -> 1.0.0 (breaking changes)
This automatically:
- Updates package.json
- Creates a git commit
- Creates a git tag
-
Push to GitHub:
git push && git push --tags -
Publish to npm:
npm publish
-
Run GitHub Release workflow (optional)
After publishing, verify:
- npm package: https://www.npmjs.com/package/openqa
- GitHub release: https://github.com/auto-browse/openqa/releases
- Installation works:
npm install openqain a test project