Travis CI的部署与发布
由于国内对一些资源的限制,在无法翻墙的情况下,借助于Travis CI的部署发布功能进行代码的编译,将最终的二进制文件发布后下载使用。
比如编译libwebrtc,生产静态库和一些头文件,供本地开发使用。
The Job Lifecycle #
Each job is a sequence of phases. The main phases are:
install
- install any dependencies requiredscript
- run the build script
Travis CI can run custom commands in the phases:
before_install
- before the install phasebefore_script
- before the script phaseafter_script
- after the script phase.after_success
- when the build succeeds (e.g. building documentation), the result is inTRAVIS_TEST_RESULT
environment variableafter_failure
- when the build fails (e.g. uploading log files), the result is inTRAVIS_TEST_RESULT
environment variable
There are three optional deployment phases.
The complete sequence of phases of a job is the lifecycle. The steps are:
- OPTIONAL Install
apt addons
- OPTIONAL Install
cache components
before_install
install
before_script
script
- OPTIONAL
before_cache
(if and only if caching is effective) after_success
orafter_failure
- OPTIONAL
before_deploy
(if and only if deployment is active) - OPTIONAL
deploy
- OPTIONAL
after_deploy
(if and only if deployment is active) after_script
A build can be composed of many jobs.
Travis CI关键字
关键字 | 描述 |
---|---|
dist | 指定系统版本,dist: bionic(ubuntu18.04) |
添加python
1 | python: |
deploy
1 | deploy: |
https://raw.githubusercontent.com/Winddoing/libwebrtc/mydev/.travis.yml
GITHUB_TOKEN
: setting->Developer settings->Personal access tokens:Generate new token
参考
- Travis CI Tutorial