Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cumulative updates includes the iOS build support #8

Merged
merged 7 commits into from
Oct 10, 2024
Merged

Conversation

kurone-kito
Copy link
Owner

@kurone-kito kurone-kito commented Oct 10, 2024

Features

  • 9911d17: added the iOS build support
  • c8ad849: updated the dependencies
  • 8c3e1df: increased the specified .NET version

CI/CD

  • f537108: added the CI scripts for testing
  • 14beb7b: improved the deployment script
  • 0cc89e2: fixed the brackets position

Documentation

Summary by CodeRabbit

Release Notes

  • New Features

    • Introduced a new CI workflow for automating Unity package deployment on code pushes.
    • Enhanced release process with checks for package name and improved environment variable handling.
  • Improvements

    • Updated settings for iPhone build target, including icons and batching configurations.
    • Enhanced README with details on project template improvements and new tools integrated.
  • Dependency Updates

    • Upgraded versions of key dependencies in the project manifest.
  • Bug Fixes

    • Corrected syntax issues in project configuration files.

@kurone-kito kurone-kito added bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request labels Oct 10, 2024
@kurone-kito kurone-kito self-assigned this Oct 10, 2024
Copy link

coderabbitai bot commented Oct 10, 2024

Walkthrough

The pull request introduces modifications across several workflow files in the GitHub Actions setup, enhancing CI processes for Unity packages and release management. A new workflow for handling pushes to non-main branches is added, alongside updates to existing workflows for release processes and deployment configurations. Additionally, various configuration files, including global.json and .tool-versions, have been updated to reflect newer SDK versions. Changes in asset files and project settings enhance support for iPhone builds, while the README.md has been updated to document these enhancements.

Changes

File Change Summary
.github/workflows/build-listing.yml Added a step to deploy global.json after checking out the automation repository.
.github/workflows/push.yml Introduced a new workflow for CI on pushes to branches other than main, including multiple steps for Unity packaging.
.github/workflows/release.yml Updated the config job to check PACKAGE_NAME, corrected syntax in zipFile, and ensured job dependencies.
.tool-versions Updated .NET SDK version from 6.0.423 to 6.0.427.
Assets/XR/XRGeneralSettings.asset Added new MonoBehaviour entries for iPhone settings and updated existing entries.
Packages/vpm-manifest.json Updated dependency versions for com.vrchat.worlds and com.vrchat.base to 3.7.1.
ProjectSettings/ProjectSettings.asset Added iPhone build target with associated settings and optimizations.
README.md Added a section detailing enhancements from the original template.
global.json Updated SDK version from 6.0.423 to 6.0.427.

Possibly related PRs

  • Improved the template #6: The changes in .github/workflows/build-listing.yml in this PR involve adjusting the workflow for releases, which is directly related to the modifications made in the main PR that also updates the deployment of the global.json file in the same workflow file.

🐰 In the garden where we play,
New workflows bloom, bright as day.
With Unity packages zipped up tight,
Our builds now soar to greater height!
From iPhone settings to README cheer,
We hop along, spreading good cheer! 🌼


🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🧹 Outside diff range and nitpick comments (3)
README.md (2)

5-13: Enhance the new section with an introduction and more specific details.

The new section "Difference from original template" provides valuable information about the enhancements made to the project. To improve it further:

  1. Consider adding a brief introductory sentence to provide context for the list of differences.
  2. The last bullet point "and more..." is vague. Consider either removing it or replacing it with specific improvements that haven't been mentioned.

Here's a suggested revision:

 ## 💭 Difference from original template

+This template builds upon the original VPM project template, incorporating several enhancements to improve development workflow and code quality:
+
 - Added some linters e.g. CSpell, EditorConfig, Markdownlint
 - Added some actions e.g. CodeQL, CodeRabbit.AI, Dependabot
 - Auto invoke the VPM registry update when the package is updated
 - Improved a deployment process with GPG signing
 - Improved a GitHub Actions for testing and building
 - Improved the git attributes and ignore files
-and more...
+- Enhanced support for iOS builds

This revision provides more context and replaces the vague "and more..." with a specific improvement mentioned in the PR objectives.


Line range hint 15-54: Consider updating the "Setting up the Automation" section

Given the new features and improvements mentioned in the "Difference from original template" section, it might be beneficial to update the "Setting up the Automation" section. This would ensure that users have the most up-to-date information on how to leverage the new automation features, such as the automatic VPM registry update and improved GitHub Actions for testing and building.

Consider adding information about:

  1. How to set up and use the new linters (CSpell, EditorConfig, Markdownlint).
  2. How to leverage the new actions (CodeQL, CodeRabbit.AI, Dependabot).
  3. Any steps required to enable the automatic VPM registry update.
  4. How to use the improved GitHub Actions for testing and building.

This will provide a more comprehensive guide for users to take full advantage of the template's new features.

.github/workflows/release.yml (1)

Line range hint 1-105: Suggestions for workflow enhancements

While the workflow is well-structured and functional, consider the following improvements:

  1. Use variables for file extensions (e.g., ZIP_EXT=".zip") to make the workflow more maintainable and flexible.
  2. Optimize the GPG signing process by creating a reusable step or job for signing multiple files.
  3. Enhance error handling and logging throughout the workflow to make troubleshooting easier.
  4. Consider adding a step to validate the created artifacts before release.

These enhancements could improve the workflow's maintainability, efficiency, and reliability.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 0562fd0 and 6861269.

📒 Files selected for processing (9)
  • .github/workflows/build-listing.yml (1 hunks)
  • .github/workflows/push.yml (1 hunks)
  • .github/workflows/release.yml (1 hunks)
  • .tool-versions (1 hunks)
  • Assets/XR/XRGeneralSettings.asset (2 hunks)
  • Packages/vpm-manifest.json (1 hunks)
  • ProjectSettings/ProjectSettings.asset (4 hunks)
  • README.md (1 hunks)
  • global.json (1 hunks)
✅ Files skipped from review due to trivial changes (2)
  • .tool-versions
  • global.json
🧰 Additional context used
🪛 actionlint
.github/workflows/push.yml

22-22: shellcheck reported issue in this script: SC2086:info:1:70: Double quote to prevent globbing and word splitting

(shellcheck)


22-22: shellcheck reported issue in this script: SC2086:info:2:56: Double quote to prevent globbing and word splitting

(shellcheck)


51-51: shellcheck reported issue in this script: SC2086:info:1:100: Double quote to prevent globbing and word splitting

(shellcheck)

🔇 Additional comments (17)
Packages/vpm-manifest.json (4)

29-29: Update of com.vrchat.base version in its own entry

The version of com.vrchat.base has been updated to 3.7.1 in its own entry in the locked section, maintaining consistency with its reference in com.vrchat.worlds.


23-23: Version updates in locked section for VRChat packages

The versions of com.vrchat.worlds and its dependency com.vrchat.base have been updated to 3.7.1 in the locked section. This ensures consistency with the main dependencies section.

Let's verify if all VRChat-related packages are using the same version:

#!/bin/bash
# Description: Verify consistency of VRChat package versions

# Test: Extract and compare versions of VRChat packages
jq -r '.locked | to_entries[] | select(.key | startswith("com.vrchat")) | "\(.key): \(.value.version)"' Packages/vpm-manifest.json

Also applies to: 25-25


18-21: Addition of dev.onevr.vrworldtoolkit to locked section

The dev.onevr.vrworldtoolkit dependency (version 3.2.0) has been added to the locked section. This ensures that this specific version is used consistently across different environments.

Let's verify if this package is compatible with the current VRChat SDK version:


9-10: Dependency version update for com.vrchat.worlds

The version of com.vrchat.worlds has been updated from 3.7.0 to 3.7.1. This is a minor version update, which typically includes bug fixes and small improvements.

To ensure compatibility, let's check for any breaking changes or important notes in the release documentation:

.github/workflows/push.yml (4)

1-8: LGTM: Workflow trigger and permissions are well-configured.

The workflow trigger is correctly set to run on all branches except 'main', which is suitable for a CI workflow. The read-only permissions for contents follow the principle of least privilege, enhancing security.


19-20: LGTM: Repository checkout step is up-to-date.

The use of actions/checkout@v4 ensures you're using the latest version of the checkout action.


35-40: Consider implications of not cleaning the checkout directory.

While checking out the automation repository without cleaning (clean: false) allows for faster checkouts, it may lead to potential conflicts if there are leftover files from previous runs.

Ensure this approach doesn't cause issues in your specific use case. If you're certain that no conflicts will arise, you can ignore this comment.


43-49: LGTM: Caching configuration is well-structured.

The caching step is using the latest version of the actions/cache action and has a well-structured key based on the OS and relevant file hashes. This should provide effective caching for improved workflow performance.

.github/workflows/build-listing.yml (1)

50-51: Approve the new step with suggestions for improvement

The addition of the step to deploy the global.json file is a good improvement. However, consider the following suggestions:

  1. Add a comment explaining the purpose of this step for better maintainability.
  2. Implement error handling and verification to ensure the file exists and is copied successfully.

Here's a suggested improvement:

      - name: Deploy the global.json file
-       run: cp ${{ github.workspace }}/global.json ${{ env.pathToCi }}/
+       run: |
+         # Ensure global.json is available for subsequent steps
+         if [ -f "${{ github.workspace }}/global.json" ]; then
+           cp "${{ github.workspace }}/global.json" "${{ env.pathToCi }}/"
+           echo "global.json deployed successfully"
+         else
+           echo "Error: global.json not found in the workspace"
+           exit 1
+         fi

Let's verify the impact of this change on subsequent steps:

✅ Verification successful

Verification Successful

The use of global.json in the cache key (hashFiles('**/global.json', '**/*.csproj')) confirms that deploying the global.json file impacts the caching mechanism as intended. The review comment is accurate, and the suggested improvements are appropriate.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check if global.json is used in subsequent steps

# Test: Search for global.json usage in the workflow file
rg --type yaml 'global\.json' .github/workflows/build-listing.yml

Length of output: 264

Assets/XR/XRGeneralSettings.asset (3)

45-45: LGTM! iPhone Settings updated correctly.

The iPhone Settings are now properly linked to the new iPhone Providers, ensuring the correct XR configuration for iOS.

To ensure consistency, let's verify that other platform settings are similarly configured:

#!/bin/bash
# Check if all platform settings reference their respective providers
rg --type yaml "m_LoaderManagerInstance: \{fileID: [^\}]+\}"

Line range hint 1-108: LGTM! XRGeneralSettings structure is complete and consistent.

The XRGeneralSettings asset now includes proper configuration for Standalone, Android, and iPhone platforms. The structure is consistent, and the new iPhone settings integrate well with the existing setup.

To ensure all necessary platforms are covered, let's verify the supported platforms in the project settings:

#!/bin/bash
# Check the list of supported platforms in ProjectSettings
rg --type yaml "BuildTargetPlatform:" ProjectSettings/ProjectSettings.asset

17-32: LGTM! New iPhone Providers added.

The addition of iPhone Providers is a good step towards iOS support for XR in the project. The settings for automatic loading and running are safely set to false by default.

Consider if specific XR loaders for iOS need to be added to the empty Loaders array. You may want to verify if any iOS-specific XR SDKs or plugins are required for your project.

.github/workflows/release.yml (1)

63-63: Correct file extension separator added

The addition of the period before the file extension in the zipFile variable assignment is correct and important. This change ensures that the zip file will have the proper .zip extension, aligning with standard file naming conventions and the naming pattern used for other files in this workflow. This correction prevents potential issues in subsequent steps that rely on the ${{ env.zipFile }} variable, particularly during the file creation and release processes.

ProjectSettings/ProjectSettings.asset (4)

380-475: Ensure all required iOS icon sizes are included

The added icon configurations for the iPhone build target include various sizes for both iPhone and iPad devices. Please verify that all mandatory icon sizes required by Apple's App Store guidelines are included, and that the specified dimensions are correct.


510-510: Review enabling Graphics Jobs on iOS

Enabling Graphics Jobs (m_GraphicsJobs: 1) for the iOS build target can improve performance but may lead to instability on certain devices. Ensure thorough testing is performed across all target iOS devices to confirm compatibility and stability.


839-839: Confirm scripting define symbols for iOS

The scripting define symbols for iPhone are set to UDONSHARP;UDON;VRC_SDK_VRCSDK3. Please verify that these symbols are appropriate for the iOS platform and that they do not introduce dependencies or code that is incompatible with iOS builds.


874-874: Validate API compatibility level for iOS

The apiCompatibilityLevelPerPlatform for iPhone is set to 3, which corresponds to .NET Standard 2.0. Confirm that all code and third-party libraries used in the project are compatible with this API level to prevent potential runtime issues.

Comment on lines +10 to +17
build:
runs-on: ubuntu-latest
env:
listPublishDirectory: Website
packagePath: Packages/${{ vars.PACKAGE_NAME }}
pathToCi: ci
unityPackage:
zipFile:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Consider using a single step for environment variable setup.

While the current setup is functional, it would be more maintainable to declare all environment variables in a single step. This approach would centralize configuration and make it easier to manage variables.

Consider refactoring the environment variable setup as follows:

    env:
      listPublishDirectory: Website
      packagePath: Packages/${{ vars.PACKAGE_NAME }}
      pathToCi: ci
      unityPackage: ${{ vars.PACKAGE_NAME }}-feature.unitypackage
      zipFile: ${{ vars.PACKAGE_NAME }}-feature.zip

This change eliminates the need for the separate step to configure environment variables (current lines 21-24).

Comment on lines +25 to +27
- name: Zip the Package for testing
working-directory: "${{ env.packagePath }}"
run: zip -r "${{ github.workspace }}/${{ env.zipFile }}" .
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Improve zip command with consistent environment variable usage.

The zip command could be improved by using environment variables more consistently.

Consider updating the zip command as follows:

      - name: Zip the Package for testing
        run: zip -r "${{ github.workspace }}/${{ env.zipFile }}" .
        working-directory: ${{ env.packagePath }}

This change ensures consistent use of environment variables and improves readability.

Comment on lines +28 to +29
- name: Build a list of .meta files for future use
run: find "${{ env.packagePath }}/" -name \*.meta >> metaList
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Enhance robustness of .meta file list creation.

The current method of creating the .meta file list could be made more robust.

Consider updating the step as follows:

      - name: Build a list of .meta files for future use
        run: find "${{ env.packagePath }}" -name '*.meta' -type f > metaList

This change ensures only files (not directories) are included and uses single quotes to prevent potential issues with shell expansion.

Comment on lines +41 to +42
- name: Deploy the global.json file
run: cp ${{ github.workspace }}/global.json ${{ env.pathToCi }}/
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Use environment variables consistently in global.json deployment.

The global.json deployment step uses a hardcoded path, which is inconsistent with the use of environment variables elsewhere in the workflow.

Consider updating the step as follows:

      - name: Deploy the global.json file
        run: cp "${{ github.workspace }}/global.json" "${{ env.pathToCi }}/"

This change ensures consistent use of environment variables and improves maintainability.

Comment on lines +50 to +53
- name: Build Package Version Listing with Nuke
run: ${{ env.pathToCi }}/build.cmd BuildRepoListing --root ${{ env.pathToCi }} --list-publish-directory $GITHUB_WORKSPACE/${{ env.listPublishDirectory }} --current-package-name ${{ vars.PACKAGE_NAME }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Address potential shell quoting issues in the build command.

The build command may have shell quoting issues that could lead to unexpected behavior.

Consider updating the build step as follows to ensure proper quoting:

      - name: Build Package Version Listing with Nuke
        run: '${{ env.pathToCi }}/build.cmd BuildRepoListing --root "${{ env.pathToCi }}" --list-publish-directory "$GITHUB_WORKSPACE/${{ env.listPublishDirectory }}" --current-package-name "${{ vars.PACKAGE_NAME }}"'
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

This change ensures that all arguments are properly quoted, preventing potential issues with spaces or special characters in paths or names.

🧰 Tools
🪛 actionlint

51-51: shellcheck reported issue in this script: SC2086:info:1:100: Double quote to prevent globbing and word splitting

(shellcheck)

@kurone-kito kurone-kito merged commit d6ba61f into main Oct 10, 2024
1 check passed
@kurone-kito kurone-kito deleted the ios-support branch October 10, 2024 20:26
@coderabbitai coderabbitai bot mentioned this pull request Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant