首页 > 解决方案 > GitHub Action iOS CD not show on TestFlight

问题描述

I'm using GitHub Action only and the scripts is running fine, but I don't see the build on TestFlight. Did I miss something in the script? I'm following this tutorial for the setup. Thank you.

Deploying.yml

name: Deploying

on: [push]

jobs:
  deploy:
    name: Deploying to Testflight
    runs-on: macOS-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v1
        
      - name: Install gpg
        run: brew install gnupg
        
      - name: Setup provisioning profile
        env:
          IOS_KEYS: ${{ secrets.IOS_KEYS }}
        run: chmod 755 ./.github/secrets/decrypt_secrets.sh
        
      - name: Archiving project
        env:
          PR_NUMBER: $(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH")
        run: chmod 755 ./.github/scripts/archive_app.sh
        
      - name: Exporting .ipa
        run: chmod 755 ./.github/scripts/export_ipa.sh
        
      - name: Publishing app
        if: success()
        env:
          APPLEID_USERNAME: ${{ secrets.APPLEID_USERNAME }}
          APPLEID_PASSWORD: ${{ secrets.APPLEID_PASSWORD }}
        run: chmod 755 ./.github/scripts/publish_testflight.sh

decrypt_secrets.sh

#!/bin/sh
set -eo pipefail

# Decrypt the files
# --batch to prevent interactive command --yes to assume "yes" for questions
gpg --quiet --batch --yes --decrypt --passphrase="$IOS_KEYS" --output ./.github/secrets/Demo.mobileprovision ./.github/secrets/Demo.mobileprovision.gpg
gpg --quiet --batch --yes --decrypt --passphrase="$IOS_KEYS" --output ./.github/secrets/Certificates.p12 ./.github/secrets/Certificates.p12.gpg

# Install the provisioning profiles
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles

cp ./.github/secrets/Demo.mobileprovision ~/Library/MobileDevice/Provisioning\ Profiles/Demo.mobileprovision  

security create-keychain -p "" build.keychain
security import ./.github/secrets/Certificates.p12 -t agg -k ~/Library/Keychains/build.keychain -P "" -A

# install distribution cert and key
security list-keychains -s ~/Library/Keychains/build.keychain
security default-keychain -s ~/Library/Keychains/build.keychain
security unlock-keychain -p "" ~/Library/Keychains/build.keychain 
security set-key-partition-list -S apple-tool:,apple: -s -k "" ~/Library/Keychains/build.keychain

archive_app.sh

#!/bin/bash

 set -eo pipefail

 xcodebuild  -workspace Demo.xcworkspace \
             -scheme Demo \
             -sdk iphoneos \
             -configuration Release \
             -archivePath $PWD/build/Demo.xcarchive \
             clean archive | xcpretty

export_ipa.sh

#!/bin/bash

set -eo pipefail

xcodebuild -archivePath $PWD/build/Demo.xcarchive \
            -exportOptionsPlist Demo/exportOptions.plist \
            -exportPath $PWD/build \
            -allowProvisioningUpdates \
            -exportArchive | xcpretty

publish_testflight.sh

#!/bin/bash

set -eo pipefail

xcrun altool --upload-app \
             --type ios \
             --file build/Demo.ipa \
             --username "$APPLEID_USERNAME" \
             --password "$APPLEID_PASSWORD" --verbose

Demo/Demo/exportOptions.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>method</key>
    <string>app-store</string>
    <key>uploadBitcode</key>
    <true/>
    <key>uploadSymbols</key>
    <true/>
    <key>provisioningProfiles</key>
    <dict>
        <key>com.app.Demo</key>
        <string>match AppStore com.app.Demo</string>
    </dict>
</dict>
</plist>

enter image description here

标签: iosgithub-actions

解决方案


推荐阅读