Skip to content

Commit a84a60e

Browse files
- added new inputs - `test-groups`: One or more test groups to automatically add to the build when uploading to TestFlight. When using multiple groups, separate them with commas. - `archive-type`: The archive type to use when exporting macOS applications when not uploading to the App Store. Can be one of `app` or `pkg`. - `submit-for-review`: Automatically submit beta build for review and notify testers - `developer-id-application-certificate`: The `Developer ID Application` certificate encoded as base64 string. Used for signing macOS app bundles when not uploading to app store. - `developer-id-application-certificate-password`: The password for the `Developer ID Application` certificate. - `developer-id-installer-certificate`: The `Developer ID Installer` certificate encoded as base64 string. Used for signing installer packages for macOS applications. - `developer-id-installer-certificate-password`: The password for the `Developer ID Installer` certificate. - renamed inputs: - `certificate` -> `manual-signing-certificate` - `certificate-password` -> `manual-certificate-password` - `signing-identity` -> `manual-signing-identity` - fixed notarization workflow - extended test detail upload polling - adjusted export option handling - improvements to credential import and cleanup
1 parent 3898127 commit a84a60e

12 files changed

+1545
-241
lines changed

.github/workflows/update-release-tags.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Update Release Tags
22
on:
33
push:
4-
tags: '*'
4+
tags: ['*']
55
workflow_dispatch:
66
jobs:
77
update-release-tags:

.github/workflows/validate.yml

Lines changed: 57 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
name: validate
22
on:
33
push:
4-
branches:
5-
- 'main'
4+
branches: ['main']
65
pull_request:
76
types: [opened, reopened, synchronize, ready_for_review]
8-
branches:
9-
- '*'
7+
branches: ['*']
108
# Allows you to run this workflow manually from the Actions tab
119
workflow_dispatch:
1210
concurrency:
@@ -16,16 +14,19 @@ jobs:
1614
unity-build:
1715
if: github.event.pull_request.draft == false
1816
name: '(${{ matrix.unity-version }}) ${{ matrix.build-target }}'
17+
permissions:
18+
contents: read
1919
env:
2020
VERSION: ''
2121
TEMPLATE_PATH: ''
22+
EXPORT_OPTION: ''
2223
UNITY_PROJECT_PATH: ''
2324
runs-on: ${{ matrix.os }}
2425
strategy:
2526
fail-fast: false
2627
matrix:
2728
os: [macos-latest]
28-
unity-version: [2021.x, 2022.3.x, 6000.x]
29+
unity-version: [2021.x, 2022.x, 6000.x]
2930
build-target:
3031
- iOS
3132
- StandaloneOSX
@@ -34,14 +35,12 @@ jobs:
3435
- os: macos-latest
3536
unity-version: 2021.x
3637
build-target: VisionOS
38+
- os: macos-latest
39+
unity-version: 2022.x
40+
build-target: VisionOS
3741
steps:
3842
- uses: actions/checkout@v4
39-
with:
40-
fetch-depth: 0
4143
- run: 'npm install -g openupm-cli'
42-
# Installs the Unity Editor based on your project version text file
43-
# sets -> env.UNITY_EDITOR_PATH
44-
# sets -> env.UNITY_PROJECT_PATH
4544
- uses: buildalon/unity-setup@v1
4645
with:
4746
version-file: 'None'
@@ -69,6 +68,21 @@ jobs:
6968
exit 1
7069
}
7170
echo "VERSION=$version" >> $env:GITHUB_ENV
71+
72+
# if the unity-version is 6000.x then set export option to app-store-connect otherwise set it to development
73+
if ('${{ matrix.unity-version }}' -eq '6000.x') {
74+
echo "EXPORT_OPTION=app-store-connect" >> $env:GITHUB_ENV
75+
} else {
76+
if ('${{ matrix.build-target }}' -eq 'StandaloneOSX') {
77+
if ('${{ matrix.unity-version }}' -eq '2022.x') {
78+
echo "EXPORT_OPTION=steam" >> $env:GITHUB_ENV
79+
} else {
80+
echo "EXPORT_OPTION=developer-id" >> $env:GITHUB_ENV
81+
}
82+
} else {
83+
echo "EXPORT_OPTION=development" >> $env:GITHUB_ENV
84+
}
85+
}
7286
shell: pwsh
7387
- uses: buildalon/activate-unity-license@v1
7488
with:
@@ -95,6 +109,31 @@ jobs:
95109
build-target: ${{ matrix.build-target }}
96110
log-name: '${{ matrix.build-target }}-Build'
97111
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 }}'
112+
- name: Update Info.Plist with encryption compliance
113+
shell: bash
114+
run: |
115+
set -xe
116+
# find the Info.plist file in the build directory
117+
# MacOSStandalone Info.plist path: /Users/runner/work/unity-xcode-builder/unity-xcode-builder/UnityProject/Builds/StandaloneOSX/com.test.buildalon.xcode/UnityProject/UnityProject/Info.plist
118+
# all others: /Users/runner/work/unity-xcode-builder/unity-xcode-builder/UnityProject/Builds/iOS/com.test.buildalon.xcode/Info.plist
119+
EXPORT_OPTION=${{ env.EXPORT_OPTION }}
120+
if [ "$EXPORT_OPTION" != "app-store-connect" ]; then
121+
exit 0
122+
fi
123+
TARGET_PLATFORM=${{ matrix.build-target }}
124+
if [ "$TARGET_PLATFORM" == "StandaloneOSX" ]; then
125+
INFO_PLIST_PATH="${{ env.UNITY_PROJECT_PATH }}/Builds/${{ matrix.build-target }}/com.test.buildalon.xcode/UnityProject/UnityProject/Info.plist"
126+
else
127+
INFO_PLIST_PATH="${{ env.UNITY_PROJECT_PATH }}/Builds/${{ matrix.build-target }}/com.test.buildalon.xcode/Info.plist"
128+
fi
129+
# make sure plist buddy is installed
130+
if ! command -v /usr/libexec/PlistBuddy &> /dev/null
131+
then
132+
echo "PlistBuddy could not be found"
133+
exit 1
134+
fi
135+
# set ITSAppUsesNonExemptEncryption to false in Info.plist using PlistBuddy
136+
/usr/libexec/PlistBuddy -c "Add :ITSAppUsesNonExemptEncryption bool false" "$INFO_PLIST_PATH"
98137
- uses: ./ # buildalon/unity-xcode-builder
99138
id: xcode-build
100139
with:
@@ -103,8 +142,14 @@ jobs:
103142
app-store-connect-key-id: ${{ secrets.APP_STORE_CONNECT_KEY_ID }}
104143
app-store-connect-issuer-id: ${{ secrets.APP_STORE_CONNECT_ISSUER_ID }}
105144
team-id: ${{ secrets.APPLE_TEAM_ID }}
106-
export-option: app-store
107-
upload: ${{ matrix.unity-version == '6000.x' }}
145+
export-option: ${{ env.EXPORT_OPTION }}
146+
notarize: ${{ matrix.unity-version != '6000.x' }}
147+
archive-type: pkg
148+
test-groups: Beta
149+
developer-id-application-certificate: ${{ secrets.DEVELOPER_ID_APPLICATION_CERT }}
150+
developer-id-application-certificate-password: ${{ secrets.SIGNING_CERT_PASSWORD }}
151+
developer-id-installer-certificate: ${{ secrets.DEVELOPER_ID_INSTALLER_CERT }}
152+
developer-id-installer-certificate-password: ${{ secrets.SIGNING_CERT_PASSWORD }}
108153
- name: print outputs
109154
if: always()
110155
run: |

README.md

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,25 +51,32 @@ This action requires several secrets that need to be setup in the repository or
5151
| `app-store-connect-key` | The App Store Connect API AuthKey_*.p8 key encoded as base64 string. | true |
5252
| `app-store-connect-key-id` | The App Store Connect API key id. | true |
5353
| `app-store-connect-issuer-id` | The issuer ID of the App Store Connect API key. | true |
54-
| `certificate` | Exported signing certificate.p12 encoded as base64 string. Overrides the automatic signing in Xcode. | Defaults to Automatic signing. |
55-
| `certificate-password` | The password for the exported certificate. | Required if `certificate` is provided. |
56-
| `signing-identity` | The signing identity to use for signing the Xcode project. | Parsed from the `certificate` if not provided. |
54+
| `manual-signing-certificate` | Exported signing certificate.p12 encoded as base64 string. Overrides the automatic signing in Xcode. | Defaults to Automatic signing. |
55+
| `manual-signing-certificate-password` | The password for the exported certificate. | Required if `manual-signing-certificate` is provided. |
56+
| `manual-signing-identity` | The signing identity to use for signing the Xcode project. | Parsed from the `manual-signing-certificate` if not provided. |
5757
| `provisioning-profile` | The provisioning profile to use as base64 string. Use when manually signing the Xcode project. | Defaults to Automatic signing. |
5858
| `provisioning-profile-name` | The name of the provisioning profile file, including the type to use for signing the Xcode project. Must end with either `.mobileprovision` or `.provisionprofile`. | Required if `provisioning-profile` is provided. |
59-
| `team-id` | The team ID to use for signing the Xcode project. | Defaults to parsing team ID from `certificate` if provided. |
59+
| `team-id` | The team ID to use for signing the Xcode project. | Defaults to parsing team ID from `manual-signing-certificate` if provided. |
6060
| `bundle-id` | The bundle ID of the Xcode project. Overrides the value in the exported Unity project. | Defaults to parsing bundle ID from `.xcodeproj`. |
6161
| `configuration` | The configuration to build the Xcode project with. | Defaults to `Release`. |
6262
| `scheme` | The scheme to use when building the xcode project. | false |
6363
| `destination` | The destination to use when building the xcode project. | Defaults to `generic/platform={platform}`. |
6464
| `platform` | The platform to build for. Can be one of `iOS`, `macOS`, `tvOS`, `visionOS`. | Defaults to parsing platform from `.xcodeproj`. |
6565
| `platform-sdk-version` | The version of the platform SDK to use for building the Xcode project. | Defaults to the latest version of the platform SDK defined in the `.xcodeproj`. |
66-
| `export-option` | The export option to use for exporting the Xcode project. Can be one of `app-store-connect`, `steam`, `release-testing`, `package`, `enterprise`, `debugging`, `developer-id`, `mac-application`. | Defaults to `development` |
66+
| `export-option` | The export option to use for exporting the Xcode project. Can be one of `app-store-connect`, `steam`, `release-testing`, `enterprise`, `debugging`, `developer-id`, `mac-application`. | Defaults to `development` |
6767
| `export-option-plist` | The path to custom export option plist file to use when exporting the Xcode project. | Overrides `export-option`. |
6868
| `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. |
6969
| `notarize` | Whether to notarize the exported Xcode project. | Defaults to `true` if `export-option !== app-store-connect`. |
70+
| `archive-type` | The archive type to use when exporting macOS applications when not uploading to the App Store. Can be one of `app` or `pkg`. | Defaults to `app`. Forces `app` if `export-option === steam`. |
7071
| `upload` | Whether to upload the exported Xcode project to App Store Connect. | Defaults to `true` if `export-option === app-store-connect`. |
71-
| `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. |
72-
| `auto-increment-build-number` | Whether to automatically increment the CFBundleVersion in the Xcode project. | Defaults to `true` if `export-option === app-store-connect`. |
72+
| `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 up to 4000 characters. |
73+
| `auto-increment-build-number` | Whether to automatically increment the `CFBundleVersion` in the Xcode project. | Defaults to `true` if `export-option === app-store-connect`. |
74+
| `test-groups` | One or more test groups to automatically add to the build when uploading to TestFlight. When using multiple groups, separate them with commas. | None by default. |
75+
| `submit-for-review` | Whether to submit the build for review when uploading to App Store Connect. | Defaults to `false`. |
76+
| `developer-id-application-certificate` | The `Developer ID Application` certificate encoded as base64 string. | Required if `export-option === steam` or `export-option === developer-id` or `notarize === true`. |
77+
| `developer-id-application-certificate-password` | The password for the `Developer ID Application` certificate. | Required if `developer-id-application-certificate` is provided. |
78+
| `developer-id-installer-certificate` | The `Developer ID Installer` certificate encoded as base64 string. | Required when creating an installer package for macOS application. |
79+
| `developer-id-installer-certificate-password` | The password for the `Developer ID Installer` certificate. | Required if `developer-id-installer-certificate` is provided. |
7380

7481
### outputs
7582

action.yml

Lines changed: 48 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ branding:
55
color: red
66
inputs:
77
xcode-version:
8-
description: The version of Xcode to use for building the Xcode project. Defaults to the active version of Xcode on the runner.
8+
description: The version of Xcode to use for building the Xcode project. Defaults to the [latest version of Xcode on the runner](https://github.com/actions/runner-images#available-images).
99
required: false
1010
default: latest
1111
project-path:
1212
description: The directory that contains the exported xcode project from Unity.
13-
required: true
13+
required: false
1414
app-store-connect-key:
1515
description: The App Store Connect API AuthKey_*.p8 key encoded as base64 string.
1616
required: true
@@ -23,26 +23,38 @@ inputs:
2323
certificate:
2424
description: Exported signing certificate.p12 encoded as base64 string. Overrides the automatic signing in Xcode.
2525
required: false
26+
deprecationMessage: use `manual-signing-certificate` instead.
27+
manual-signing-certificate:
28+
description: Exported signing certificate.p12 encoded as base64 string. Overrides the automatic signing in Xcode.
29+
required: false
2630
certificate-password:
2731
description: The password for the exported certificate. Required if `certificate` is provided.
2832
required: false
33+
deprecationMessage: use `manual-signing-certificate-password` instead.
34+
manual-signing-certificate-password:
35+
description: The password for the exported certificate. Required if `manual-signing-certificate` is provided.
36+
required: false
2937
signing-identity:
30-
description: The signing identity to use for signing the Xcode project. Parsed from the `certificate` if not provided.
38+
description: The signing identity to use for signing the Xcode project. Parsed from the `manual-signing-certificate` if not provided.
39+
required: false
40+
deprecationMessage: use `manual-signing-identity` instead.
41+
manual-signing-identity:
42+
description: The signing identity to use for signing the Xcode project. Parsed from the `manual-signing-certificate` if not provided.
3143
required: false
3244
provisioning-profile:
33-
description: The provisioning profile to use as base64 string. Overrides the automatic signing in Xcode.
45+
description: The provisioning profile to use as base64 string. Use when manually signing the Xcode project.
3446
required: false
3547
provisioning-profile-name:
36-
description: The name of the provisioning profile file, including the type to use for signing the Xcode project. Required if `provisioning-profile` is provided. Must end with either `.mobileprovision` or `.provisionprofile`.
48+
description: The name of the provisioning profile file, including the type to use for signing the Xcode project. Must end with either `.mobileprovision` or `.provisionprofile`. Required if `provisioning-profile` is provided.
3749
required: false
3850
team-id:
39-
description: The team ID to use for signing the Xcode project. Defaults to parsing team ID from `.xcodeproj`.
51+
description: The team ID to use for signing the Xcode project. Defaults to parsing team ID from `manual-signing-certificate` if provided.
4052
required: false
4153
bundle-id:
42-
description: The bundle ID of the Xcode project. Defaults to parsing bundle ID from `.xcodeproj`.
54+
description: The bundle ID of the Xcode project. Overrides the value in the exported Unity project. Defaults to parsing bundle ID from `.xcodeproj`.
4355
required: false
4456
configuration:
45-
description: The configuration to use when building the xcode project. Defaults to `Release`.
57+
description: The configuration to build the Xcode project with. Defaults to `Release`.
4658
required: false
4759
default: 'Release'
4860
scheme:
@@ -52,34 +64,56 @@ inputs:
5264
description: The destination to use when building the xcode project. Defaults to `generic/platform={platform}`.
5365
required: false
5466
platform:
55-
description: The platform to build for. Can be one of `iOS`, `macOS`, `visionOS`, `tvOS`. Defaults to parsing platform from `.xcodeproj`.
67+
description: The platform to build for. Can be one of `iOS`, `macOS`, `tvOS`, `visionOS`. Defaults to parsing platform from `.xcodeproj`.
5668
required: false
5769
platform-sdk-version:
5870
description: The version of the platform SDK to use for building the Xcode project. Defaults to the latest version of the platform SDK defined in the `.xcodeproj`.
5971
required: false
6072
export-option:
61-
description: The export option to use for exporting the Xcode project. Can be one of `app-store-connect`, `steam`, `release-testing`, `package`, `enterprise`, `debugging`, `developer-id`, `mac-application`.
73+
description: The export option to use for exporting the Xcode project. Can be one of `app-store-connect`, `steam`, `release-testing`, `enterprise`, `debugging`, `developer-id`, `mac-application`. Defaults to `development`
6274
required: false
6375
default: development
6476
export-option-plist:
6577
description: The path to custom export option plist file to use when exporting the Xcode project. Overrides `export-option`.
6678
required: false
6779
entitlements-plist:
68-
description: The path to custom entitlements plist file. Generates default hardened runtime entitlements if not provided.
80+
description: The path to custom entitlements plist file. Generates [default hardened runtime entitlements](https://developer.apple.com/documentation/security/hardened-runtime) if not provided.
6981
required: false
7082
notarize:
71-
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`.
83+
description: Whether to notarize the exported Xcode project. Defaults to `true` if `export-option !== app-store-connect`.
84+
required: false
85+
archive-type:
86+
description: The archive type to use when exporting macOS applications when not uploading to the App Store. Can be one of `app` or `pkg`. Defaults to `app`. Forces `app` if `export-option === steam`.
7287
required: false
88+
default: app
7389
upload:
7490
description: Whether to upload the exported Xcode project to App Store Connect. Defaults to `true` if `export-option === app-store-connect`.
7591
required: false
7692
whats-new:
77-
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.'
93+
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 up to 4000 characters.
7894
required: false
7995
auto-increment-build-number:
80-
description: Whether to automatically increment the CFBundleVersion in the Xcode project. Defaults to `true` if `export-option === app-store-connect`.
96+
description: Whether to automatically increment the `CFBundleVersion` in the Xcode project. Defaults to `true` if `export-option === app-store-connect`.
8197
required: false
8298
default: 'true'
99+
test-groups:
100+
description: One or more test groups to automatically add to the build when uploading to TestFlight. When using multiple groups, separate them with commas. None by default.
101+
required: false
102+
submit-for-review:
103+
description: Whether to submit the build for review when uploading to TestFlight. Defaults to `false`.
104+
required: false
105+
developer-id-application-certificate:
106+
description: The `Developer ID Application` certificate encoded as base64 string. Required if `export-option === steam` or `export-option === developer-id` or `notarize === true`.
107+
required: false
108+
developer-id-application-certificate-password:
109+
description: The password for the `Developer ID Application` certificate. Required if `developer-id-application-certificate` is provided.
110+
required: false
111+
developer-id-installer-certificate:
112+
description: The `Developer ID Installer` certificate encoded as base64 string. Required when creating an installer package for macOS application.
113+
required: false
114+
developer-id-installer-certificate-password:
115+
description: The password for the `Developer ID Installer` certificate. Required if `developer-id-installer-certificate` is provided.
116+
required: false
83117
outputs:
84118
executable:
85119
description: The path to the generated archive executable.

0 commit comments

Comments
 (0)