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

  • 相关阅读:
    TweenMax参数补充
    jQuery.lazyload详解
    js函数和jquery函数详解
    数数苹果手机中的不科学
    网页全栈工程师要点分析
    瞄了一眼墙外的世界,只能给差评
    脑洞大开的自然语言验证码
    别再迷信 zepto 了
    产品列表页分类筛选、排序的算法实现(PHP)
    大学回顾和C与PHP之路
  • 原文地址:https://www.cnblogs.com/XmodYgetZ/p/4904417.html
Copyright © 2011-2022 走看看