Closed foopoiuyt closed 7 years ago
Added --access as well.
LGTM
how to use it ? In the document I can't find anything about set publish tag,
like 0.0.0-0 I want to publish as tag beta , I can't find a param to publish beta tag
Just set the tag Attribute within your drone config
can I set a npm publish tag to a file , just like plugins/docker if .tags
file exist get tags from the .tags
file
like the sample, if get a tag from '.npm_tag' file will be easy, I can add a preset step to set npm publish tag
pipeline:
# tag: 1.0.1-0
npm_publish: &npm_publish
when: { event: tag }
image: plugins/npm
username: shynome
email: shynome@gmail.com
secrets: [ npm_token ]
tag: beta
# tag: 1.0.1
npm_dev_publish:
when: { event: tag }
<<: *npm_publish
tag: latest
preset:
image: node
commad:
- |
node -e '
let [ version, suffix ] = require("./package.json").version.split('-');
require("fs").writeFileSync(".npm_tag",suffix?"beta":"latest");
'
This is not implemented.
Thanks. It doesn't look very difficult, I will try to implement this interface
I also found the project sitll has two open issues from 2017-08 , that's also helpful , anyone can deal that ?
So far nobody volunteered for the open issue. The documentation issue could be eventually already solved, I have not checked that.
Finally, I found a way to resolve my problem by use commads
option.
( I feel the solution is not bad )
pipeline:
npm_publish:
when: { event: tag }
image: plugins/npm
secrets: [ npm_token ]
environment:
PLUGIN_USERNAME: npm_user
PLUGIN_EMAIL: npm_user@email.com
commands:
- /bin/drone-npm --tag $(node -pe "/-/.test(require('./package').version)?'beta':'latest'")
We've run into situations where we wish to push pre-release versions of npm packages from drone updating a separate dist-tag (like beta, test or pre-release) rather than latest.