Deploy Pre-release #10
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy Pre-release | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| releaseTitle: | |
| description: 'Release title' | |
| required: true | |
| type: string | |
| releaseDescription: | |
| description: 'Release description' | |
| required: false | |
| type: string | |
| env: | |
| DEVELOPER_DIR: /Applications/Xcode_26.5.app | |
| SCHEME_NAME: 'EhPanda' | |
| ALTSTORE_JSON_PATH: './AltStore.json' | |
| BUILDS_PATH: '/tmp/action-builds' | |
| PAYLOAD_PATH: '/tmp/action-builds/Payload' | |
| THIN_PAYLOAD_SCRIPT_PATH: './actions-tool/thin-payload.sh' | |
| ARCHIVE_PATH: '/tmp/action-builds/EhPanda.xcarchive' | |
| IPA_OUTPUT_PATH: '/tmp/action-builds/EhPanda.ipa' | |
| jobs: | |
| Deploy: | |
| runs-on: macos-26 | |
| if: github.event_name == 'workflow_dispatch' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Modify git config | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| - name: Install iOS 26 Platform | |
| uses: nick-fields/retry@v4 | |
| with: | |
| retry_on: error | |
| max_attempts: 10 | |
| timeout_minutes: 999 | |
| command: xcodebuild -downloadPlatform iOS | |
| - name: Show Xcode version | |
| run: xcodebuild -version | |
| - name: Run tests | |
| run: xcodebuild clean test | |
| -skipMacroValidation | |
| -skipPackagePluginValidation | |
| -scheme ${{ env.SCHEME_NAME }} | |
| -destination 'platform=iOS Simulator,name=iPhone Air' | |
| - name: Xcode archive | |
| run: xcodebuild archive | |
| -skipMacroValidation | |
| -skipPackagePluginValidation | |
| -scheme ${{ env.SCHEME_NAME }} | |
| -destination 'generic/platform=iOS' | |
| -archivePath ${{ env.ARCHIVE_PATH }} | |
| CODE_SIGN_IDENTITY= | |
| CODE_SIGN_ENTITLEMENTS= | |
| CODE_SIGNING_ALLOWED=NO | |
| CODE_SIGNING_REQUIRED=NO | |
| GCC_OPTIMIZATION_LEVEL=s | |
| SWIFT_OPTIMIZATION_LEVEL=-O | |
| - name: Export .ipa file | |
| run: | | |
| mkdir -p ${{ env.PAYLOAD_PATH }} | |
| mv ${{ env.ARCHIVE_PATH }}/Products/Applications/${{ env.SCHEME_NAME }}.app ${{ env.PAYLOAD_PATH }}/${{ env.SCHEME_NAME }}.app | |
| sh ${{ env.THIN_PAYLOAD_SCRIPT_PATH }} ${{ env.PAYLOAD_PATH }}/${{ env.SCHEME_NAME }}.app | |
| pushd ${{ env.BUILDS_PATH }} | |
| zip -r ${{ env.IPA_OUTPUT_PATH }} ./Payload | |
| popd | |
| - name: Retrieve data | |
| id: retrieve-data | |
| run: | | |
| app_info_plist="$PAYLOAD_PATH/$SCHEME_NAME.app/Info.plist" | |
| version="$(plutil -extract CFBundleShortVersionString raw -o - "$app_info_plist")" | |
| size="$(stat -f%z "$IPA_OUTPUT_PATH")" | |
| [[ ! -z "$version" ]] || exit 1 | |
| [[ ! -z "$size" ]] || exit 1 | |
| { | |
| echo "size=$size" | |
| echo "version=$version" | |
| echo "version_date=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" | |
| } >> "$GITHUB_OUTPUT" | |
| - name: Validate data | |
| env: | |
| RELEASE_TITLE: ${{ inputs.releaseTitle }} | |
| RELEASE_SIZE: ${{ steps.retrieve-data.outputs.size }} | |
| RELEASE_VERSION: ${{ steps.retrieve-data.outputs.version }} | |
| RELEASE_DATE: ${{ steps.retrieve-data.outputs.version_date }} | |
| run: | | |
| [[ ! -z "$RELEASE_TITLE" ]] || exit 1 | |
| [[ ! -z "$RELEASE_SIZE" ]] || exit 1 | |
| [[ ! -z "$RELEASE_VERSION" ]] || exit 1 | |
| [[ ! -z "$RELEASE_DATE" ]] || exit 1 | |
| - name: Release to GitHub | |
| uses: softprops/action-gh-release@v3 | |
| with: | |
| prerelease: true | |
| fail_on_unmatched_files: true | |
| files: ${{ env.IPA_OUTPUT_PATH }} | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| name: ${{ inputs.releaseTitle }} | |
| body: ${{ inputs.releaseDescription || '' }} | |
| tag_name: ${{ steps.retrieve-data.outputs.version }} |