The package can be automatically published via CI on tag
, but we have also included helpers to manually publish via Task commands.
- Before merging your PR, set the desired version in the respective package.json(s)
- After merging your PR to the default branch, tag which package(s) should be published, e.g.,
git tag express/v0.0.1
. Note the tag must match the pattern in the correspondingpublish-*.yml
GitHub Action workflow to trigger publishing (sdk/*
,express/*
,hapi/*
). - Push your tags,
git push origin main --tags
- Confirm the GHA completes and the new version is published.
Step 2 & 3 can be simplified using, task git:tag-and-push -- express/v0.0.1
. Run this once for each tag you intend to create.
Note: Consider publishing through CI :)
- Have an NPM publish token for the packages to publish
- Before merging your PR set the desired version in the respective package.json(s)
- After merging, run the task(s) for the packages to publish,
By default, the publish task will default to DRY_RUN=true and display the package and version that would be published.
➜ task -l | grep publish * express:publish: Publish @useoptic/express-middleware * hapi:publish: Publish @useoptic/hapi-middleware * sdk:publish: Publish @useoptic/optic-node-sdk
git tag -d -- <the tag>
git push origin -- :refs/tags/<the tag>