Skip to content

Latest commit

 

History

History
76 lines (58 loc) · 2.56 KB

PUBLISH_HOW_TO.md

File metadata and controls

76 lines (58 loc) · 2.56 KB

🚀 Packages Publishing

Stable / Beta versions

We could publish packages with the following options:

  • latest - stable version
  • beta - for beta testers. This version is available for the public

To switch between release modes, you could use the following commands:

  • latest - our default, but if we're in beta mode, you could switch to stable by running:
    yarn changeset pre exit
  • For the beta releases run:
    yarn changeset pre enter beta

📚 Publishing

Ensure you have a NPM account and this account is added to the @openapi-qraft organization.

  1. Login to NPM: yarn npm login --scope openapi-qraft
  2. Create new branch packages-version-update(-<version>) from the main branch.
  3. Run yarn install --immutable
  4. Run yarn build to validate that packages are building correctly.
  5. Run Changesets versioning:
    .changeset/version.sh
  6. Push your packages-version-update(-<version>) branch that were created on step 2 to the origin, and create a new Merge Request into main. Review it and merge.
  7. Checkout main branch
  8. Run yarn build to rebuild packages with the updated versions.
  9. Run command below and answer Y:
    .changeset/publish.sh
  10. Create the Git tags and push them to the origin:
    yarn changeset tag
  11. Profit! 🎉

🚫 We don't use changeset publish. Instead, we utilize Yarn for publishing. This allows us to replace the workspace:~ with a standard version syntax in our dependencies.

🔐 Authentication with the npm_TOKEN

Add NPM Auth Token into ~/.yarnrc.yml:

yarn config set 'npmScopes["openapi-qraft"]' --home \
  --json '{"npmAuthToken":"npm_YOUR_TOKEN", "npmAlwaysAuth":true}'

📍 Place .yarnrc.yml file in the directory above the application directory or in the user's $HOME directory. In this case, npmScopes will be inherited by the Yarn.

🧪 Pre-releases

Please read the documentation carefully before using pre-releases: 🔗 Changesets pre-releases

Manually publishing pre-releases is done in the same way as for regular releases. 🔄

The only difference is that you will need to manually commit the pre.json file (created on yarn changeset pre enter <tag>).

⚠️ Warning! Pre-releases are very complicated! Using them requires a thorough understanding of all parts of npm publishes. Mistakes can lead to repository and publish states that are very difficult to fix.