6
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

CircleCIでexpoにpublishする

Posted at

expoでみんなが簡単にアプリの最新状況が見られるように、masterにコードがpushされたときにexpoにpublishします。

expコマンドで publish するだけです。 exp publush にはtokenというオプションもあるようなのですが

$ exp publish --help

  Usage: publish|p [options] [project-dir]

  Publishes your project to exp.host


  Options:

    -q, --quiet           Suppress verbose output from the React Native packager.
    -s, --send-to [dest]  A phone number or e-mail address to send a link to
    --non-interactive     Fails if an interactive prompt would be required to continue.
    -h, --help            output usage information

ちょっと調べてもトークンの生成方法がわからないので環境変数 EXPO_ACCOUNT, EXPO_PASSWORD でユーザ名とパスワードを設定します。

exp://exp.host/@ku0522a/myapp というフォーマットでURLが生成されるのでexpoから読み込んでもらうとだれでも簡単に最新版を確認できるようになります :raised_hands:

circle.yml
machine:
  node:
    version: 8.1.3
  pre:
    - "echo 'Host *' >> $HOME/.ssh/config"
    - "echo 'ForwardAgent yes' >> $HOME/.ssh/config"
    - "git config --global user.name 'Circle CI'"
    - "git config --global user.email 'ku0522a@gmail.com'"
  post:
    - npm install -g npm@3.x.x --progress=false
  environment:
    EXPO_ACCOUNT: 'ku0522a'
general:
  artifacts:
    - "build"
dependencies:
  cache_directories:
    - "node_modules"
  override:
    - npm install exp
    - ./node_modules/.bin/exp login -u "$EXPO_ACCOUNT" -p "$EXPO_PASSWORD"
    - npm install --progress=false:
        timeout: 600
database:
  override:
    - echo "Skipping DB section."
compile:
  override:
    - exit 0
test:
  override:
    - echo 'skipping test section.'
deployment:
  master_merge:
    branch: ['master']
    commands:
      - ./node_modules/.bin/exp publish
6
3
1

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
6
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?