求适配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
相关产品推荐
相关产品推荐

