Skip to content

Commit e84ed1a

Browse files
- added app validation - added app upload to app store connect
1 parent 8f456e7 commit e84ed1a

15 files changed

+24872
-5031
lines changed

.github/workflows/validate.yml

+27-9
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,27 @@ jobs:
1515
unity-build:
1616
name: '(${{ matrix.unity-version }}) ${{ matrix.build-target }}'
1717
env:
18+
VERSION: ''
1819
TEMPLATE_PATH: ''
19-
UNITY_PROJECT_PATH: '' # set by unity-setup action
20+
UNITY_PROJECT_PATH: ''
2021
runs-on: ${{ matrix.os }}
2122
strategy:
2223
fail-fast: false
2324
matrix:
24-
os: [macos-13]
25-
unity-version: [2021.x, 2022.x, 6000.x]
25+
os: [macos-15]
26+
unity-version: [2021.x, 2022.3.x, 6000.x]
2627
build-target:
2728
- iOS
2829
- StandaloneOSX
30+
- VisionOS
31+
exclude:
32+
- os: macos-15
33+
unity-version: 2021.x
34+
build-target: VisionOS
2935
steps:
3036
- uses: actions/checkout@v4
37+
with:
38+
fetch-depth: 0
3139
- run: 'npm install -g openupm-cli'
3240
# Installs the Unity Editor based on your project version text file
3341
# sets -> env.UNITY_EDITOR_PATH
@@ -37,7 +45,8 @@ jobs:
3745
version-file: 'None'
3846
build-targets: ${{ matrix.build-target }}
3947
unity-version: ${{ matrix.unity-version }}
40-
- name: Find Unity Template Path
48+
architecture: 'arm64'
49+
- name: Find Unity Template Path and Version
4150
run: |
4251
$rootPath = $env:UNITY_EDITOR_PATH -replace "Editor.*", ""
4352
Write-Host "ROOT_PATH=$rootPath"
@@ -46,6 +55,15 @@ jobs:
4655
echo "TEMPLATE_PATH=$templatePath" >> $env:GITHUB_ENV
4756
$projectPath = "${{ github.workspace }}/UnityProject"
4857
echo "UNITY_PROJECT_PATH=$projectPath" >> $env:GITHUB_ENV
58+
$version = $(git tag --sort=-v:refname) | Select-Object -First 1
59+
$version = $version.Substring(1)
60+
if ($version -match '^\d+\.\d+\.\d+$') {
61+
Write-Host "Version: $version"
62+
} else {
63+
Write-Host "Version: $version is not a valid version string"
64+
exit 1
65+
}
66+
echo "VERSION=$version" >> $env:GITHUB_ENV
4967
shell: pwsh
5068
# Activates the installation with the provided credentials
5169
- uses: RageAgainstThePixel/activate-unity-license@v1
@@ -58,7 +76,7 @@ jobs:
5876
with:
5977
log-name: 'create-test-project'
6078
args: '-quit -nographics -batchmode -createProject "${{ github.workspace }}/UnityProject" -cloneFromTemplate "${{ env.TEMPLATE_PATH }}"'
61-
- run: 'openupm add com.utilities.buildpipeline'
79+
- run: openupm add com.utilities.buildpipeline
6280
name: Add Build Pipeline Package
6381
working-directory: ${{ github.workspace }}/UnityProject
6482
- uses: RageAgainstThePixel/unity-action@v1
@@ -72,8 +90,7 @@ jobs:
7290
with:
7391
build-target: ${{ matrix.build-target }}
7492
log-name: '${{ matrix.build-target }}-Build'
75-
args: '-quit -nographics -batchmode -executeMethod Utilities.Editor.BuildPipeline.UnityPlayerBuildTools.StartCommandLineBuild -sceneList Assets/Scenes/SampleScene.unity -export -enableAppleAutomaticSigning -bundleIdentifier com.rageagainstthepixel.xcode'
76-
93+
args: '-quit -nographics -batchmode -executeMethod Utilities.Editor.BuildPipeline.UnityPlayerBuildTools.StartCommandLineBuild -sceneList Assets/Scenes/SampleScene.unity -export -enableAppleAutomaticSigning -bundleIdentifier com.rageagainstthepixel.xcode -versionName ${{ env.VERSION }}'
7794
- uses: ./ # RageAgainstThePixel/unity-xcode-builder
7895
id: xcode-build
7996
with:
@@ -82,9 +99,10 @@ jobs:
8299
app-store-connect-key-id: ${{ secrets.APP_STORE_CONNECT_KEY_ID }}
83100
app-store-connect-issuer-id: ${{ secrets.APP_STORE_CONNECT_ISSUER_ID }}
84101
team-id: ${{ secrets.APPLE_TEAM_ID }}
85-
export-option: ad-hoc
86-
102+
export-option: app-store
103+
upload: ${{ matrix.unity-version == '6000.x' }}
87104
- name: print outputs
105+
if: always()
88106
run: |
89107
echo "Executable: ${{ steps.xcode-build.outputs.executable }}"
90108
echo "Output Directory: ${{ steps.xcode-build.outputs.output-directory }}"

README.md

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
# unity-xcode-builder
22

3-
A GitHub Action to build and archive Unity exported xcode projects.
3+
A GitHub Action to take Unity exported Xcode projects and automate the process of building, signing, archiving, notarizing, and uploading to Apple App Store Connect or Steam.
44

55
> [!NOTE]
6-
> The main goal of this action to to take what is provided from Unity, archive, sign, notarize and package it to be directly uploaded to the Apple app store or steam.
6+
> Steam uploads require an additional action step: [`upload-steam`](https://github.com/RageAgainstThePixel/upload-steam)
77
88
## How to use
99

1010
### workflow
1111

12+
To archive, export, and upload directly to Apple App Store Connect, use the following workflow configuration:
13+
1214
```yaml
1315
steps:
1416
- uses: RageAgainstThePixel/unity-xcode-builder@v1
@@ -61,7 +63,9 @@ This action requires several secrets that need to be setup in the repository or
6163
| `export-option` | The export option to use for exporting the Xcode project. Can be one of `app-store`, `steam`, `ad-hoc`, `package`, `enterprise`, `development`, `developer-id`, `mac-application`. | Defaults to `development` |
6264
| `export-option-plist` | The path to custom export option plist file to use when exporting the Xcode project. | Overrides `export-option`. |
6365
| `entitlements-plist` | The path to custom entitlements plist file. | Generates [default hardened runtime entitlements](https://developer.apple.com/documentation/security/hardened-runtime) if not provided. |
64-
| `notarize` | Whether to notarize the exported Xcode project. | Defaults to `true` if `export-option === steam`. |
66+
| `notarize` | Whether to notarize the exported Xcode project. | Defaults to `true` if `export-option !== app-store`. |
67+
| `upload` | Whether to upload the exported Xcode project to App Store Connect. | Defaults to `true` if `export-option === app-store`. |
68+
| `whats-new` | When `uploading === true`, Let your testers know what you would like them to test in this build. This information will be available to testers in all groups who have access to this build. | Defaults to the last git commit sha, current branch name, and commit message. |
6569

6670
### outputs
6771

action.yml

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: unity-xcode-builder
2-
description: A GitHub Action to build and archive Unity exported xcode projects.
2+
description: A GitHub Action to build, archive, and upload Unity exported xcode projects.
33
branding:
44
icon: command
55
color: blue
@@ -66,6 +66,12 @@ inputs:
6666
notarize:
6767
description: Whether to notarize the exported Xcode project. Apps to be uploaded to Steam must be notarized by Apple. Defaults to `true` if `export-option === steam`.
6868
required: false
69+
upload:
70+
description: Whether to upload the exported Xcode project to App Store Connect. Defaults to `true` if `export-option === app-store`.
71+
required: false
72+
whats-new:
73+
description: 'When `uploading === true`, Let your testers know what you would like them to test in this build. This information will be available to testers in all groups who have access to this build. Defaults to the last git commit sha, current branch name, and commit message.'
74+
required: false
6975
outputs:
7076
executable:
7177
description: The path to the generated archive executable.

0 commit comments

Comments
 (0)