Created
June 30, 2022 15:38
-
-
Save paramsinghvc/f9067eefea36d7840e991221ad963daf to your computer and use it in GitHub Desktop.
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: "iOS Build" | |
| on: | |
| workflow_call: | |
| inputs: | |
| environment: | |
| required: true | |
| type: string | |
| publish: | |
| required: false | |
| type: boolean | |
| description: Publish to Appcenter | |
| secrets: | |
| P12_BASE64: | |
| required: true | |
| MOBILEPROVISION_BASE64: | |
| required: true | |
| IOS_TEAM_ID: | |
| required: true | |
| CERTIFICATE_PASSWORD: | |
| required: true | |
| NPM_TOKEN: | |
| required: true | |
| APP_CENTER_TOKEN_IOS: | |
| required: true | |
| jobs: | |
| build-ios: | |
| runs-on: macos-12 #Monterey | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Use Node.js 14 | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: 14 | |
| cache: "yarn" | |
| - name: Install Node modules | |
| run: yarn ci | |
| - name: Setup Ruby (bundle) | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: 2.6 | |
| bundler-cache: true | |
| - name: Restore Pods cache | |
| uses: actions/cache@v3 | |
| with: | |
| path: | | |
| ios/Pods | |
| ~/Library/Caches/CocoaPods | |
| ~/.cocoapods | |
| key: ${{ runner.os }}-pods-${{ hashFiles('ios/Podfile.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pods- | |
| - name: Install pod dependencies | |
| run: cd ios && pod install && cd .. | |
| - name: Build iOS (Release) | |
| uses: yukiarrr/ios-build-action@v1.5.0 | |
| with: | |
| project-path: ios/FinderUK.xcodeproj | |
| p12-base64: ${{ secrets.P12_BASE64 }} | |
| mobileprovision-base64: ${{ secrets.MOBILEPROVISION_BASE64 }} | |
| code-signing-identity: "Apple Distribution" | |
| certificate-password: ${{ secrets.CERTIFICATE_PASSWORD }} | |
| team-id: ${{ secrets.IOS_TEAM_ID }} | |
| workspace-path: ios/FinderUK.xcworkspace | |
| output-path: "FinderUK.ipa" | |
| - name: Upload build | |
| uses: actions/upload-artifact@v3 | |
| with: | |
| name: "FinderUK.ipa" | |
| path: "FinderUK.ipa" | |
| publish-to-appcenter: | |
| if: ${{ inputs.publish == true }} | |
| runs-on: ubuntu-latest | |
| needs: build-ios | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - uses: actions/download-artifact@v3 | |
| with: | |
| name: FinderUK.ipa | |
| path: "ios/" | |
| - name: set up JDK 1.8 | |
| uses: actions/setup-java@v1 | |
| with: | |
| java-version: 1.8 | |
| - name: Upload artifact to App Center | |
| uses: wzieba/AppCenter-Github-Action@v1 | |
| with: | |
| appName: Finder.com/Finder-UK-iOS | |
| token: ${{secrets.APP_CENTER_TOKEN_IOS}} | |
| group: UKInternal | |
| file: "ios/FinderUK.ipa" | |
| notifyTesters: true | |
| debug: false |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment