diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3b242ec..1b031af 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,60 +1,44 @@ -name: Unsigned IPA Build +name: Build and Export Unsigned IPA on: push: branches: - main - workflow_dispatch: + pull_request: + branches: + - main jobs: build: - - runs-on: macos-14 - - strategy: - matrix: - platform: ['iOS'] + runs-on: macos-latest steps: - name: Checkout code uses: actions/checkout@v2 + + - name: Set up Ruby + uses: actions/setup-ruby@v1 with: - fetch-depth: 0 - submodules: recursive + ruby-version: '2.7' - - name: Fetch Commit Info - id: commitinfo - run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" + - name: Install CocoaPods + run: | + gem install cocoapods + pod install --project-directory=App - - name: Setup Xcode + - name: Set up Xcode uses: maxim-lobanov/setup-xcode@v1 with: - xcode-version: latest-stable + xcode-version: '15.0.0' - - name: Resolve Swift Package Dependencies + - name: Build and Export IPA run: | - swift package resolve + xcodebuild clean -project App/Mochi.xcodeproj -scheme Mochi -configuration Release + xcodebuild archive -project App/Mochi.xcodeproj -scheme Mochi -configuration Release -archivePath $PWD/build/Mochi.xcarchive + xcodebuild -exportArchive -archivePath $PWD/build/Mochi.xcarchive -exportOptionsPlist App/exportOptions.plist -exportPath $PWD/build - - name: Build Unsigned IPA - run: | - xcodebuild clean -project "./App/Mochi.xcodeproj" \ - -scheme Mochi \ - -configuration Release \ - -destination generic/platform=${{ matrix.platform }} \ - archive -archivePath "build/Mochi.${{ matrix.platform }}.xcarchive" \ - CODE_SIGN_IDENTITY="" \ - CODE_SIGNING_REQUIRED=NO \ - CODE_SIGNING_ALLOWED=NO \ - -skipMacroValidation \ - -verbose - xcodebuild -exportArchive -archivePath "build/Mochi.${{ matrix.platform }}.xcarchive" \ - -exportOptionsPlist exportOptions.plist \ - -exportPath "build" - - name: Package ${{ matrix.platform }} - run: ./package.sh "build/Mochi.${{ matrix.platform }}.xcarchive" ${{ matrix.platform }} "Mochi.${{ steps.commitinfo.outputs.sha_short }}.${{ matrix.platform }}" - - name: Upload Unsigned IPA Artifact + - name: Upload IPA as Artifact uses: actions/upload-artifact@v2 with: - name: Mochi.${{ steps.commitinfo.outputs.sha_short }}.${{ matrix.platform }}.ipa - path: build/*.ipa - if-no-files-found: error + name: Mochi.ipa + path: build/Mochi.ipa