Up to date

This page is up to date for Godot 4.2. If you still find outdated information, please open an issue.

测试拉取请求

许多人正在GitHub上开发新功能或修复错误。为了帮助引擎开发,你可能会被要求用Godot构建来测试这些拉取请求,该构建包括有关拉取请求中的代码。

感谢GitHub Actions,所有的 拉取请求pull requests 都有持续构建。这些构建可以让你尝试拉取请求,而不需要从源代码编译任何东西。

下载编译后的版本

你可以从GitHub Actions中下载拉取请求构建。由于只有已登录的用户可以直接从GitHub Actions下载构建,因此根据你是否有GitHub账户,程序会有所不同。

备注

由于GitHub Actions的限制,构建只在拉取请求最后更新后的90天内可用。如果你仍然希望在本地尝试拉取请求,你可以 从源代码编译拉取请求 分支来代替。

如果你有 GitHub 账户

  • 打开拉取请求页面。点击页面顶部附近的 检查Checks 标签:

../../_images/testing_pull_requests_access_checks.webp
  • Click the Artifacts dropdown on the right of the page:

../../_images/testing_pull_requests_checks_artifacts.webp
  • In the dropdown, click the artifact's name to download it. Remember to scroll if you cannot see the name of the platform you're looking for:

../../_images/testing_pull_requests_checks_artifacts_list.webp
  • Extract the ZIP archive then run the executable. Note that Windows and macOS binaries are not code signed. This means you may have to bypass a security warning before you can run the executable. On Windows, if you frequently test pull request builds, it may be better to disable Windows SmartScreen permanently in the Windows security settings. On macOS, see 在 macOS 上运行 Godot 应用 for instructions on bypassing Gatekeeper.

如果你没有 GitHub 账户

如果你没有GitHub账户,也无法注册,你可以使用第三方的 nightly.link 服务来生成一个通用的下载链接。

  • 打开拉取请求页面。点击页面顶部附近的 fork 分支名称:

../../_images/testing_pull_requests_access_fork.png
  • 现在你在 fork 的分支页面上,点击文件列表顶部的 .github 文件夹。然后,点击 workflows 文件夹(位于 .github 文件夹内)。点击你想下载工件的平台的工作流程文件。在点击文件(打开文件视图)之后,从浏览器的地址栏复制页面 URL。

  • Open the nightly.link website and paste the URL you just copied into the text field located below the heading Paste a GitHub link, get a nightly.link!. After pasting the URL, click Get links on the right. If the format of the URL you pasted is correct, you should be presented with a page like this:

../../_images/testing_pull_requests_nightly_link.png
  • 点击你想下载的工件的URL。

  • 提取ZIP档案,然后运行可执行文件。注意,Windows和macOS的二进制文件是没有代码签名的。这意味着你可能必须在运行可执行文件之前绕过安全警告。如果你经常测试拉取请求的构建,可能最好永久地禁用Windows SmartScreen或 禁用macOS Gatekeeper

从源编译拉取请求分支

对于最后一次更新超过90天的拉取请求,或者在Godot的GitHub Actions设置不支持的平台和配置上进行测试,可能需要采用这种方法。

  • 打开拉取请求页面。点击页面顶部附近的 fork 分支名称:

../../_images/testing_pull_requests_access_fork.png
  • 现在你在fork的分支页面上,点击页面右侧的绿色 Code 按钮,然后在下拉菜单中选择 下载ZIP :

../../_images/testing_pull_requests_fork_zip.png
  • 提取 ZIP 压缩包,按照你的操作系统的编译说明操作。