Skip to content

Commit c0b82a2

Browse files
unity-xcode-builder@v1.2.0 (#23)
- add `auto-increment-build-number` input to auto increment CFBundleVersion - add `platform-runtime-version` input argument to specify a specific runtime sdk
1 parent eb51a14 commit c0b82a2

File tree

11 files changed

+380
-225
lines changed

11 files changed

+380
-225
lines changed

.github/workflows/validate.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,17 +57,20 @@ jobs:
5757
echo "TEMPLATE_PATH=$templatePath" >> $env:GITHUB_ENV
5858
$projectPath = "${{ github.workspace }}/UnityProject"
5959
echo "UNITY_PROJECT_PATH=$projectPath" >> $env:GITHUB_ENV
60-
$version = $(git tag --sort=-v:refname) | Select-Object -First 1
61-
$version = $version.Substring(1)
60+
61+
# Read version from package.json instead of git tags
62+
$packageJsonPath = "${{ github.workspace }}/package.json"
63+
$packageJson = Get-Content -Raw -Path $packageJsonPath | ConvertFrom-Json
64+
$version = $packageJson.version
65+
6266
if ($version -match '^\d+\.\d+\.\d+$') {
63-
Write-Host "Version: $version"
67+
Write-Host "Version from package.json: $version"
6468
} else {
6569
Write-Host "Version: $version is not a valid version string"
6670
exit 1
6771
}
6872
echo "VERSION=$version" >> $env:GITHUB_ENV
6973
shell: pwsh
70-
# Activates the installation with the provided credentials
7174
- uses: RageAgainstThePixel/activate-unity-license@v1
7275
with:
7376
license: 'Personal'

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,16 @@ This action requires several secrets that need to be setup in the repository or
5858
| `bundle-id` | The bundle ID of the Xcode project. Overrides the value in the exported Unity project. | Defaults to parsing bundle ID from `.xcodeproj`. |
5959
| `configuration` | The configuration to build the Xcode project with. | Defaults to `Release`. |
6060
| `scheme` | The scheme to use when building the xcode project. | false |
61-
| `destination` | The destination to use when building the xcode project. | Defaults to 'generic/platform={platform}'. |
61+
| `destination` | The destination to use when building the xcode project. | Defaults to `generic/platform={platform}`. |
6262
| `platform` | The platform to build for. Can be one of `iOS`, `macOS`, `tvOS`, `visionOS`. | Defaults to parsing platform from `.xcodeproj`. |
63-
| `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` |
63+
| `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`. |
64+
| `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` |
6465
| `export-option-plist` | The path to custom export option plist file to use when exporting the Xcode project. | Overrides `export-option`. |
6566
| `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. |
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`. |
67+
| `notarize` | Whether to notarize the exported Xcode project. | Defaults to `true` if `export-option !== app-store-connect`. |
68+
| `upload` | Whether to upload the exported Xcode project to App Store Connect. | Defaults to `true` if `export-option === app-store-connect`. |
6869
| `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. |
70+
| `auto-increment-build-number` | Whether to automatically increment the CFBundleVersion in the Xcode project. | Defaults to `true` if `export-option === app-store-connect`. |
6971

7072
### outputs
7173

action.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ inputs:
77
xcode-version:
88
description: The version of Xcode to use for building the Xcode project. Defaults to the active version of Xcode on the runner.
99
required: false
10+
default: latest
1011
project-path:
1112
description: The directory that contains the exported xcode project from Unity.
1213
required: true
@@ -53,8 +54,11 @@ inputs:
5354
platform:
5455
description: The platform to build for. Can be one of `iOS`, `macOS`, `visionOS`, `tvOS`. Defaults to parsing platform from `.xcodeproj`.
5556
required: false
57+
platform-sdk-version:
58+
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`.
59+
required: false
5660
export-option:
57-
description: 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`.
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`.
5862
required: false
5963
default: development
6064
export-option-plist:
@@ -67,11 +71,15 @@ inputs:
6771
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`.
6872
required: false
6973
upload:
70-
description: Whether to upload the exported Xcode project to App Store Connect. Defaults to `true` if `export-option === app-store`.
74+
description: Whether to upload the exported Xcode project to App Store Connect. Defaults to `true` if `export-option === app-store-connect`.
7175
required: false
7276
whats-new:
7377
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.'
7478
required: false
79+
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`.
81+
required: false
82+
default: 'true'
7583
outputs:
7684
executable:
7785
description: The path to the generated archive executable.

0 commit comments

Comments
 (0)