ericclemmons / github-semantic-version

Automated semantic version releases powered by Github Issues.
MIT License
21 stars 8 forks source link

npm publish fails on this repo (through travis ci) with invalid permissions #18

Closed daveashworth closed 6 years ago

daveashworth commented 7 years ago

Deploy log from Travis CI:

npm ERR! Linux 4.8.7-040807-generic
npm ERR! argv "/home/travis/.nvm/versions/node/v5.8.0/bin/node" "/home/travis/.nvm/versions/node/v5.8.0/bin/npm" "publish"
npm ERR! node v5.8.0
npm ERR! npm  v3.7.3
npm ERR! code ENEEDAUTH
npm ERR! need auth auth required for publishing
npm ERR! need auth You need to authorize this machine using `npm adduser`
npm ERR! Please include the following file with any support request:
npm ERR!     /home/travis/build/ericclemmons/github-semantic-version/npm-debug.log
Error: Command failed: npm publish
npm ERR! Linux 4.8.7-040807-generic
npm ERR! argv "/home/travis/.nvm/versions/node/v5.8.0/bin/node" "/home/travis/.nvm/versions/node/v5.8.0/bin/npm" "publish"
npm ERR! node v5.8.0
npm ERR! npm  v3.7.3
npm ERR! code ENEEDAUTH
npm ERR! need auth auth required for publishing
npm ERR! need auth You need to authorize this machine using `npm adduser`
npm ERR! Please include the following file with any support request:
npm ERR!     /home/travis/build/ericclemmons/github-semantic-version/npm-debug.log
    at checkExecSyncError (child_process.js:469:13)
    at execSync (child_process.js:509:13)
    at Function.exec (/home/travis/build/ericclemmons/github-semantic-version/dist/Utils.js:62:48)
    at Version._callee4$ (/home/travis/build/ericclemmons/github-semantic-version/dist/Version.js:376:33)
    at tryCatch (/home/travis/build/ericclemmons/github-semantic-version/node_modules/regenerator-runtime/runtime.js:63:40)
    at GeneratorFunctionPrototype.invoke [as _invoke] (/home/travis/build/ericclemmons/github-semantic-version/node_modules/regenerator-runtime/runtime.js:337:22)
    at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/home/travis/build/ericclemmons/github-semantic-version/node_modules/regenerator-runtime/runtime.js:96:21)
    at step (/home/travis/build/ericclemmons/github-semantic-version/node_modules/babel-runtime/helpers/asyncToGenerator.js:17:30)
    at /home/travis/build/ericclemmons/github-semantic-version/node_modules/babel-runtime/helpers/asyncToGenerator.js:35:14
    at new Promise (/home/travis/build/ericclemmons/github-semantic-version/node_modules/core-js/library/modules/es6.promise.js:191:7)
npm ERR! Linux 4.8.7-040807-generic
npm ERR! argv "/home/travis/.nvm/versions/node/v5.8.0/bin/node" "/home/travis/.nvm/versions/node/v5.8.0/bin/npm" "run" "release"
npm ERR! node v5.8.0
npm ERR! npm  v3.7.3
npm ERR! code ELIFECYCLE
npm ERR! github-semantic-version@5.0.2 release: `node dist/cli.js --bump --changelog --push --publish`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the github-semantic-version@5.0.2 release script 'node dist/cli.js --bump --changelog --push --publish'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the github-semantic-version package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node dist/cli.js --bump --changelog --push --publish
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs github-semantic-version
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls github-semantic-version
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR!     /home/travis/build/ericclemmons/github-semantic-version/npm-debug.log
Script failed with status 1
failed to deploy

Before we push to Github or publish to npm, maybe we need to run pre-checks for permissions on both. One succeeding but not the other causes issues.

daveashworth commented 7 years ago

This would be an issue across all the versions of auto-publishers. Ex: https://github.com/sindresorhus/np/issues/99.

ericclemmons commented 7 years ago

@daveashworth LOL, I just found the same article!

I could've sworn that NPM_TOKEN from ~/.npmrc (when put into CI) is how we addressed this.

ericclemmons commented 7 years ago

Neat:

https://docs.travis-ci.com/user/deployment/npm/

daveashworth commented 7 years ago

@ericclemmons saw that too! Man, unless the NPM_TOKEN originally used for this repo is no longer valid, I also thought that was how the publish permissions were verified. 😞

Using npm as the provider in travis.yml would publish to npm for us, but would skip out on the rest of our gsv script, right?

ericclemmons commented 7 years ago

You're right. I just thought the token adding was easier. Although they still have to do it for GitHub...

On Mon, Dec 5, 2016, 3:49 PM Dave Ashworth notifications@github.com wrote:

@ericclemmons https://github.com/ericclemmons saw that too! Man, unless the NPM_TOKEN originally used for this repo is no longer valid, I also thought that was how the publish permissions were verified. 😞

Using npm as the provider would publish to npm for us, but would skip out on the rest of our gsv script, right?

β€” You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/ericclemmons/github-semantic-version/issues/18#issuecomment-264988305, or mute the thread https://github.com/notifications/unsubscribe-auth/AAA7TtbvpgIMjIWYwj0isQWAL9guWxPJks5rFIbxgaJpZM4LEuee .

--

  • Eric Clemmons
milesj commented 6 years ago

@ericclemmons I'm looking to add some new features to this project, but Travis currently failing. Could you double check the tokens in Travis are still valid?

ericclemmons commented 6 years ago

Just settled into Seattle & updated the token. 🀞

ericclemmons commented 6 years ago

Ok, GH_TOKEN was also wrong. Updated that & retrying the build...

https://travis-ci.org/ericclemmons/github-semantic-version

ericclemmons commented 6 years ago

It should work with the next release, but this error has occurred:

Error: No commits found in v7.6.0..HEAD

hipstersmoothie commented 6 years ago

any resolution to this?

hipstersmoothie commented 6 years ago

for me i resolved by adding this to my circleci/config.yml

- run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc