Skip to content

Commit 04c0c19

Browse files
- add `auto-increment-build-number` input to auto increment CFBundleVersion - add `platform-runtime-version` input argument to specify a specific runtime sdk
1 parent cfd7dda commit 04c0c19

11 files changed

+371
-215
lines changed

.github/workflows/validate.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,14 @@ 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

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,14 @@ This action requires several secrets that need to be setup in the repository or
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`. |
65-
| `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` |
65+
| `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` |
6667
| `export-option-plist` | The path to custom export option plist file to use when exporting the Xcode project. | Overrides `export-option`. |
6768
| `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. |
68-
| `notarize` | Whether to notarize the exported Xcode project. | Defaults to `true` if `export-option !== app-store`. |
69-
| `upload` | Whether to upload the exported Xcode project to App Store Connect. | Defaults to `true` if `export-option === app-store`. |
69+
| `notarize` | Whether to notarize the exported Xcode project. | Defaults to `true` if `export-option !== app-store-connect`. |
70+
| `upload` | Whether to upload the exported Xcode project to App Store Connect. | Defaults to `true` if `export-option === app-store-connect`. |
7071
| `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`. |
7173

7274
### outputs
7375

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)