Merge pull request #568 from kiwix/appstore-release-only

only upload to Apple upon releases
This commit is contained in:
rgaudin 2023-11-28 11:01:52 +00:00 committed by GitHub
commit d28874bc8e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -56,7 +56,11 @@ jobs:
version = str(datetime.date.today())
upload_folder = f"nightly/{version}"
export_method = "developer-id" if os.getenv("UPLOAD_TO") == "dmg" else "app-store"
upload_to = os.getenv("UPLOAD_TO")
export_method = "developer-id" if upload_to == "dmg" else "app-store"
upload_to_apple = True
if not is_release and upload_to == "app-store":
upload_to_apple = False
extra_xcode = os.getenv("EXTRA_XCODEBUILD", "")
if os.getenv("PLATFORM") == "iOS":
@ -70,6 +74,7 @@ jobs:
fh.write(f"EXPORT_METHOD={export_method}\n")
fh.write(f"UPLOAD_FOLDER={upload_folder}\n")
fh.write(f"EXTRA_XCODEBUILD={extra_xcode}\n")
fh.write(f"UPLOAD_TO_APPLE={'yes' if upload_to_apple else ''}\n")
- name: Prepare use of Developper ID Certificate
if: ${{ matrix.destination.uploadto == 'dmg' }}
@ -164,6 +169,7 @@ jobs:
plutil -replace provisioningProfiles -json '{ "self.Kiwix" : "iOS Team Provisioning Profile" }' ./export.plist
- name: Upload Archive to Apple (App Store or Notarization)
if: ${{ env.UPLOAD_TO_APPLE }}
env:
APPLE_STORE_AUTH_KEY_PATH: ${{ env.APPLE_STORE_AUTH_KEY_PATH }}
APPLE_STORE_AUTH_KEY_ID: ${{ secrets.APPLE_STORE_AUTH_KEY_ID }}
@ -191,6 +197,7 @@ jobs:
xcrun stapler staple $PWD/kiwix-$VERSION.dmg
- name: Add SSH_KEY to filesystem
if: ${{ matrix.destination.uploadto == 'dmg' || matrix.destination.uploadto == 'ipa' }}
shell: bash
env:
PRIVATE_KEY: ${{ secrets.SSH_KEY }}