我可以使用多种语言和多种操作系统来travis-ci吗?

时间:2019-04-01 10:52:47

标签: android ios react-native travis-ci

我的travis工作是部署本机的。因此,我想在没有expo的情况下同时构建以及android和ios(expo是一项很好的服务。但是,我想为本地库提供一些本地代码)

完全逻辑

  • 语言:node_js

    • npm ci用于本机库
  • 语言:红宝石

    • gem install fastlane
  • 语言:android,操作系统:linux

    • 我不知道为什么osx映像不能使用oraclejdk8(请参阅底部)
  • 语言:object-c os:osx

    • 我无法尝试...我修改了一些代码...

有人帮我吗?

os: osx
osx_image: xcode10.1

matrix:
  include:
    - language: node_js
      node_js:
        - node
        - lts/*
      cache: npm
    - language: ruby
      rvm:
        - 2.6
      cache: bundler

before_script:
  - npm install -g npm@latest
  - gem update --system
  - gem install fastlane -NV
  - fastlane update_fastlane
  - npm ci

jobs:
  include:
    - stage: Deploy Android Test
      if: branch = rework-travis and type = push
      language: android
      jdk: openjdk8
      before_cache:
        - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
        - rm -rf $HOME/.gradle/caches/*/plugin-resolution/
      cache:
        directories:
          - $HOME/.gradle/caches/
          - $HOME/.gradle/wrapper/
      android:
        components:
          - tools
          - platform-tools
          - android-28

          - extra-google-google_play_services
      before_script:
        - chmod +x ./android/gradlew
      script:
        - ./android/gradlew assembleRelease
$ ~/bin/install-jdk.sh --target "/Users/travis/openjdk8" --workspace "/Users/travis/.cache/install-jdk" --feature "8" --license "GPL"
install-jdk.sh 2019-03-22
Expected feature release number in range of 9 to 13, but got: 8
The command "~/bin/install-jdk.sh --target "/Users/travis/openjdk8" --workspace "/Users/travis/.cache/install-jdk" --feature "8" --license "GPL"" failed and exited with 3 during .

1 个答案:

答案 0 :(得分:0)

首先,我将使用两种不同的环境进行构建-Android应用程序的Trusty CI和iOS应用程序的macOS CI。在您的配置中,您仅定义了一个环境。

您可以阅读如何设置两个环境here

有了Trusty CI,您可以使用openjdk8,因为它是默认的并且是预装的。