Multi-Xcode Build #292
This file contains 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: Multi-Xcode Build | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 1 * * 1-5' | |
push: | |
branches: | |
- 'release/**' | |
jobs: | |
build: | |
name: "Build App" | |
runs-on: macos-13 | |
strategy: | |
max-parallel: 3 | |
matrix: | |
variant: | |
- cocoapods | |
- spm | |
xcode: | |
- 14.3.1 | |
steps: | |
- name: Git - Checkout | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
with: | |
ref: ${{ github.ref }} | |
- name: Select Xcode Version | |
uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0 | |
with: | |
xcode-version: ${{ matrix.xcode }} | |
- name: Install SSH key | |
uses: shimataro/ssh-key-action@d4fffb50872869abe2d9a9098a6d9c5aa7d16be4 #v2.7.0 | |
with: | |
key: ${{ secrets.SSH_KEY }} | |
name: id_rsa_github_actions | |
known_hosts: ${{ secrets.KNOWN_HOSTS }} | |
- uses: webfactory/ssh-agent@dc588b651fe13675774614f8e6a936a468676387 # v0.9.0 | |
with: | |
ssh-private-key: ${{ secrets.SSH_KEY }} | |
- uses: ruby/setup-ruby@a6e6f86333f0a2523ece813039b8b4be04560854 # v1.190.0 | |
with: | |
ruby-version: "3.2" | |
bundler-cache: true | |
- name: Setup node | |
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b #v4.0.3 | |
with: | |
node-version: 18.3.0 | |
- run: npm install --save slack-message-builder | |
- name: Build and archive app via Cocoapods | |
if: ${{ matrix.variant == 'cocoapods' }} | |
run: | | |
bundle exec fastlane build_cocoapods tests:false skip_package_ipa:false | |
env: | |
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} | |
MATCH_GIT_PRIVATE_KEY: ${{ secrets.SSH_KEY }} | |
FASTLANE_PASSWORD: ${{ secrets.FASTLANE_PASSWORD }} | |
FASTLANE_SESSION: ${{ secrets.FASTLANE_SESSION }} | |
MATCH_KEYCHAIN_NAME: ${{ secrets.MATCH_KEYCHAIN_NAME }} | |
MATCH_KEYCHAIN_PASSWORD: ${{ secrets.MATCH_KEYCHAIN_PASSWORD }} | |
SOURCE_BRANCH: ${{ github.head_ref }} | |
- name: Build and archive app via SPM | |
if: ${{ matrix.variant == 'spm' }} | |
run: | | |
bundle exec fastlane test_sdk sim_version:16.4 | |
env: | |
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} | |
MATCH_GIT_PRIVATE_KEY: ${{ secrets.SSH_KEY }} | |
FASTLANE_PASSWORD: ${{ secrets.FASTLANE_PASSWORD }} | |
FASTLANE_SESSION: ${{ secrets.FASTLANE_SESSION }} | |
MATCH_KEYCHAIN_NAME: ${{ secrets.MATCH_KEYCHAIN_NAME }} | |
MATCH_KEYCHAIN_PASSWORD: ${{ secrets.MATCH_KEYCHAIN_PASSWORD }} | |
SOURCE_BRANCH: ${{ github.head_ref }} | |
- name: Create Slack Failure Summary Report | |
if: ${{ failure() }} | |
run: | | |
node Report\ Scripts/multixcode-failure-report.js createMultiXcodeFailureReport ${{ github.head_ref || github.ref_name }} ${{ matrix.xcode}} ${{ matrix.variant }} | |
- name: Slack Notification | |
if: ${{ failure() }} | |
uses: slackapi/slack-github-action@70cd7be8e40a46e8b0eced40b0de447bdb42f68e #v1.26.0 | |
with: | |
channel-id: ${{ secrets.SLACK_MOBILE_SDK_CHANNEL }} | |
payload-file-path: '/var/tmp/multixcode-failure-report.json' | |
env: | |
SLACK_BOT_TOKEN: ${{ secrets.SLACK_REPORTER_BOT_TOKEN }} | |
success: | |
name: Report Success | |
needs: build | |
runs-on: macos-latest | |
steps: | |
- name: Git - Checkout | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
with: | |
ref: ${{ github.ref }} | |
- name: Setup node | |
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b #v4.0.3 | |
with: | |
node-version: 18.3.0 | |
- run: npm install --save slack-message-builder | |
- name: Create Slack Success Summary Report | |
if: ${{ success() }} | |
run: | | |
node Report\ Scripts/multixcode-success-report.js createMultiXcodeSummaryReport ${{ github.head_ref || github.ref_name }} "14.3.1, 14.2, 14.1" "cocoapods, spm" | |
- name: Slack Notification | |
if: ${{ success() }} | |
uses: slackapi/slack-github-action@70cd7be8e40a46e8b0eced40b0de447bdb42f68e #v1.26.0 | |
with: | |
channel-id: ${{ secrets.SLACK_MOBILE_SDK_CHANNEL }} | |
payload-file-path: '/var/tmp/multixcode-success-summary.json' | |
env: | |
SLACK_BOT_TOKEN: ${{ secrets.SLACK_REPORTER_BOT_TOKEN }} | |