-
Notifications
You must be signed in to change notification settings - Fork 1
87 lines (69 loc) · 2.58 KB
/
Copy pathbuild.yml
File metadata and controls
87 lines (69 loc) · 2.58 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: Build
on:
push:
branches: [ "main" ]
workflow_dispatch:
jobs:
build:
runs-on: macos-15
name: Build and Test Swift Package
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Select Xcode Version
uses: maxim-lobanov/setup-xcode@ed7a3b1fda3918c0306d1b724322adc0b8cc0a90 # v1.7.0
with:
xcode-version: '26.3'
- name: Setup environment
run: |
bundle install
- name: Build and Run tests
run: |
xcodebuild clean build test -scheme PaystackSDK-Package -sdk iphonesimulator26.2 -destination "OS=26.2,name=iPhone 17 Pro" -enableCodeCoverage YES CODE_SIGNING_REQUIRED=NO
brew install sonar-scanner
bundle exec fastlane sonar_scan
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
PodLinting:
runs-on: macos-15
name: Lint Podspec
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: setup-cocoapods
uses: maxim-lobanov/setup-cocoapods@8e97e1e98e6ccf42564fdf5622c8feec74199377 # v1.4.0
with:
version: 1.15.2
- name: Run pod lint for Paystack Core
run: pod lib lint PaystackCore.podspec --allow-warnings
# TODO: Add sonar here once the project is added
release:
if: ${{ github.event.pull_request.merged == true && github.head_ref == 'release/update-versions' }}
runs-on: macos-15
needs: [build, PodLinting]
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Get version information
run: |
version=$(/usr/libexec/PlistBuddy -c "Print Version" ./Sources/PaystackSDK/Versioning/versions.plist)
echo "version=${version}" >> $GITHUB_ENV
body=$(/usr/libexec/PlistBuddy -c "Print Description" ./Sources/PaystackSDK/Versioning/versions.plist)
echo "body=${body}" >> $GITHUB_ENV
- name: Create Release
id: create_release
uses: softprops/action-gh-release@b4309332981a82ec1c5618f44dd2e27cc8bfbfda # v3.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.version }}
name: ${{ env.version }}
body: ${{ env.body }}
- name: Install Cocoapods
run: gem install cocoapods
- name: Deploy to Cocoapods
run: |
set -eo pipefail
pod trunk push PaystackCore.podspec --allow-warnings
pod trunk push PaystackUI.podspec --allow-warnings
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}