yahoo / badge-up

This is a simple library that generates SVG badges without Cairo.
https://www.npmjs.com/package/badge-up
Other
9 stars 12 forks source link

Use semantic-release to publish to npm #19

Open tkyi opened 4 years ago

tkyi commented 4 years ago

Issue

The package was last published 3 years ago manually. Would like to publish new versions.

Request

It would be nice to set up the Screwdriver pipeline so it can publish using semantic release.

Steps

tkyi commented 4 years ago

Seeing these errors since the last published version's commit is missing in the Git history:

00:00:25 $ ./node_modules/.bin/semantic-release pre && npm publish && ./node_modules/.bin/semantic-release post
00:00:26 semantic-release ERR! commits The commit the last release of this package was derived from is not in the direct history of the "master" branch.
00:00:26 semantic-release ERR! commits This means semantic-release can not extract the commits between now and then.
00:00:26 semantic-release ERR! commits This is usually caused by force pushing, releasing from an unrelated branch, or using an already existing package name.
00:00:26 semantic-release ERR! commits You can recover from this error by publishing manually or restoring the commit "40b02ddbca262a484f6d47a43fac704e9c7c49d0".
00:00:26 semantic-release ERR! pre Failed to determine new version.
00:00:26 semantic-release ERR! pre ENOTINHISTORY Commit not in history
tkyi commented 4 years ago

Ref: https://github.com/semantic-release/semantic-release/issues/132#issuecomment-157161460 Ended up publishing to npm manually and pushing the latest tags manually:

  1. Set the version
    npm version 2.4.0 
  2. Published to npm
    npm publish --tag latest
  3. Pushed the tag to git
    git push origin --tags
tkyi commented 4 years ago

Still getting a similar error message but with a different commit sha.

00:00:25 $ ./node_modules/.bin/semantic-release pre && npm publish && ./node_modules/.bin/semantic-release post
00:00:26 semantic-release ERR! commits The commit the last release of this package was derived from is not in the direct history of the "master" branch.
00:00:26 semantic-release ERR! commits This means semantic-release can not extract the commits between now and then.
00:00:26 semantic-release ERR! commits This is usually caused by force pushing, releasing from an unrelated branch, or using an already existing package name.
00:00:26 semantic-release ERR! commits You can recover from this error by publishing manually or restoring the commit "b219c513aa7e9826e30260371bb582815ed1eb3b".
00:00:26 semantic-release ERR! pre Failed to determine new version.
00:00:26 semantic-release ERR! pre ENOTINHISTORY Commit not in history
tkyi commented 4 years ago

Ran these commands to publish new major version:

  1. Manually publish new version to npm
    npm --no-git-tag-version version 3.0.0
  2. Make sure local tag doesn't already exist
    git tag -d v3.0.0
    git tag -a v3.0.0 -m "Only support node10 and up"
  3. Push new tag
    git push --tags -f

    Helpful commands:

    • Check local git tags
      git ls-remote --tags
    • Check local git logs for version tags, etc
      git log
brettz9 commented 4 years ago

Looks like this is working? 🎉 Can the issue be closed if so?