高级发布渠道


本文档于 2022 年 8 月存档,不会收到任何进一步更新。要了解有关为何弃用发布通道的更多信息,请参阅我们关于 EAS 更新的博客文章。相反,我们建议使用 EAS 更新

¥This doc was archived in August 2022 and will not receive any further updates. To learn more about why release channels were deprecated, see our blog post on EAS Update. Instead, we recommend using EAS Update.

介绍

¥Introduction

有关发布渠道的快速介绍,阅读此内容

¥For a quick introduction to release channels, read this.

当你通过运行 expo publish --release-channel staging 发布应用时,它会创建:

¥When you publish your app by running expo publish --release-channel staging, it creates:

  • 一个版本,由 Android 和 iOS 平台的 publicationId 标识。发布是指发布时打包的源代码和资源。

    ¥a release, identified by a publicationId for Android and iOS platforms. A release refers to your bundled source code and assets at the time of publication.

  • 指向 staging 发布通道中的发布的链接,由 channelId 标识。这就像 git 分支上的提交。

    ¥a link to the release in the staging release channel, identified by a channelId. This is like a commit on a git branch.

为简单起见,本文的其余部分将仅涉及 ios 版本,但你可以随时将 ios 替换为 android,一切仍然正确。

¥For simplicity, the rest of this article will refer to just the ios releases, but you could swap out ios for android at any point and everything would still be true.

查看过去发布的内容

¥See past publishes

你可以查看使用 expo publish:history 发布的所有内容。

¥You can see everything that you've published with expo publish:history.

命令和输出示例

¥Example command and output

expo publish:history --platform ios

publishedTimeappVersionsdkVersionplatformchannelpublicationId
2018-01-05T23:55:04.603Z1.0.024.0.0iosstaging80b1ffd7-4e05-4851-95f9-697e122033c3

要查看有关此特定版本的更多详细信息,你可以运行 expo publish:details

¥To see more details about this particular release, you can run expo publish:details

命令和输出示例

¥Example command and output

expo publish:details --publish-id 80b1ffd7-4e05-4851-95f9-697e122033c3

Publish Details

我的用户将获得什么版本的应用?

¥What version of the app will my users get?

你的用户将获得推送到发布渠道的最新兼容版本。影响兼容性的因素:

¥Your users will get the most recent compatible release that was pushed to a release channel. Factors that affect compatibility:

  • sdkVersion(独立应用仅支持单个 SDK 版本)

    ¥sdkVersion (standalone apps are built to support only a single SDK version)

  • platform

  • releaseChannel

以下流程图显示了我们如何确定将哪个版本返回给用户:

¥The following flowchart shows how we determine which release to return to a user:

Serving Flowchart

将版本提升到新的版本渠道

¥Promoting a release to a new release channel

示例用例:你之前发布了 staging 的版本,并且测试中一切顺利。现在你希望此版本在另一个版本渠道(即生产)中处于活动状态

¥Example use case: you previously published a release to staging and everything went well in your testing. Now you want this release to be active in another release channel (ie) production

我们运行 expo publish:set 将我们的版本推送到 production 发布通道。expo publish:set --publish-id 80b1ffd7-4e05-4851-95f9-697e122033c3 --release-channel production

¥We run expo publish:set to push our release to the production release channel. expo publish:set --publish-id 80b1ffd7-4e05-4851-95f9-697e122033c3 --release-channel production

继续上一节,我们可以看到我们的版本在 stagingproduction 版本渠道中均可用。

¥Continuing from the previous section, we can see that our release is available in both the staging and the production release channels.

expo publish:history --platform ios

publishedTimeappVersionsdkVersionplatformchannelpublicationId
2018-01-05T23:55:04.603Z1.0.036.0.0iosstaging80b1ffd7-4e05-4851-95f9-697e122033c3
2018-01-05T23:55:04.603Z1.0.036.0.0iosproduction80b1ffd7-4e05-4851-95f9-697e122033c3
2018-01-04T22:43:19.302Z1.0.036.0.0iosproductiond6b61741-a8dc-11e9-852a-3b0715b88238

回滚发布通道条目

¥Rollback a release channel entry

示例用例:你向 production 发布通道发布了一个版本,却发现它对你的某些用户来说包含重大回归,因此你想要恢复到以前的版本。

¥Example use case: you published a release to your production release channel, only to realize that it includes a major regression for some of your users, so you want to revert to the previous version.

继续上一节,我们将 production 发布渠道条目回滚到仅用于 iOS 平台的 expo publish:set

¥Continuing from the previous section, we roll back our production release channel entry for just the iOS platform with expo publish:set

expo publish:set --release-channel production --publish-id d6b61741-a8dc-11e9-852a-3b0715b88238

或者,我们可以使用以下命令回滚 Android 和 iOS 的 production 发布渠道条目:expo publish:rollback --release-channel production --sdk-version 36.0.0

¥Or, we could roll back the production release channel entry for both Android and iOS with: expo publish:rollback --release-channel production --sdk-version 36.0.0

现在我们可以看到我们的版本已在生产版本渠道上可用。

¥Now we can see that our releases are available on the production release channel.

expo publish:history --platform ios

publishedTimeappVersionsdkVersionplatformchannelpublicationId
2018-01-04T22:43:19.302Z1.0.036.0.0iosproductiond6b61741-a8dc-11e9-852a-3b0715b88238

发布渠道 CLI 工具

¥Release channels CLI tools

发布历史

¥Publish history

  Usage: expo publish:history [--release-channel <channel-name>] [--count <number-of-logs>]

  View a log of your published releases.

  Options:
    -c, --release-channel <channel-name>  Filter by release channel. If this flag is not included, the most recent publications will be shown.
    -count, --count <number-of-logs>      Number of logs to view, maximum 100, default 5.
    -r, --raw                             Produce some raw output.
    -p, --platform <ios|android>          Filter by platform, android or ios.

发布详情

¥Publish details

  Usage: expo publish:details --publish-id <publish-id>
  View the details of a published release.

  Options:
    --publish-id <publish-id>  Publication id. (Required)
    -r, --raw                             Produce some raw output.

发布回滚

¥Publish rollback

Usage: expo publish:rollback

  Rollback an update to a release channel. Equivalent to running `expo publish:set` with publish-id set to the most recent release to the specified sdk version

  Options:
    -c, --release-channel <channel-name>  The name of the release channel to roll back (Required)
    -s, --sdk-version <version>           The SDK version to roll back (e.g. 37.0.0) (Required)
    -p, --platform <ios|android>          The platform to roll back (roll back both unless specified)

发布集

¥Publish set

 Usage: expo publish:set --release-channel <channel-name> --publish-id <publish-id>

  Set a published release to be served from a specified channel.

  Options:
    -c, --release-channel <channel-name>  The channel to set the published release. (Required)
    -p, --publish-id <publish-id>         The id of the published release to serve from the channel. (Required)
Expo 中文网 - 粤ICP备13048890号