同步您的android和github版本

在NoOps中进行部署应该感觉直观 (Deployment in NoOps Should Feel Intuitive)

NoOps means automating the entire workflow — all developers have to do is push code. It’s a popular concept in 2020.

NoOps意味着自动化整个工作流程-所有开发人员要做的就是推送代码。 这是2020年的流行概念。

The automated app releasing often causes confusion thanks to a misalignment between the app store and GitHub repository concepts.

由于应用商店和GitHub存储库概念之间的不一致,自动发布的应用通常会造成混乱。

To make sure developers feel confident making changes, the app releasing flow from the app stores should conceptually align with the GitHub releasing flow, as the repository is where the developers push code.

为了确保开发人员有信心进行更改,从应用程序商店发布的应用程序发布流程在概念上应与GitHub发布流程保持一致,因为存储库是开发人员在其中推送代码的地方。

This article focuses on aligning the GitHub releasing flow with Android releasing flow (Google Play Store) with implementation details.

本文着重于将GitHub发布流程与Android发布流程(Google Play商店)的实现细节对齐。

Google Play支持GitHub活动的超集 (Google Play Supports a Superset of GitHub Events)

First, we need to understand the stages in Google Play Store releases:

首先,我们需要了解Google Play商店发行版中的各个阶段:

  1. Internal: Push updates to core team members to collect bugs.

    内部 :将更新推送给核心团队成员以收集错误。

  2. Alpha: Push updates to broader team members to collect bugs.

    Alpha :将更新推送给更广泛的团队成员以收集错误。

  3. Beta: Push updates to external testers to collect feedback.

    Beta :将更新推送给外部测试人员以收集反馈。

  4. Production: Push updates to everyone.

    生产 :向所有人推送更新。

Then, let’s take a look at the stages of a GitHub release:

然后,让我们看一下GitHub发布的各个阶段:

  1. Push: Code going into the main branch.

    推送 :代码进入主分支。

  2. Prerelease: When a version is code-complete.

    预发行 :当一个版本是代码完整的。

  3. Release: When a version is ready for production.

    发布 :当一个版本准备生产时。

Image for post
Demo for Google Play Store and GitHub repository event matching
Google Play商店和GitHub存储库事件匹配的演示

So, beta is conceptually similar to prerelease and production is conceptually similar to release.

因此,β在概念上类似于预发行,而生产在概念上类似于发行。

Although repositories don’t define a line between internal and alpha, internal only allows a small number of testers, so we can combine internal and alpha to correspond to push.

尽管存储库未在内部和alpha之间定义界线,但是内部仅允许少量测试人员使用,因此我们可以将内部和alpha结合起来以对应于推送。

After matching the concepts, let’s implement an automatic releasing workflow, one step at a time.

匹配概念之后,让我们一次实现一个自动发布工作流程。

This article will demonstrate release syncing with GitHub Action (CI/CD platform) and Fastlane (app automation framework), but the idea applies to any CI and app automation framework.

本文将演示与GitHub Action(CI / CD平台)和Fastlane(应用程序自动化框架)同步的版本,但该思想适用于任何CI和应用程序自动化框架。

Note: I borrowed the scripts from Mini Donkey, an encrypted steganography app. To see how it works in a complete mobile app, please check out the repository.

注意:我从Mini Donkey (一个加密的隐写应用程序)借来了脚本。 要查看它在完整的移动应用程序中的工作方式,请查看存储库

步骤0:编写Fastlane脚本与Google Play商店进行交互 (Step 0: Write a Fastlane script to interact with the Google Play Store)

As Fastlane is not the main focus here, Ill simply post a minimal Fastlane script that uploads apps to Google Play Store:

由于Fastlane并不是这里的主要重点,因此我只发布了一个最小的Fastlane脚本即可将应用程序上传到Google Play商店:

步骤1:在推送和释放事件上触发工作流 (Step 1: Have the Workflow Trigger on Push and Release Events)

The following script triggers a release action on every push or release:

以下脚本在每次推送或释放时触发释放操作:

步骤2:捕获Push操作以发布Internal和Alpha应用程序 (Step 2: Capture the Push Action to Publish the Internal and Alpha App)

Here we want to capture push events while ignoring release events:

在这里,我们要捕获推送事件,而忽略发布事件:

步骤3:捕获预发布操作以发布Beta应用程序 (Step 3: Capture the Prerelease Action to Publish the Beta App)

The following script ensures that the triggering event is a prerelease:

以下脚本确保触发事件是预发行版:

步骤4:捕获发布操作以发布生产应用 (Step 4: Capture the Release Action to Publish the Production App)

The following script checks that the triggering event is a release, but not a prerelease:

以下脚本检查触发事件是否是发行版,而不是预发行版:

Note: There are only two types of release events: “prerelease” and “release,” so checking that it’s not a “prerelease” is sufficient.

注意:发行事件只有两种类型:“预发行”和“发行”,因此检查它是否不是“预发行”就足够了。

Hooray! With this setup, developers can check code as if the app releasing doesn’t exist. The app will be precisely where it should be in Google Play Store or the marketplace of your preference.

万岁! 通过此设置,开发人员可以检查代码,就像不存在发布的应用程序一样。 该应用将恰好位于Google Play商店或您喜欢的市场中。

翻译自: https://medium.com/better-programming/sync-your-android-and-github-releases-519c0e9dfa8c

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值