owwlo
V2EX  ›  Android

github 上 android 项目,有 CI 工具可以自动编译 apk 并上传到 release 里面么

  •  
  •   owwlo · Apr 21, 2021 · 14140 views
    This topic created in 1875 days ago, the information mentioned may be changed or developed.

    自己的一个小安卓项目,想在 github 上集成 ci 并在 commit 时自动编译并发布 apk 。有什么可靠的方法么?

    在 github marketplace 上搜到了一些,但是不知道哪个坑比较少。有人做过类似的么?

    Supplement 1  ·  Apr 21, 2021
    不好意思写的时候没有写清楚,其实想问有没有什么现成开源 /别人做过的 CI 配置脚本 T T
    11 replies    2021-05-25 10:49:44 +08:00
    duduaba
        1
    duduaba  
       Apr 21, 2021   ❤️ 1
    Travis 、Appveyor
    ch2
        2
    ch2  
       Apr 21, 2021   ❤️ 1
    github action 就能搞定,你自己写个 docker 然后指定 action 使用你的 docker 编译 apk
    rb6221
        3
    rb6221  
       Apr 21, 2021 via iPhone   ❤️ 1
    好像自带 action 就可以吧
    AoEiuV020
        4
    AoEiuV020  
       Apr 21, 2021   ❤️ 1
    actions 做过,这个是 flutter, 不过道理一样,
    https://github.com/AoEiuV020/FlutterDemo/blob/master/.github/workflows/main.yml
    owwlo
        5
    owwlo  
    OP
       Apr 21, 2021
    @ch2 @coderfuns @janus77 , 不好意思写的时候没有写清楚,其实想问有没有什么现成开源 /别人做过的 CI 配置脚本 T T
    mikuazusa
        6
    mikuazusa  
       Apr 21, 2021   ❤️ 1
    Jenkins 啥都可以啊
    owwlo
        7
    owwlo  
    OP
       Apr 21, 2021
    @AoEiuV020 谢谢!
    Mitt
        8
    Mitt  
       Apr 21, 2021   ❤️ 1
    2bab
        9
    2bab  
       Apr 21, 2021 via iPhone   ❤️ 1
    搜了下这个好像不错,Action 版本的
    https://github.com/softprops/action-gh-release

    很早的时候我试用过另外一个 Action 版本的 release 脚本,测试了三次没成功,这个 CI 环境调试起来也很麻烦。。就转 Gradle 实现了:

    https://github.com/2BAB/Seal/blob/master/seal/buildSrc/src/main/kotlin/github-release.gradle.kts

    基于 com.github.breadmoirai:github-release:2.2.12 包成了自己方便用的脚本。
    siweipancc
        10
    siweipancc  
       Apr 22, 2021 via iPhone
    私人 action 小心账单,其他没啥子
    owwlo
        11
    owwlo  
    OP
       May 25, 2021
    昨天参照上面大家给的例子外加自己的需求,写了一个简单的 GitHub Actions Workflow,分享在这,希望可以帮到有类似需求的人。

    https://github.com/owwlo/android-github-actions-build-release-demo

    [特性]
    - 根据内嵌在 commit 信息里的 hashtag 来控制是否启动 CI 并编译发布 APK
    - 整个 Workflow 只有 Yaml 和 Python 两种语言构成,足够的简单
    - 根据历史 commit 信息自动生成 Changelog

    另外感谢这个帖子里所有的人,你们的信息对我制作上面这个 workflow 帮助很大。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1340 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 55ms · UTC 17:16 · PVG 01:16 · LAX 10:16 · JFK 13:16
    ♥ Do have faith in what you're doing.