Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
1
Help us understand the problem. What is going on with this article?
@dnrsm

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

More than 1 year has passed since last update.

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

1
Help us understand the problem. What is going on with this article?
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
dnrsm

Comments

No comments
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account Login
1
Help us understand the problem. What is going on with this article?