You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

求适配Windows虚拟机的GitHub Actions Unity工作流示例

适配Windows虚拟机的Unity GitHub Actions工作流需求

我找到的game.ci相关示例仅支持Ubuntu虚拟机(ubuntu-latest),但需要一份适配Windows虚拟机的同款GitHub Actions工作流文件,用于Unity游戏的构建与测试。

背景

  • 当前我使用的Ubuntu适配工作流脚本如下:
name: Test

on:
  workflow_dispatch: {}

jobs:
  build:
    name: Build my project ✨
    runs-on: ubuntu-latest
    steps:
      # Checkout
      - name: Checkout repository
        uses: actions/checkout@v2
        with:
          lfs: true

      # Cache
      - uses: actions/cache@v2
        with:
          path: MyGame/Library
          key: MyGame/Library-${{ hashFiles('Assets/**', 'Packages/**', 'ProjectSettings/**') }}
          restore-keys: |
            Library-

      # Test
      - name: Run tests
        uses: game-ci/unity-test-runner@v2
        env:
          UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
        with:
          projectPath: MyGame/
          githubToken: ${{ secrets.GITHUB_TOKEN }}

      # Build
      - name: Build project
        uses: game-ci/unity-builder@v2
        env:
          UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
          UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
          UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
        with:
          projectPath: MyGame/
          targetPlatform: Android

      # Output
      - uses: actions/upload-artifact@v2
        with:
          projectPath: MyGame/
          name: Build
          path: build
  • game.ci仅提供了适配GitLab的Windows示例,没有GitHub版本可用。
  • 我找到一个外部项目的Windows适配Unity工作流,但无法直接复用:它除了使用crazy-max的Docker容器外,还需要配置secrets.UNITY_TOTP_KEY密钥,我不清楚该如何填写这个密钥。

内容的提问来源于stack exchange,提问作者mcExchange

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.12 13:40:24