LoginSignup
2
1

More than 5 years have passed since last update.

Travis CIを利用したnpmライブラリの継続的運用

Posted at

Travis ログイン

$ travis login 

GitHubアカウントでログイン

npmログイン

$ npm login

npmjs.comのアカウントでログイン

.travis.yml

.travis.yml
language: node_js
node_js:
- 9.3.0
script:
- npm run build
deploy:
  provider: npm
  email: test@gmail.com
  on:
    tags: true
  api_key:
    secure: [暗号化された認証トークン]

Building a JavaScript and Node.js project

タグのコミットの場合のみデプロイが発火

  on:
    tags: true

トークンの暗号化

$ travis encrypt YOUR_API_KEY --add deploy.api_key
$ npm version patch
$ git push origin v1.0.1

package.jsonversionがインクリメントされ同時にコミットもされる。
pushすればデプロイ完了となる。

はまったところ

packaege.json

packaege.jsonnameに大文字が含まれているとpublishされない。
npm publish failed put 400; is invalid for new packages #15787

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1