Skip to content

Build project IOS

Build project IOS #6

Workflow file for this run

name: Build project IOS
on: [workflow_dispatch]
jobs:
buildForAllSupportedPlatforms:
name: Build for ${{ matrix.targetPlatform }} on ${{ matrix.unityVersion }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
unity-version:
- 2021.3.22f1
os:
- ubuntu-latest
targetPlatform:
- iOS # Build an iOS player.
steps:
###########################
# Checkout #
###########################
- uses: actions/checkout@v4
with:
fetch-depth: 0
lfs: true
###########################
# Cache #
###########################
- uses: actions/cache@v3
with:
path: Library
key: Library-${{ matrix.targetPlatform }}
restore-keys: Library-
###########################
# Disk #
###########################
- if: matrix.targetPlatform == 'Android'
uses: jlumbroso/[email protected]
###########################
# Build #
###########################
- uses: game-ci/unity-builder@v4
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
targetPlatform: ${{ matrix.targetPlatform }}
###########################
# Upload #
###########################
- uses: actions/upload-artifact@v3
with:
name: Build-${{ matrix.targetPlatform }}
path: build/${{ matrix.targetPlatform }}
releaseToAppStore:
name: Release to the App Store
runs-on: macos-latest
needs: buildForAllSupportedPlatforms
strategy:
matrix:
targetPlatform:
- iOS # Build an iOS player.
steps:
###########################
# Checkout #
###########################
- name: Checkout Repository
uses: actions/checkout@v4
###########################
# Download iOS Artifact #
###########################
- name: Download iOS Artifact
uses: actions/download-artifact@v3
with:
name: Build-${{ matrix.targetPlatform }}
path: build/${{ matrix.targetPlatform }}
###########################################
# Fix File Permissions and Run fastlane #
###########################################
- name: Fix File Permissions and Run fastlane
env:
APPLE_CONNECT_EMAIL: ${{ secrets.APPLE_CONNECT_EMAIL }}
APPLE_DEVELOPER_EMAIL: ${{ secrets.APPLE_DEVELOPER_EMAIL }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
MATCH_REPOSITORY: ${{ secrets.MATCH_REPOSITORY }}
MATCH_DEPLOY_KEY: ${{ secrets.MATCH_DEPLOY_KEY }}
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
APPSTORE_ISSUER_ID: ${{ secrets.APPSTORE_ISSUER_ID }}
APPSTORE_KEY_ID: ${{ secrets.APPSTORE_KEY_ID }}
APPSTORE_P8: ${{ secrets.APPSTORE_P8 }}
IOS_BUILD_PATH: ${{ format('{0}/build/iOS', github.workspace) }}
IOS_BUNDLE_ID: com.TestCIRealProject.TestCIRealProject # Change it to match your Unity bundle id
PROJECT_NAME: TestCIRealProject # Change it to match your project's name
run: |
eval "$(ssh-agent -s)"
ssh-add - <<< "${MATCH_DEPLOY_KEY}"
find $IOS_BUILD_PATH -type f -name "**.sh" -exec chmod +x {} \;
find $IOS_BUILD_PATH -type f -iname "usymtool" -exec chmod +x {} \;
bundle install
#bundle exec fastlane ios release
bundle exec fastlane ios beta
#bundle exec fastlane ios build
####################################
# Cleanup to avoid storage limit #
####################################
- name: Cleanup to avoid storage limit
if: always()
uses: geekyeggo/delete-artifact@v2
with:
name: build-iOS