-
Notifications
You must be signed in to change notification settings - Fork 2
unity-xcode-builder@v1.3.4 #24
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
Merged
Merged
Changes from all commits
Commits
Show all changes
80 commits
Select commit
Hold shift + click to select a range
de21ab4
unity-xcode-builder@v1.3.4
StephenHodgson 3675fcb
double it up
StephenHodgson 240e7ca
test not setting a dest
StephenHodgson 98400e4
show destinations
StephenHodgson aee2ff9
show dest
StephenHodgson 58bdd71
only 16.2
StephenHodgson 9cb21d0
refactor
StephenHodgson 3dac8e9
as json
StephenHodgson 2673822
attempt to parse destinations
StephenHodgson 8ae034f
split :
StephenHodgson 9d26023
fix build settings args
StephenHodgson d8be026
refactor
StephenHodgson be48771
to lower
StephenHodgson d5c5978
use `generic/platform=${platform}` fallback
StephenHodgson 05f52d9
exclude projects inside DerivedData directory
StephenHodgson cbdc7f0
build and validate all platforms
StephenHodgson f84928d
download platform once we know it
StephenHodgson 11a7a74
update validation matrix
StephenHodgson caf2294
revert
StephenHodgson 9f91249
Update Xcode version to 16.4 in validate.yml
StephenHodgson 661194b
logging
StephenHodgson 6a877be
Merge branch 'development' of https://github.com/buildalon/unity-xcod…
StephenHodgson 607c62e
update workflow validation
StephenHodgson c9ce316
don't download macOS platform
StephenHodgson b09d2bd
check if sdk is installed
StephenHodgson c574325
remove destination parsing and use generic
StephenHodgson 5f0ee3c
try to download sdk platform if missing before we get build settings
StephenHodgson 879419d
refactor and fix
StephenHodgson fe4ec0c
more refactoring
StephenHodgson 4486359
try 16.4
StephenHodgson c2c9408
list possible candidates
StephenHodgson 20086e4
some refactoring
StephenHodgson 947cca1
update workflows
StephenHodgson e060c86
fix draft flag
StephenHodgson 8cc29b3
update build-options
StephenHodgson 9c57987
update build-options
StephenHodgson 83e625e
update build-options
StephenHodgson 2e8781f
remove parallel
StephenHodgson b968626
only upload 6000.1.x to app store connect
StephenHodgson a2ca1a0
refactor workflows
StephenHodgson 76c5aec
update workflow
StephenHodgson cd2a5ec
refactor file content print
StephenHodgson ecf72ab
one unity version at a time
StephenHodgson 2178992
refactor how we check and install sdks
StephenHodgson 3cb122b
update sdk download strategy
StephenHodgson 3fa422c
update app store connect requirements
StephenHodgson 356e16f
update sdk resolution
StephenHodgson 99a00dd
always download
StephenHodgson e46fda5
some refactoring
StephenHodgson 54ae0d7
more refactoring
StephenHodgson 55ba25d
skip xc beautify
StephenHodgson 0a9ab0c
fix xcodebuild outout
StephenHodgson 66bd3de
more fixes to callbacks
StephenHodgson 48e708c
run first launch
StephenHodgson e8437a1
always attempt to download platform sdk
StephenHodgson 98f8ef4
list simulators before attempting to list sdks
StephenHodgson 1161919
always download
StephenHodgson dc01891
try macos-14 only
StephenHodgson 30c08d5
update matrix
StephenHodgson 2c576da
use a version that actually exists
StephenHodgson 267e45d
update xcrun
StephenHodgson 14a195e
use 16.1 since 15.x doesn't support vision os
StephenHodgson 2bd8ebc
fix json parsing
StephenHodgson ac0a8ce
change app store version
StephenHodgson 9754d72
re-enable xcbeaufity
StephenHodgson 152dd99
xcrun
StephenHodgson 8770462
more refactoring
StephenHodgson 282881d
refactor terminal outputs
StephenHodgson b11b96e
revert
StephenHodgson 3ba0942
set some logs to debug only
StephenHodgson bdb2bbd
more tweaks and a fix for listing devices
StephenHodgson bce4750
simctl list runtimes
StephenHodgson 6d8560b
xcrun silence option
StephenHodgson 582ca99
show progress for uploads
StephenHodgson e4d5e55
a bit more cleanup
StephenHodgson a145fa3
more tweaks
StephenHodgson d836e02
update format
StephenHodgson 1fdfd6b
test latest
StephenHodgson 0e5f074
pin build options to macos-14
StephenHodgson d64b654
update workflow options
StephenHodgson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"os": [ | ||
"macos-latest" | ||
], | ||
"unity-version": [ | ||
"2021.x", | ||
"2022.x", | ||
"6000.0.x", | ||
"6000.1.x", | ||
"6000.2.x" | ||
], | ||
"build-target": [ | ||
"StandaloneOSX", | ||
"iOS", | ||
"VisionOS" | ||
], | ||
"xcode-version": [ | ||
"16.3", | ||
"16.4" | ||
], | ||
"exclude": [ | ||
{ | ||
"unity-version": "2021.x", | ||
"build-target": "VisionOS" | ||
}, | ||
{ | ||
"unity-version": "2022.x", | ||
"build-target": "VisionOS" | ||
} | ||
] | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,186 @@ | ||
name: build | ||
permissions: | ||
contents: read | ||
on: | ||
workflow_call: | ||
inputs: | ||
matrix: | ||
required: true | ||
type: string | ||
secrets: | ||
UNITY_USERNAME: | ||
required: true | ||
UNITY_PASSWORD: | ||
required: true | ||
jobs: | ||
build: | ||
name: ${{ matrix.name }} | ||
strategy: | ||
matrix: ${{ fromJSON(inputs.matrix) }} | ||
fail-fast: false | ||
runs-on: ${{ matrix.os }} | ||
permissions: | ||
contents: read | ||
env: | ||
VERSION: '' | ||
EXPORT_OPTION: '' | ||
BUILD_DIRECTORY: '' | ||
UNITY_PROJECT_PATH: ${{ github.workspace }}/UnityProject | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- run: 'npm install -g openupm-cli' | ||
- uses: buildalon/unity-setup@v1 | ||
with: | ||
version-file: 'None' | ||
build-targets: ${{ matrix.build-target }} | ||
unity-version: ${{ matrix.unity-version }} | ||
- name: Set Build Args | ||
shell: bash | ||
run: | | ||
set -e | ||
# Read version from package.json instead of git tags | ||
package_json_path="${{ github.workspace }}/package.json" | ||
version=$(jq -r .version "$package_json_path") | ||
|
||
if [[ "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | ||
echo "Version from package.json: $version" | ||
else | ||
echo "Version: $version is not a valid version string" | ||
exit 1 | ||
fi | ||
echo "VERSION=$version" >> "$GITHUB_ENV" | ||
|
||
# Only set export option to app-store-connect if unity-version is 6000.2.x AND xcode-version is 16.4 | ||
if [[ "${{ matrix.unity-version }}" == "6000.2.x" && "${{ matrix.xcode-version }}" == "16.2" ]]; then | ||
echo "EXPORT_OPTION=app-store-connect" >> "$GITHUB_ENV" | ||
else | ||
if [[ "${{ matrix.build-target }}" == "StandaloneOSX" ]]; then | ||
if [[ "${{ matrix.unity-version }}" == "2022.x" ]]; then | ||
echo "EXPORT_OPTION=steam" >> "$GITHUB_ENV" | ||
else | ||
echo "EXPORT_OPTION=developer-id" >> "$GITHUB_ENV" | ||
fi | ||
else | ||
echo "EXPORT_OPTION=development" >> "$GITHUB_ENV" | ||
fi | ||
fi | ||
|
||
# set BUILD_DIRECTORY to a path in the root of the workspace named ./Builds/<build-target>/ | ||
build_directory="${{ github.workspace }}/Builds/${{ matrix.build-target }}" | ||
echo "Creating build directory at $build_directory" | ||
mkdir -p "$build_directory" | ||
echo "BUILD_DIRECTORY=$build_directory" >> "$GITHUB_ENV" | ||
- uses: buildalon/activate-unity-license@v1 | ||
|
||
with: | ||
license: 'Personal' | ||
username: ${{ secrets.UNITY_USERNAME }} | ||
password: ${{ secrets.UNITY_PASSWORD }} | ||
- uses: buildalon/create-unity-project@v1 | ||
|
||
name: Create Test Project | ||
with: | ||
project-name: UnityProject | ||
template-name: com.unity.template.3d(-cross-platform)? | ||
- run: openupm add com.virtualmaker.buildalon | ||
name: Add Build Pipeline Package | ||
working-directory: ${{ env.UNITY_PROJECT_PATH }} | ||
- uses: buildalon/unity-action@v1 | ||
|
||
name: '${{ matrix.build-target }}-Validate' | ||
with: | ||
build-target: ${{ matrix.build-target }} | ||
log-name: '${{ matrix.build-target }}-Validate' | ||
args: '-quit -nographics -batchmode -executeMethod Buildalon.Editor.BuildPipeline.UnityPlayerBuildTools.ValidateProject -importTMProEssentialsAsset' | ||
- uses: buildalon/unity-action@v1 | ||
|
||
name: '${{ matrix.build-target }}-Build' | ||
with: | ||
build-target: ${{ matrix.build-target }} | ||
log-name: '${{ matrix.build-target }}-Build' | ||
args: '-quit -nographics -batchmode -executeMethod Buildalon.Editor.BuildPipeline.UnityPlayerBuildTools.StartCommandLineBuild -sceneList Assets/Scenes/SampleScene.unity -export -enableAppleAutomaticSigning -bundleIdentifier com.test.buildalon.xcode -versionName ${{ env.VERSION }} -buildOutputDirectory ${{ env.BUILD_DIRECTORY }}' | ||
- name: Update Info.Plist with encryption compliance | ||
shell: bash | ||
run: | | ||
set -e | ||
BUILD_DIRECTORY="${{ env.BUILD_DIRECTORY }}" | ||
|
||
if [ -z "$BUILD_DIRECTORY" ]; then | ||
echo "env.BUILD_DIRECTORY is not set!" | ||
exit 1 | ||
fi | ||
|
||
# recursively list build output files | ||
echo "::group::Build Output Directory: ${BUILD_DIRECTORY}/com.test.buildalon.xcode" | ||
ls -alR "${BUILD_DIRECTORY}/com.test.buildalon.xcode" | ||
echo "::endgroup::" | ||
|
||
# find the Info.plist file in the build directory | ||
# MacOSStandalone Info.plist path: /Users/runner/work/unity-xcode-builder/unity-xcode-builder/UnityProject/Builds/StandaloneOSX/com.test.buildalon.xcode/UnityProject/UnityProject/Info.plist | ||
# all others: /Users/runner/work/unity-xcode-builder/unity-xcode-builder/UnityProject/Builds/iOS/com.test.buildalon.xcode/Info.plist | ||
EXPORT_OPTION="${{ env.EXPORT_OPTION }}" | ||
|
||
if [ "$EXPORT_OPTION" != "app-store-connect" ]; then | ||
exit 0 | ||
fi | ||
|
||
TARGET_PLATFORM="${{ matrix.build-target }}" | ||
|
||
INFO_PLIST_PATH="${BUILD_DIRECTORY}/com.test.buildalon.xcode/UnityProject/UnityProject/Info.plist" | ||
|
||
if [ ! -f "$INFO_PLIST_PATH" ]; then | ||
INFO_PLIST_PATH="${BUILD_DIRECTORY}/com.test.buildalon.xcode/Info.plist" | ||
fi | ||
|
||
# test path exists | ||
if [ ! -f "$INFO_PLIST_PATH" ]; then | ||
echo "Info.plist not found at path: $INFO_PLIST_PATH" | ||
exit 1 | ||
fi | ||
|
||
# make sure plist buddy is installed | ||
if ! command -v /usr/libexec/PlistBuddy &> /dev/null | ||
then | ||
echo "PlistBuddy could not be found" | ||
# list build output files recursively | ||
ls -alR "${BUILD_DIRECTORY}/com.test.buildalon.xcode" | ||
exit 1 | ||
fi | ||
|
||
# set ITSAppUsesNonExemptEncryption to false in Info.plist using PlistBuddy | ||
/usr/libexec/PlistBuddy -c "Add :ITSAppUsesNonExemptEncryption bool false" "$INFO_PLIST_PATH" | ||
- uses: ./ # buildalon/unity-xcode-builder | ||
id: xcode-build | ||
with: | ||
xcode-version: ${{ matrix.xcode-version }} | ||
project-path: ${{ env.BUILD_DIRECTORY }}/**/*.xcodeproj | ||
app-store-connect-key: ${{ secrets.APP_STORE_CONNECT_KEY }} | ||
app-store-connect-key-id: ${{ secrets.APP_STORE_CONNECT_KEY_ID }} | ||
app-store-connect-issuer-id: ${{ secrets.APP_STORE_CONNECT_ISSUER_ID }} | ||
team-id: ${{ secrets.APPLE_TEAM_ID }} | ||
export-option: ${{ env.EXPORT_OPTION }} | ||
notarize: ${{ env.EXPORT_OPTION != 'app-store-connect' }} | ||
archive-type: pkg | ||
test-groups: Beta | ||
developer-id-application-certificate: ${{ secrets.DEVELOPER_ID_APPLICATION_CERT }} | ||
developer-id-application-certificate-password: ${{ secrets.SIGNING_CERT_PASSWORD }} | ||
developer-id-installer-certificate: ${{ secrets.DEVELOPER_ID_INSTALLER_CERT }} | ||
developer-id-installer-certificate-password: ${{ secrets.SIGNING_CERT_PASSWORD }} | ||
- name: print outputs | ||
run: | | ||
set -e | ||
|
||
EXECUTABLE="${{ steps.xcode-build.outputs.executable }}" | ||
|
||
if [ -z "${EXECUTABLE}" ]; then | ||
echo "No executable found in outputs" | ||
exit 1 | ||
fi | ||
|
||
echo "Executable: ${EXECUTABLE}" | ||
OUTPUT_DIRECTORY="${{ steps.xcode-build.outputs.output-directory }}" | ||
|
||
if [ -z "${OUTPUT_DIRECTORY}" ]; then | ||
echo "No output directory found in outputs" | ||
exit 1 | ||
fi | ||
|
||
echo "::group::Output Directory: ${OUTPUT_DIRECTORY}" | ||
ls -R "${OUTPUT_DIRECTORY}" | ||
echo "::endgroup::" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.