0.0.6 • Published 7 months ago

guess-npm-dist-tag v0.0.6

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

guess-npm-dist-tag

Automatically determine the dist-tag from the current latest and the new version number when npm publish.

npm version supported Node.js version ci status license

Usage: CLI

$ npx guess-npm-dist-tag
latest

Compare the version number of the local package.json in CWD with the latest version retrieved from the npm registry and output the most appropriate dist-tag like latest, latest-3ornext.

You can use this with npm publish --tag in GitHub Actions.

steps:
  - uses: actions/checkout@v4
  - uses: actions/setup-node@v3
    with:
      node-version: "20.x"
      registry-url: "https://registry.npmjs.org"
  - run: npm ci
  - run: npm publish --tag $(npx guess-npm-dist-tag)
    env:
      NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

See setup-node and "Publishing Node.js packages" in GitHub Docs.

License

MIT License: Teppei Sato <teppeis@gmail.com>

0.0.6

7 months ago

0.0.4

7 months ago

0.0.3

7 months ago

0.0.2

7 months ago