zoukankan      html  css  js  c++  java
  • 用travis-ci编译android版nodejs

    第一步:

    fork

    第二步:

    添加.travis.yml

    在repository根目录添加.travis.yml文件,在其中添加以下内容.

    language: c
    before_install:
      - wget http://dl.google.com/android/ndk/android-ndk-r10e-linux-x86_64.bin
      - sudo chmod a+x android-ndk-r10e-linux-x86_64.bin
      - ./android-ndk-r10e-linux-x86_64.bin > /dev/null
      - ./android-configure ./android-ndk-r10e
    script:
      - make
      - rm node
      - cp -a out/Release/node node
      - tar czvf android.gz node
    deploy:
      provider: releases
      api_key: $CI_USER_TOKEN
      file: android.gz
      skip_cleanup: true
      on:
        tags: true
    在before_install配置好ndk生成makefile
    在script段编译,并打包目标文件.
    deploy那一段用于上传文件到github
    releases

    第三步:

    添加token

    进入https://github.com/settings/tokens

    点击Generate new token,选中repo生成字串(token)并复制.

    第四步:

    设置travis-ci

    没有注册的先打开https://travis-ci.org注册

    打开https://travis-ci.org/profile/用户名,开启node的repository.

    打开https://travis-ci.org/用户名/node/settings

    点最下面的add添加环境变量CI_USER_TOKEN(之前的配置文件中设定的),值即前一步生成的token

    第五步:

    发布

    进入https://github.com/用户名/node/releases 单击Draft a new release 发布新的Tag

    第六步:

    睡一觉

    起来后就可以在https://github.com/用户名/node/releases 看见编译好的文件.

    主要的陷阱:

    1.必须压缩文件,否则上传时会出现503错误.

    2.添加环境变量时Display value in build log 要设为off.

    例子:

    https://github.com/hjiayz/node/releases

  • 相关阅读:
    记录爱忘记的STL知识点
    小狼
    CVTE总结
    STL底层实现
    小狼,你家BOSS喊你面试啦!!!(四)
    npm属性笔记
    iview中关于table组件内放入Input会失去焦点
    js实现数组内数据的上移和下移
    google搜索使用技巧
    bat中实现代码拷贝到指定目录后启动命令行并更改默认路径
  • 原文地址:https://www.cnblogs.com/XmodYgetZ/p/4904417.html
Copyright © 2011-2022 走看看