codemagic-ci-cd / cli-tools

Various utilities to managing Android and iOS app builds, code signing, and deployment.
https://codemagic.io/start/
GNU General Public License v3.0
243 stars 42 forks source link

Add support for publishing macOS builds to TestFlight and App Store #340

Closed nilsreichardt closed 12 months ago

nilsreichardt commented 1 year ago

Closes #339

Action app-store-connect publish can be used to upload iOS and macOS application packages (ipa and pkg files respectively) to App Store Connect. At the time of initial implementation, TestFlight beta distribution was not supported for macOS applications and as such using --testflight option when publishing macOS packages is just ignored and has no effect.

Changes proposed here remove this limitation as TestFlight beta distribution for macOS apps has been supported for quite some time already. However, as Apple's processing procedure of macOS packages differs slightly from iOS packages, it became necessary to also modify the method that waits until build processing completes. For iOS it will suffice to just wait until build's processingState attribute is not PROCESSING any more. But behaviour for macOS apps is slightly different as beta details associated with the build might still be processed after that point. Hence BuildsActionGroup.wait_until_build_is_processed was updated to accommodate that.

Necessary App Store Connect API client method and object mappings for dealing with BuildBetaDetail were added along with new action to show beta detail info for given build:

app-store-connect builds beta-details usage ```shell $ app-store-connect builds beta-details "3bf3e846-3d31-4e1e-ab0f-0834fb9f9a26" Get Build Beta Details for Build 3bf3e846-3d31-4e1e-ab0f-0834fb9f9a26 -- Build Beta Detail -- Id: 3bf3e846-3d31-4e1e-ab0f-0834fb9f9a26 Type: buildBetaDetails Auto notify enabled: True External build state: EXPIRED Internal build state: EXPIRED ```

Updated actions

New actions

nilsreichardt commented 1 year ago

Unfortunately, does not work:

...

No errors uploading "Sharezone.pkg".

Find application entry from App Store Connect for uploaded binary
Found 1 App matching specified filters: bundleId=de.codingbrain.sharezone.app.
-- App --
Id: 1434868489

Type: apps
Bundle id: de.codingbrain.sharezone.app
Find uploaded build
Name: Sharezone - Schulplaner
Primary locale: de-DE
Sku: de.codingbrain.sharezone.app
Available in new territories: True
Content rights declaration: DOES_NOT_USE_THIRD_PARTY_CONTENT
Is or ever was made for kids: False

-- Build --
Uploaded build is
Id: c257b541-78c2-4cef-a41a-1ecd1e5cb0bf

Type: builds
Update beta build localization info in TestFlight for uploaded build
Expired: False
Icon asset token: 
    Template url: https://is4-ssl.mzstatic.com/image/thumb/Purple[126](https://github.com/SharezoneApp/sharezone-app/actions/runs/5986022160/job/16238714652#step:12:127)/v4/94/e0/8b/94e08b87-4f9d-fd29-797c-87ea3f30ef1b/AppIcon-0-0-2x_U007epad-0-0-0-8-0-0-sRGB-0-0-0-GLES2_U002c0-512MB-85-220-0-0.png/{w}x{h}bb.{f}
    Height: 167
    Width: 167
Min os version: 12.0
Processing state: VALID
Version: 470
Uses non exempt encryption: False
Uploaded date: 2023-08-21 11:44:25-07:00
Expiration date: 2023-11-19 11:44:25-08:00
Using application Sharezone - Schulplaner primary locale de-DE for beta build localization
Modify Beta Build Localization a72dbbe3-4907-4cd3-9106-6f6bffd62cbf
Successfully modified Beta Build Localization a72dbbe3-4907-4cd3-9106-6f6bffd62cbf
-- Beta Build Localization --
Id: a72dbbe3-4907-4cd3-9106-6f6bffd62cbf

Type: betaBuildLocalizations
Submit build 'c257b541-78c2-4cef-a41a-1ecd1e5cb0bf' to TestFlight beta review
Locale: de-DE
Whats new: Merge 98ac55c453f2442f9d692eb37a928ecbe2dd6d6e into e3c7ca68be1d310adb8408be4b34c61ced720e0b
Creating new Beta App Review Submission: build: c257b541-78c2-4cef-a41a-1ecd1e5cb0bf
POST https://api.appstoreconnect.apple.com/v1/betaAppReviewSubmissions returned 422: The build is not in a valid processing state for this operation. - The build is not in a valid processing state for this operation.
Failed to publish Sharezone.pkg

The build returned Processing state: VALID what seems to be wrong. Then the CLI tried to submit to TestFlight instantly without waiting to process the build.

Any ideas to fix this?

priitlatt commented 1 year ago

Hi @nilsreichardt, in principle the changes you've proposed look good, but perhaps there is something with the build that we fail to see. Could you please share the output of

app-store-connect builds get c257b541-78c2-4cef-a41a-1ecd1e5cb0bf --log-api-calls

with me so that I could see all the details of said build.

nilsreichardt commented 1 year ago

Hi @priitlatt, thanks for your review! Here are the logs:

$ app-store-connect builds get c257b541-78c2-4cef-a41a-1ecd1e5cb0bf --log-api-calls
Get Build c257b541-78c2-4cef-a41a-1ecd1e5cb0bf
>>> GET https://api.appstoreconnect.apple.com/v1/builds/c257b541-78c2-4cef-a41a-1ecd1e5cb0bf None
<<< 200 {'data': {'type': 'builds', 'id': 'c257b541-78c2-4cef-a41a-1ecd1e5cb0bf', 'attributes': {'version': '470', 'uploadedDate': '2023-08-21T11:44:25-07:00', 'expirationDate': '2023-11-19T11:44:25-08:00', 'expired': False, 'minOsVersion': '12.0', 'lsMinimumSystemVersion': None, 'computedMinMacOsVersion': '11.0', 'computedMinVisionOsVersion': '1.0', 'computedMinRealityOsVersion': '1.0', 'iconAssetToken': {'templateUrl': 'https://is4-ssl.mzstatic.com/image/thumb/Purple126/v4/94/e0/8b/94e08b87-4f9d-fd29-797c-87ea3f30ef1b/AppIcon-0-0-2x_U007epad-0-0-0-8-0-0-sRGB-0-0-0-GLES2_U002c0-512MB-85-220-0-0.png/{w}x{h}bb.{f}', 'width': 167, 'height': 167}, 'processingState': 'VALID', 'buildAudienceType': 'APP_STORE_ELIGIBLE', 'usesNonExemptEncryption': False}, 'relationships': {'preReleaseVersion': {'links': {'self': 'https://api.appstoreconnect.apple.com/v1/builds/c257b541-78c2-4cef-a41a-1ecd1e5cb0bf/relationships/preReleaseVersion', 'related': 'https://api.appstoreconnect.apple.com/v1/builds/c257b541-78c2-4cef-a41a-1ecd1e5cb0bf/preReleaseVersion'}}, 'individualTesters': {'links': {'self': 'https://api.appstoreconnect.apple.com/v1/builds/c257b541-78c2-4cef-a41a-1ecd1e5cb0bf/relationships/individualTesters', 'related': 'https://api.appstoreconnect.apple.com/v1/builds/c257b541-78c2-4cef-a41a-1ecd1e5cb0bf/individualTesters'}}, 'betaGroups': {'links': {'self': 'https://api.appstoreconnect.apple.com/v1/builds/c257b541-78c2-4cef-a41a-1ecd1e5cb0bf/relationships/betaGroups'}}, 'betaBuildLocalizations': {'links': {'self': 'https://api.appstoreconnect.apple.com/v1/builds/c257b541-78c2-4cef-a41a-1ecd1e5cb0bf/relationships/betaBuildLocalizations', 'related': 'https://api.appstoreconnect.apple.com/v1/builds/c257b541-78c2-4cef-a41a-1ecd1e5cb0bf/betaBuildLocalizations'}}, 'appEncryptionDeclaration': {'links': {'self': 'https://api.appstoreconnect.apple.com/v1/builds/c257b541-78c2-4cef-a41a-1ecd1e5cb0bf/relationships/appEncryptionDeclaration', 'related': 'https://api.appstoreconnect.apple.com/v1/builds/c257b541-78c2-4cef-a41a-1ecd1e5cb0bf/appEncryptionDeclaration'}}, 'betaAppReviewSubmission': {'links': {'self': 'https://api.appstoreconnect.apple.com/v1/builds/c257b541-78c2-4cef-a41a-1ecd1e5cb0bf/relationships/betaAppReviewSubmission', 'related': 'https://api.appstoreconnect.apple.com/v1/builds/c257b541-78c2-4cef-a41a-1ecd1e5cb0bf/betaAppReviewSubmission'}}, 'app': {'links': {'self': 'https://api.appstoreconnect.apple.com/v1/builds/c257b541-78c2-4cef-a41a-1ecd1e5cb0bf/relationships/app', 'related': 'https://api.appstoreconnect.apple.com/v1/builds/c257b541-78c2-4cef-a41a-1ecd1e5cb0bf/app'}}, 'buildBetaDetail': {'links': {'self': 'https://api.appstoreconnect.apple.com/v1/builds/c257b541-78c2-4cef-a41a-1ecd1e5cb0bf/relationships/buildBetaDetail', 'related': 'https://api.appstoreconnect.apple.com/v1/builds/c257b541-78c2-4cef-a41a-1ecd1e5cb0bf/buildBetaDetail'}}, 'appStoreVersion': {'links': {'self': 'https://api.appstoreconnect.apple.com/v1/builds/c257b541-78c2-4cef-a41a-1ecd1e5cb0bf/relationships/appStoreVersion', 'related': 'https://api.appstoreconnect.apple.com/v1/builds/c257b541-78c2-4cef-a41a-1ecd1e5cb0bf/appStoreVersion'}}, 'icons': {'links': {'self': 'https://api.appstoreconnect.apple.com/v1/builds/c257b541-78c2-4cef-a41a-1ecd1e5cb0bf/relationships/icons', 'related': 'https://api.appstoreconnect.apple.com/v1/builds/c257b541-78c2-4cef-a41a-1ecd1e5cb0bf/icons'}}, 'perfPowerMetrics': {'links': {'related': 'https://api.appstoreconnect.apple.com/v1/builds/c257b541-78c2-4cef-a41a-1ecd1e5cb0bf/perfPowerMetrics'}}, 'diagnosticSignatures': {'links': {'self': 'https://api.appstoreconnect.apple.com/v1/builds/c257b541-78c2-4cef-a41a-1ecd1e5cb0bf/relationships/diagnosticSignatures', 'related': 'https://api.appstoreconnect.apple.com/v1/builds/c257b541-78c2-4cef-a41a-1ecd1e5cb0bf/diagnosticSignatures'}}}, 'links': {'self': 'https://api.appstoreconnect.apple.com/v1/builds/c257b541-78c2-4cef-a41a-1ecd1e5cb0bf'}}, 'links': {'self': 'https://api.appstoreconnect.apple.com/v1/builds/c257b541-78c2-4cef-a41a-1ecd1e5cb0bf'}}
-- Build --
Id: c257b541-78c2-4cef-a41a-1ecd1e5cb0bf
Type: builds
Expired: False
Icon asset token: 
    Template url: https://is4-ssl.mzstatic.com/image/thumb/Purple126/v4/94/e0/8b/94e08b87-4f9d-fd29-797c-87ea3f30ef1b/AppIcon-0-0-2x_U007epad-0-0-0-8-0-0-sRGB-0-0-0-GLES2_U002c0-512MB-85-220-0-0.png/{w}x{h}bb.{f}
    Height: 167
    Width: 167
Min os version: 12.0
Processing state: VALID
Version: 470
Uses non exempt encryption: False
Uploaded date: 2023-08-21 11:44:25-07:00
Expiration date: 2023-11-19 11:44:25-08:00

Here is the JSON from the logs in a formatted format:

{
    "data": {
        "type": "builds",
        "id": "c257b541-78c2-4cef-a41a-1ecd1e5cb0bf",
        "attributes": {
            "version": "470",
            "uploadedDate": "2023-08-21T11:44:25-07:00",
            "expirationDate": "2023-11-19T11:44:25-08:00",
            "expired": false,
            "minOsVersion": "12.0",
            "lsMinimumSystemVersion": null,
            "computedMinMacOsVersion": "11.0",
            "computedMinVisionOsVersion": "1.0",
            "computedMinRealityOsVersion": "1.0",
            "iconAssetToken": {
                "templateUrl": "https://is4-ssl.mzstatic.com/image/thumb/Purple126/v4/94/e0/8b/94e08b87-4f9d-fd29-797c-87ea3f30ef1b/AppIcon-0-0-2x_U007epad-0-0-0-8-0-0-sRGB-0-0-0-GLES2_U002c0-512MB-85-220-0-0.png/{w}x{h}bb.{f}",
                "width": 167,
                "height": 167
            },
            "processingState": "VALID",
            "buildAudienceType": "APP_STORE_ELIGIBLE",
            "usesNonExemptEncryption": false
        },
        "relationships": {
            "preReleaseVersion": {
                "links": {
                    "self": "https://api.appstoreconnect.apple.com/v1/builds/c257b541-78c2-4cef-a41a-1ecd1e5cb0bf/relationships/preReleaseVersion",
                    "related": "https://api.appstoreconnect.apple.com/v1/builds/c257b541-78c2-4cef-a41a-1ecd1e5cb0bf/preReleaseVersion"
                }
            },
            "individualTesters": {
                "links": {
                    "self": "https://api.appstoreconnect.apple.com/v1/builds/c257b541-78c2-4cef-a41a-1ecd1e5cb0bf/relationships/individualTesters",
                    "related": "https://api.appstoreconnect.apple.com/v1/builds/c257b541-78c2-4cef-a41a-1ecd1e5cb0bf/individualTesters"
                }
            },
            "betaGroups": {
                "links": {
                    "self": "https://api.appstoreconnect.apple.com/v1/builds/c257b541-78c2-4cef-a41a-1ecd1e5cb0bf/relationships/betaGroups"
                }
            },
            "betaBuildLocalizations": {
                "links": {
                    "self": "https://api.appstoreconnect.apple.com/v1/builds/c257b541-78c2-4cef-a41a-1ecd1e5cb0bf/relationships/betaBuildLocalizations",
                    "related": "https://api.appstoreconnect.apple.com/v1/builds/c257b541-78c2-4cef-a41a-1ecd1e5cb0bf/betaBuildLocalizations"
                }
            },
            "appEncryptionDeclaration": {
                "links": {
                    "self": "https://api.appstoreconnect.apple.com/v1/builds/c257b541-78c2-4cef-a41a-1ecd1e5cb0bf/relationships/appEncryptionDeclaration",
                    "related": "https://api.appstoreconnect.apple.com/v1/builds/c257b541-78c2-4cef-a41a-1ecd1e5cb0bf/appEncryptionDeclaration"
                }
            },
            "betaAppReviewSubmission": {
                "links": {
                    "self": "https://api.appstoreconnect.apple.com/v1/builds/c257b541-78c2-4cef-a41a-1ecd1e5cb0bf/relationships/betaAppReviewSubmission",
                    "related": "https://api.appstoreconnect.apple.com/v1/builds/c257b541-78c2-4cef-a41a-1ecd1e5cb0bf/betaAppReviewSubmission"
                }
            },
            "app": {
                "links": {
                    "self": "https://api.appstoreconnect.apple.com/v1/builds/c257b541-78c2-4cef-a41a-1ecd1e5cb0bf/relationships/app",
                    "related": "https://api.appstoreconnect.apple.com/v1/builds/c257b541-78c2-4cef-a41a-1ecd1e5cb0bf/app"
                }
            },
            "buildBetaDetail": {
                "links": {
                    "self": "https://api.appstoreconnect.apple.com/v1/builds/c257b541-78c2-4cef-a41a-1ecd1e5cb0bf/relationships/buildBetaDetail",
                    "related": "https://api.appstoreconnect.apple.com/v1/builds/c257b541-78c2-4cef-a41a-1ecd1e5cb0bf/buildBetaDetail"
                }
            },
            "appStoreVersion": {
                "links": {
                    "self": "https://api.appstoreconnect.apple.com/v1/builds/c257b541-78c2-4cef-a41a-1ecd1e5cb0bf/relationships/appStoreVersion",
                    "related": "https://api.appstoreconnect.apple.com/v1/builds/c257b541-78c2-4cef-a41a-1ecd1e5cb0bf/appStoreVersion"
                }
            },
            "icons": {
                "links": {
                    "self": "https://api.appstoreconnect.apple.com/v1/builds/c257b541-78c2-4cef-a41a-1ecd1e5cb0bf/relationships/icons",
                    "related": "https://api.appstoreconnect.apple.com/v1/builds/c257b541-78c2-4cef-a41a-1ecd1e5cb0bf/icons"
                }
            },
            "perfPowerMetrics": {
                "links": {
                    "related": "https://api.appstoreconnect.apple.com/v1/builds/c257b541-78c2-4cef-a41a-1ecd1e5cb0bf/perfPowerMetrics"
                }
            },
            "diagnosticSignatures": {
                "links": {
                    "self": "https://api.appstoreconnect.apple.com/v1/builds/c257b541-78c2-4cef-a41a-1ecd1e5cb0bf/relationships/diagnosticSignatures",
                    "related": "https://api.appstoreconnect.apple.com/v1/builds/c257b541-78c2-4cef-a41a-1ecd1e5cb0bf/diagnosticSignatures"
                }
            }
        },
        "links": {
            "self": "https://api.appstoreconnect.apple.com/v1/builds/c257b541-78c2-4cef-a41a-1ecd1e5cb0bf"
        }
    }
}
nilsreichardt commented 1 year ago

With my fix in https://github.com/codemagic-ci-cd/cli-tools/pull/340/commits/680427aeda599eda3fbf82f6d144b4500bfc042b it processes the build. However, I'm still getting an error when submitting for TestFlight:

POST https://api.appstoreconnect.apple.com/v1/betaAppReviewSubmissions returned 422: The build is not in state for internal testing. - Build is not in internal testing state.

Any ideas?

Full logs:

...

No errors uploading "Sharezone.pkg".

Find application entry from App Store Connect for uploaded binary
2023-09-04 16:40:18.635  INFO: [ContentDelivery.Uploader] COMPLETED - PART 2 - Sharezone.pkg - eTag: "59559975A7D28F[58](https://github.com/SharezoneApp/sharezone-app/actions/runs/6075795380/job/16482675989#step:12:59)65A305A8996B42B7"
2023-09-04 16:40:18.917  INFO: [ContentDelivery.Uploader] COMPLETED - PART 5 - Sharezone.pkg - eTag: "A66CF29CB0D9F243CEA831BB3C982086"
2023-09-04 16:40:18.939  INFO: [ContentDelivery.Uploader] COMPLETED - PART 6 - Sharezone.pkg - eTag: "6CDB8[59](https://github.com/SharezoneApp/sharezone-app/actions/runs/6075795380/job/16482675989#step:12:60)BD2ED712C56FEA1AEB71467CB"
2023-09-04 16:40:19.111  INFO: [ContentDelivery.Uploader] COMPLETED - PART 3 - Sharezone.pkg - eTag: "D9318105496305C3EDEE5064E040AA8C"
2023-09-04 16:40:19.288  INFO: [ContentDelivery.Uploader] COMPLETED - PART 9 - Sharezone.pkg - eTag: "1480EE6C971AAEC8322F4B93C9210C97"
2023-09-04 16:40:19.554  INFO: [ContentDelivery.Uploader] COMPLETED - PART 10 - Sharezone.pkg - eTag: "1B3AB719B646ABEC612D79FAAB5785A1"
2023-09-04 16:40:19.558  INFO: [ContentDelivery.Uploader] Time to transfer: 2.234 seconds (23444.39KB/s)
2023-09-04 16:40:20.822  INFO: [ContentDelivery.Uploader] 
================
UPLOAD SUCCEEDED
Delivery UUID: 4d5a1cad-1217-43b4-b284-b98f79b1fe4d
Transferred 52364914 bytes in 2.234 seconds (23.4MB/s)
================
{"tool-version":"6.315.14315","tool-path":"\/Applications\/Xcode_14.3.1.app\/Contents\/SharedFrameworks\/ContentDeliveryServices.framework\/Versions\/A\/Frameworks\/AppStoreService.framework","success-message":"No errors uploading 'Sharezone.pkg'","os-version":"13.5.1"}

Found 1 App matching specified filters: bundleId=de.codingbrain.sharezone.app.
-- App --
Id: 1434868489

Find uploaded build
Type: apps
Bundle id: de.codingbrain.sharezone.app
Name: Sharezone - Schulplaner
Primary locale: de-DE
Sku: de.codingbrain.sharezone.app
Available in new territories: True
Content rights declaration: DOES_NOT_USE_THIRD_PARTY_CONTENT
Is or ever was made for kids: False
Build has finished uploading but is processing on App Store Connect side. Could not find the build matching the uploaded version yet. Waiting 30 seconds to try again, 20 attempts remaining.
Build has finished uploading but is processing on App Store Connect side. Could not find the build matching the uploaded version yet. Waiting 30 seconds to try again, 19 attempts remaining.
Build has finished uploading but is processing on App Store Connect side. Could not find the build matching the uploaded version yet. Waiting 30 seconds to try again, 18 attempts remaining.
Build has finished uploading but is processing on App Store Connect side. Could not find the build matching the uploaded version yet. Waiting 30 seconds to try again, 17 attempts remaining.
Build has finished uploading but is processing on App Store Connect side. Could not find the build matching the uploaded version yet. Waiting 30 seconds to try again, 16 attempts remaining.
Build has finished uploading but is processing on App Store Connect side. Could not find the build matching the uploaded version yet. Waiting 30 seconds to try again, 15 attempts remaining.
Build has finished uploading but is processing on App Store Connect side. Could not find the build matching the uploaded version yet. Waiting 30 seconds to try again, 14 attempts remaining.
Build has finished uploading but is processing on App Store Connect side. Could not find the build matching the uploaded version yet. Waiting 30 seconds to try again, 13 attempts remaining.
Build has finished uploading but is processing on App Store Connect side. Could not find the build matching the uploaded version yet. Waiting 30 seconds to try again, 12 attempts remaining.
Build has finished uploading but is processing on App Store Connect side. Could not find the build matching the uploaded version yet. Waiting 30 seconds to try again, 11 attempts remaining.
Build has finished uploading but is processing on App Store Connect side. Could not find the build matching the uploaded version yet. Waiting 30 seconds to try again, 10 attempts remaining.
Build has finished uploading but is processing on App Store Connect side. Could not find the build matching the uploaded version yet. Waiting 30 seconds to try again, 9 attempts remaining.
Build has finished uploading but is processing on App Store Connect side. Could not find the build matching the uploaded version yet. Waiting 30 seconds to try again, 8 attempts remaining.
Build has finished uploading but is processing on App Store Connect side. Could not find the build matching the uploaded version yet. Waiting 30 seconds to try again, 7 attempts remaining.
Build has finished uploading but is processing on App Store Connect side. Could not find the build matching the uploaded version yet. Waiting 30 seconds to try again, 6 attempts remaining.

Uploaded build is
-- Build --
Id: 4d5a1cad-1217-43b4-b284-b98f79b1fe4d
Type: builds
Expired: False
Icon asset token: 
    Template url: https://is1-ssl.mzstatic.com/image/thumb/Purple116/v4/a6/f8/b7/a6f8b7c0-a80e-c152-02f9-45f136989459/AppIcon.icns/{w}x{h}bb.{f}
    Height: 256
    Width: 256
Min os version: 10.14
Processing state: VALID
Version: 483
Uses non exempt encryption: False
Uploaded date: 2023-09-04 09:47:53-07:00
Expiration date: 2023-12-03 09:47:53-08:00

Update beta build localization info in TestFlight for uploaded build
Using application Sharezone - Schulplaner primary locale de-DE for beta build localization
Modify Beta Build Localization 8adc0de8-8e[60](https://github.com/SharezoneApp/sharezone-app/actions/runs/6075795380/job/16482675989#step:12:61)-4b17-8e4c-75fe7b39d438
Successfully modified Beta Build Localization 8adc0de8-8e60-4b17-8e4c-75fe7b39d438
-- Beta Build Localization --
Id: 8adc0de8-8e60-4b17-8e4c-75fe7b39d438
Type: betaBuildLocalizations
Locale: de-DE
Whats new: Merge 4b3c4555c31b80d385dd2a3a9c1f7ad965bcb4fe into 51fcd6fd9[63](https://github.com/SharezoneApp/sharezone-app/actions/runs/6075795380/job/16482675989#step:12:64)1011cdd7f17cb2ffe208df1a92447

Submit build '4d5a1cad-1217-43b4-b284-b98f[79](https://github.com/SharezoneApp/sharezone-app/actions/runs/6075795380/job/16482675989#step:12:80)b1fe4d' to TestFlight beta review
Creating new Beta App Review Submission: build: 4d5a1cad-1217-43b4-b2[84](https://github.com/SharezoneApp/sharezone-app/actions/runs/6075795380/job/16482675989#step:12:85)-b[98](https://github.com/SharezoneApp/sharezone-app/actions/runs/6075795380/job/16482675989#step:12:99)f79b1fe4d
POST https://api.appstoreconnect.apple.com/v1/betaAppReviewSubmissions returned 422: The build is not in state for internal testing. - Build is not in internal testing state.
Failed to publish Sharezone.pkg
Error: Process completed with exit code 1.
priitlatt commented 1 year ago

Now this looks very similar to what is described in this (rather old) Fastlane issue: https://github.com/fastlane/fastlane/issues/14033, that sadly has no resolution whatsoever. From a more recent time, this thread on Apple Developer Forum looks somewhat related. But this too does not have any answers either.

What does App Store Connect UI tell you about this specific build? Maybe there are some hints there?

nilsreichardt commented 1 year ago

The App Store Connect UI says "Processing" while the CLI thought it has been processed.

App Store Connect UI:

Screenshot 2023-09-06 at 14 54 32

Logs:

image

When manually submitting the build to TestFlight, the changelog (what's new) was already filled out.

image
priitlatt commented 1 year ago

The App Store Connect UI says "Processing" while the CLI thought it has been processed.

This is some great intel! I'll try to reproduce this on my end here and get back to you as soon as I have something or need further details from you.

priitlatt commented 1 year ago

I managed to reproduce the exact same result - API response reports that build is already processed, but in UI (and in practice I presume) it is still shown as processing. I'll try to come up with some additional checks that could be used to ensure that the processing is truly completed.

nilsreichardt commented 1 year ago

Cool, thanks! <3

priitlatt commented 1 year ago

@nilsreichardt Please include changes from ~#341~ #343 to your PR and give it another go.

nilsreichardt commented 1 year ago

@nilsreichardt Please include changes from #341 to your PR and give it another go.

Thanks! I mean #343, right? :D

I started a new build: https://github.com/SharezoneApp/sharezone-app/actions/runs/6111211832/job/16585932191?pr=827. Let's see 🀞

priitlatt commented 1 year ago

Of course, you are right, I meant #343. Sorry for the typo.

nilsreichardt commented 1 year ago

Yes, that worked! πŸŽ‰

Logs:

image

Screenshot from App Store Connect (build number 489):

image
nilsreichardt commented 1 year ago

@priitlatt Let me know, if should change something πŸ‘

Btw: props for the code quality, I could easily understand and modify the code without knowing how to write Python code πŸ‘

priitlatt commented 1 year ago

First and foremost, thanks for the contribution!

I'll take another look at it tomorrow and let you know if there is anything else that needs to be changed, or we can move on with release procedure.

nilsreichardt commented 12 months ago

If you don't mind I'll update the PR description myself to highlight all the things that were modified and added.

Yes, feel free to modify the PR description and code as you like πŸ‘

priitlatt commented 12 months ago

Just out of interested: Codemagic already supports publishing macOS apps to TestFlight?

I'm afraid something must have been lost in communication and the quoted statement is overly ambitious :|

nilsreichardt commented 12 months ago

I'm afraid something must have been lost in communication and the quoted statement is overly ambitious :|

Yeah, I was wondering that too, because if Codemagic already supported this, they would have to use something other than the app-store-connect CLI πŸ€” However, I think when this release becomes stable and the Codemagic machines update to the new CLI version it should support uploading macOS apps to TestFlight without changing anything (assuming that Codemagic doesn't block macOS uploads before using app-store-connect) πŸ‘