Multi-Xcode Build #93
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, 14.2, 14.1] | |
steps: | |
- name: Git - Checkout | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.ref }} | |
- name: Select Xcode Version | |
uses: maxim-lobanov/setup-xcode@v1 | |
with: | |
xcode-version: ${{ matrix.xcode }} | |
- name: Install SSH key | |
uses: shimataro/ssh-key-action@v2 | |
with: | |
key: ${{ secrets.SSH_KEY }} | |
name: id_rsa_github_actions | |
known_hosts: ${{ secrets.KNOWN_HOSTS }} | |
- uses: webfactory/[email protected] | |
with: | |
ssh-private-key: ${{ secrets.SSH_KEY }} | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: "3.2" | |
bundler-cache: true | |
- name: Setup node | |
uses: actions/setup-node@v3 | |
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 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 build_spm | |
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/[email protected] | |
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@v3 | |
with: | |
ref: ${{ github.ref }} | |
- name: Setup node | |
uses: actions/setup-node@v3 | |
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/[email protected] | |
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 }} | |