Skip to content
Merged
Show file tree
Hide file tree
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 Aug 7, 2025
3675fcb
double it up
StephenHodgson Aug 7, 2025
240e7ca
test not setting a dest
StephenHodgson Aug 7, 2025
98400e4
show destinations
StephenHodgson Aug 8, 2025
aee2ff9
show dest
StephenHodgson Aug 8, 2025
58bdd71
only 16.2
StephenHodgson Aug 8, 2025
9cb21d0
refactor
StephenHodgson Aug 8, 2025
3dac8e9
as json
StephenHodgson Aug 8, 2025
2673822
attempt to parse destinations
StephenHodgson Aug 8, 2025
8ae034f
split :
StephenHodgson Aug 8, 2025
9d26023
fix build settings args
StephenHodgson Aug 8, 2025
d8be026
refactor
StephenHodgson Aug 8, 2025
be48771
to lower
StephenHodgson Aug 8, 2025
d5c5978
use `generic/platform=${platform}` fallback
StephenHodgson Aug 8, 2025
05f52d9
exclude projects inside DerivedData directory
StephenHodgson Aug 28, 2025
cbdc7f0
build and validate all platforms
StephenHodgson Aug 28, 2025
f84928d
download platform once we know it
StephenHodgson Aug 29, 2025
11a7a74
update validation matrix
StephenHodgson Aug 29, 2025
caf2294
revert
StephenHodgson Aug 29, 2025
9f91249
Update Xcode version to 16.4 in validate.yml
StephenHodgson Aug 29, 2025
661194b
logging
StephenHodgson Aug 29, 2025
6a877be
Merge branch 'development' of https://github.com/buildalon/unity-xcod…
StephenHodgson Aug 29, 2025
607c62e
update workflow validation
StephenHodgson Aug 29, 2025
c9ce316
don't download macOS platform
StephenHodgson Aug 29, 2025
b09d2bd
check if sdk is installed
StephenHodgson Aug 31, 2025
c574325
remove destination parsing and use generic
StephenHodgson Sep 2, 2025
5f0ee3c
try to download sdk platform if missing before we get build settings
StephenHodgson Sep 2, 2025
879419d
refactor and fix
StephenHodgson Sep 2, 2025
fe4ec0c
more refactoring
StephenHodgson Sep 2, 2025
4486359
try 16.4
StephenHodgson Sep 3, 2025
c2c9408
list possible candidates
StephenHodgson Sep 4, 2025
20086e4
some refactoring
StephenHodgson Sep 4, 2025
947cca1
update workflows
StephenHodgson Sep 4, 2025
e060c86
fix draft flag
StephenHodgson Sep 4, 2025
8cc29b3
update build-options
StephenHodgson Sep 4, 2025
9c57987
update build-options
StephenHodgson Sep 4, 2025
83e625e
update build-options
StephenHodgson Sep 4, 2025
2e8781f
remove parallel
StephenHodgson Sep 4, 2025
b968626
only upload 6000.1.x to app store connect
StephenHodgson Sep 4, 2025
a2ca1a0
refactor workflows
StephenHodgson Sep 4, 2025
76c5aec
update workflow
StephenHodgson Sep 4, 2025
cd2a5ec
refactor file content print
StephenHodgson Sep 4, 2025
ecf72ab
one unity version at a time
StephenHodgson Sep 4, 2025
2178992
refactor how we check and install sdks
StephenHodgson Sep 4, 2025
3cb122b
update sdk download strategy
StephenHodgson Sep 4, 2025
3fa422c
update app store connect requirements
StephenHodgson Sep 5, 2025
356e16f
update sdk resolution
StephenHodgson Sep 5, 2025
99a00dd
always download
StephenHodgson Sep 5, 2025
e46fda5
some refactoring
StephenHodgson Sep 5, 2025
54ae0d7
more refactoring
StephenHodgson Sep 5, 2025
55ba25d
skip xc beautify
StephenHodgson Sep 5, 2025
0a9ab0c
fix xcodebuild outout
StephenHodgson Sep 5, 2025
66bd3de
more fixes to callbacks
StephenHodgson Sep 5, 2025
48e708c
run first launch
StephenHodgson Sep 5, 2025
e8437a1
always attempt to download platform sdk
StephenHodgson Sep 5, 2025
98f8ef4
list simulators before attempting to list sdks
StephenHodgson Sep 5, 2025
1161919
always download
StephenHodgson Sep 6, 2025
dc01891
try macos-14 only
StephenHodgson Sep 6, 2025
30c08d5
update matrix
StephenHodgson Sep 6, 2025
2c576da
use a version that actually exists
StephenHodgson Sep 6, 2025
267e45d
update xcrun
StephenHodgson Sep 6, 2025
14a195e
use 16.1 since 15.x doesn't support vision os
StephenHodgson Sep 6, 2025
2bd8ebc
fix json parsing
StephenHodgson Sep 6, 2025
ac0a8ce
change app store version
StephenHodgson Sep 6, 2025
9754d72
re-enable xcbeaufity
StephenHodgson Sep 7, 2025
152dd99
xcrun
StephenHodgson Sep 7, 2025
8770462
more refactoring
StephenHodgson Sep 7, 2025
282881d
refactor terminal outputs
StephenHodgson Sep 7, 2025
b11b96e
revert
StephenHodgson Sep 7, 2025
3ba0942
set some logs to debug only
StephenHodgson Sep 7, 2025
bdb2bbd
more tweaks and a fix for listing devices
StephenHodgson Sep 7, 2025
bce4750
simctl list runtimes
StephenHodgson Sep 7, 2025
6d8560b
xcrun silence option
StephenHodgson Sep 7, 2025
582ca99
show progress for uploads
StephenHodgson Sep 7, 2025
e4d5e55
a bit more cleanup
StephenHodgson Sep 7, 2025
a145fa3
more tweaks
StephenHodgson Sep 7, 2025
d836e02
update format
StephenHodgson Sep 7, 2025
1fdfd6b
test latest
StephenHodgson Sep 8, 2025
0e5f074
pin build options to macos-14
StephenHodgson Sep 9, 2025
d64b654
update workflow options
StephenHodgson Sep 15, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/build-options.json
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"
}
]
}
186 changes: 186 additions & 0 deletions .github/workflows/build.yml
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::"
164 changes: 24 additions & 140 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,154 +5,38 @@ on:
pull_request:
types: [opened, reopened, synchronize, ready_for_review]
branches: ['*']
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
workflow_dispatch: # Allows you to run this workflow manually from the Actions tab
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
unity-build:
setup:
if: github.event.pull_request.draft == false
name: '(${{ matrix.unity-version }}) ${{ matrix.build-target }}'
runs-on: ubuntu-latest
permissions:
contents: read
env:
VERSION: ''
TEMPLATE_PATH: ''
EXPORT_OPTION: ''
UNITY_PROJECT_PATH: ''
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest]
unity-version: [2021.x, 2022.x, 6000.x]
build-target:
- iOS
- StandaloneOSX
- VisionOS
exclude:
- os: macos-latest
unity-version: 2021.x
build-target: VisionOS
- os: macos-latest
unity-version: 2022.x
build-target: VisionOS
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: Find Unity Template Path and Version
run: |
$rootPath = $env:UNITY_EDITOR_PATH -replace "Editor.*", ""
Write-Host "ROOT_PATH=$rootPath"
$templatePath = Get-ChildItem -Recurse -Filter "com.unity.template.3d*.tgz" -Path $rootPath | Select-Object -First 1 | Select-Object -ExpandProperty FullName
Write-Host "TEMPLATE_PATH=$templatePath"
echo "TEMPLATE_PATH=$templatePath" >> $env:GITHUB_ENV
$projectPath = "${{ github.workspace }}/UnityProject"
echo "UNITY_PROJECT_PATH=$projectPath" >> $env:GITHUB_ENV

# Read version from package.json instead of git tags
$packageJsonPath = "${{ github.workspace }}/package.json"
$packageJson = Get-Content -Raw -Path $packageJsonPath | ConvertFrom-Json
$version = $packageJson.version

if ($version -match '^\d+\.\d+\.\d+$') {
Write-Host "Version from package.json: $version"
} else {
Write-Host "Version: $version is not a valid version string"
exit 1
}
echo "VERSION=$version" >> $env:GITHUB_ENV

# if the unity-version is 6000.x then set export option to app-store-connect otherwise set it to development
if ('${{ matrix.unity-version }}' -eq '6000.x') {
echo "EXPORT_OPTION=app-store-connect" >> $env:GITHUB_ENV
} else {
if ('${{ matrix.build-target }}' -eq 'StandaloneOSX') {
if ('${{ matrix.unity-version }}' -eq '2022.x') {
echo "EXPORT_OPTION=steam" >> $env:GITHUB_ENV
} else {
echo "EXPORT_OPTION=developer-id" >> $env:GITHUB_ENV
}
} else {
echo "EXPORT_OPTION=development" >> $env:GITHUB_ENV
}
}
shell: pwsh
- uses: buildalon/activate-unity-license@v1
with:
license: 'Personal'
username: ${{ secrets.UNITY_USERNAME }}
password: ${{ secrets.UNITY_PASSWORD }}
- uses: buildalon/unity-action@v1
name: Create Test Project
with:
log-name: 'create-test-project'
args: '-quit -nographics -batchmode -createProject "${{ github.workspace }}/UnityProject" -cloneFromTemplate "${{ env.TEMPLATE_PATH }}"'
- run: openupm add com.virtualmaker.buildalon
name: Add Build Pipeline Package
working-directory: ${{ github.workspace }}/UnityProject
- 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'
sparse-checkout: .github/
- uses: RageAgainstThePixel/job-builder@v1
id: setup-jobs
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 }}'
- name: Update Info.Plist with encryption compliance
shell: bash
run: |
set -xe
# 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 }}
if [ "$TARGET_PLATFORM" == "StandaloneOSX" ]; then
INFO_PLIST_PATH="${{ env.UNITY_PROJECT_PATH }}/Builds/${{ matrix.build-target }}/com.test.buildalon.xcode/UnityProject/UnityProject/Info.plist"
else
INFO_PLIST_PATH="${{ env.UNITY_PROJECT_PATH }}/Builds/${{ matrix.build-target }}/com.test.buildalon.xcode/Info.plist"
fi
# make sure plist buddy is installed
if ! command -v /usr/libexec/PlistBuddy &> /dev/null
then
echo "PlistBuddy could not be found"
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:
project-path: ${{ env.UNITY_PROJECT_PATH }}/Builds/${{ matrix.build-target }}/**/*.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: ${{ matrix.unity-version != '6000.x' }}
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
if: always()
run: |
echo "Executable: ${{ steps.xcode-build.outputs.executable }}"
echo "Output Directory: ${{ steps.xcode-build.outputs.output-directory }}"
ls -R "${{ steps.xcode-build.outputs.output-directory }}"
build-options: ./.github/workflows/build-options.json
group-by: 'unity-version'
outputs:
jobs: ${{ steps.setup-jobs.outputs.jobs }}
validate:
if: ${{ needs.setup.outputs.jobs }}
needs: setup
name: build ${{ matrix.jobs.name }}
permissions:
contents: read
strategy:
matrix: ${{ fromJSON(needs.setup.outputs.jobs) }}
fail-fast: false
max-parallel: 1
secrets: inherit
uses: ./.github/workflows/build.yml
with:
matrix: ${{ toJSON(matrix.jobs.matrix) }}
Loading
Loading