介绍

org开源

com私有

步骤

创建GH_TOKEN

  1. 打开 https://github.com/settings/tokens
  2. 点击 Personal access tokens
  3. 点击 Generate new token
  4. 勾选repo选项框,并输入名字,点击Generate token
  5. 生成的token只会显示一次,复制保存以备用

关联github账号

  1. 打开 https://travis-ci.org
  2. 使用github登录

    关联github repo

  3. 打开 https://travis-ci.org/account/repositories
  4. 选中要执行ci的repo

配置GH_TOKEN

  1. 打开 https://travis-ci.org/wuyue92tree/beyondWeb/settings
  2. 配置GH_TOKEN及其他选项

生成travis api_key

  1. 安装travis客户端
  2. 认证及生成api_key
    travis login
    travis setup releases -r wuyue92tree/beyondWeb --org -f

.travis.yml示例

# .travis.yml
osx_image: xcode8.3
sudo: required
dist: trusty
language: c
matrix:
  include:
  - os: osx
  - os: linux
    env: CC=clang CXX=clang++ npm_config_clang=1
    compiler: clang
cache:
  directories:
  - node_modules
  - "$HOME/.electron"
  - "$HOME/.cache"
addons:
  apt:
    packages:
    - libgnome-keyring-dev
    - icnsutils
before_install:
- mkdir -p /tmp/git-lfs && curl -L https://github.com/github/git-lfs/releases/download/v1.2.1/git-lfs-$([
  "$TRAVIS_OS_NAME" == "linux" ] && echo "linux" || echo "darwin")-amd64-1.2.1.tar.gz
  | tar -xz -C /tmp/git-lfs --strip-components 1 && /tmp/git-lfs/git-lfs pull
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install --no-install-recommends -y icnsutils graphicsmagick xz-utils; fi
install:
- nvm install 10
- curl -o- -L https://yarnpkg.com/install.sh | bash
- source ~/.bashrc
- npm install -g xvfb-maybe
- yarn
script:
- yarn run build

deploy:
  provider: releases
  skip_cleanup: true
  api_key:
    secure: NHyEKpcM4J7AF/6JvAN7pdF16LrLM4rYlRS5bt+BQ2h1xE8rDzIhASy1DKt2ByYvvgXOd1OBJVHN69SQm2fDt8XD7Hi21w8G+es2COO6nCdW96EinhkoLEHzrnSkaD0enlRsbwNau3p6BNRvciqQG/xRraeDn0hMF/9DcffrATSY0nxlqGdgOXheaedtXw2MMtgQbIBffyfJ50cNhpAVm6c8fB6fEJF1tAbhVjtG1oPqGTkzuoZfjnAHq5qTj2A5BYchsI0pZrcPSuncfewCnbGGRpXLd5Ojkn4ys+XtMuEVW/enlpy5CBw6VlkWoA5a1lMF8G/P+h2g99Pzy9gNtADJNOF3pr/gebJdBSrnbFcZ6egWW5VT9CR7XA2/68bGCJwKNWdf2YdItxt6KNzFWKOmZG5fCxBbEXnAyccKZwU/BZVKUZwFIc8F03uAAkrrDg4BbyqujDhCRDm2IkcxZhmKUtu2SMlBCVOO78jHxvipVMdYt19VyCNWFlgFYqST4XBRJCdbCPJEWhyPK88kv3T9SeG7woKycjBM8dqAfPKlsARjTnITWC3+t1QdxwT525bYHLZbnlxSIh+AtQ5JoAgGVRoF+vYxHyoSr5fWo+ikrpaL+dawjk4IwpcAaHW7f+ceIWtFk1dObcfPDR/OAJqYgNyY+SP5U+Jh9bMpTGs=
  on:
    repo: wuyue92tree/beyondWeb
    tag: true
    all_branches: true
branches:
  except:
  - develop
  - master

发表评论

电子邮件地址不会被公开。 必填项已用*标注