-
Notifications
You must be signed in to change notification settings - Fork 1
45 lines (43 loc) · 1.57 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: Build
on: [push]
jobs:
build:
name: Build
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: xcode version
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Build Package with swift
run: swift build
- name: Set Default Scheme
run: |
scheme_list=$(xcodebuild -list -json | tr -d "\n")
default=$(echo $scheme_list | ruby -e "require 'json'; puts JSON.parse(STDIN.gets)['workspace']['schemes'][0]")
echo $default | cat >default
echo Using default scheme: $default
- name: Build Package with xcodebuild
env:
scheme: ${{ 'default' }}
run: |
if [ $scheme = default ]; then scheme=$(cat default); fi
xcodebuild -scheme $scheme -destination 'platform=iOS Simulator,name=iPhone 13'
- name: Verify cocoapods
run: pod lib lint --allow-warnings
- name: Execute swiftlint
run: swiftlint
- name: Build Example UIKit
env:
scheme: ${{ 'default' }}
run: |
if [ $scheme = default ]; then scheme=$(cat default); fi
xcodebuild clean build -project Examples/PlayerUIKit/PlayerUIKit.xcodeproj -scheme $scheme -sdk iphoneos
- name: Build Example SwiftUI
env:
scheme: ${{ 'default' }}
run: |
if [ $scheme = default ]; then scheme=$(cat default); fi
xcodebuild clean build -project Examples/PlayerSwiftUI/PlayerSwiftUI.xcodeproj -scheme $scheme -sdk iphoneos