-
Notifications
You must be signed in to change notification settings - Fork 0
190 lines (155 loc) · 7.28 KB
/
Copy pathpull-request.yml
File metadata and controls
190 lines (155 loc) · 7.28 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
name: Pull request
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
contents: read
pull-requests: read
checks: write
id-token: write
env:
SDK_PATH: Sdk/MParticle.Maui.Sdk
SDK_PROJECT: MParticle.Maui.Sdk
ROKT_KIT_PATH: Kits/rokt/Sdk/MParticle.Maui.Rokt
ROKT_KIT_PROJECT: mParticle.Maui.Kits.Rokt
PAYMENTS_KIT_PATH: Kits/rokt/Sdk/MParticle.Maui.Rokt.Payments
PAYMENTS_KIT_PROJECT: mParticle.Maui.Kits.Rokt.Payments
jobs:
trunk-check:
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Trunk Check
uses: trunk-io/trunk-action@04ba50e7658c81db7356da96657e6e77f220bfa3 # v1.3.1
with:
check-mode: all
build:
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Setup .NET
uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4.3.1
with:
dotnet-version: 10.0.103
- name: Setup XCode
uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0
with:
xcode-version: "26.0"
- name: Install .NET MAUI
run: dotnet workload install maui --skip-manifest-update
- name: Restore dependencies
run: dotnet restore
- name: Resolve SPM dependencies for iOS binding
run: |
cd ${{ env.SDK_PATH }}/macios/native/mParticleBinding
xcodebuild -resolvePackageDependencies -project mParticleBinding.xcodeproj -scheme mParticleBinding
- name: Build Xcode project for iOS
run: |
cd ${{ env.SDK_PATH }}/macios/native/mParticleBinding
xcodebuild -project mParticleBinding.xcodeproj -scheme mParticleBinding -configuration Debug -sdk iphoneos build
xcodebuild -project mParticleBinding.xcodeproj -scheme mParticleBinding -configuration Debug -sdk iphonesimulator build
- name: Build SDK
run: dotnet build ${{ env.SDK_PATH }}/${{ env.SDK_PROJECT }}.csproj
- name: Build SDK SampleApp
run: dotnet build SampleApp/SampleApp.csproj
- name: Resolve SPM dependencies for Rokt Kit iOS binding
run: |
cd ${{ env.ROKT_KIT_PATH }}/macios/native/mParticleRoktBinding
xcodebuild -resolvePackageDependencies -project mParticleRoktBinding.xcodeproj -scheme mParticleRoktBinding
- name: Build Xcode project for Rokt Kit iOS
run: |
cd ${{ env.ROKT_KIT_PATH }}/macios/native/mParticleRoktBinding
xcodebuild -project mParticleRoktBinding.xcodeproj -scheme mParticleRoktBinding -configuration Debug -sdk iphoneos build
xcodebuild -project mParticleRoktBinding.xcodeproj -scheme mParticleRoktBinding -configuration Debug -sdk iphonesimulator build
- name: Build Rokt Kit
run: dotnet build ${{ env.ROKT_KIT_PATH }}/${{ env.ROKT_KIT_PROJECT }}.csproj
- name: Resolve SPM dependencies for Rokt Payments Kit iOS binding
run: |
cd ${{ env.PAYMENTS_KIT_PATH }}/macios/native/mParticleRoktPaymentsBinding
xcodebuild -resolvePackageDependencies -project mParticleRoktPaymentsBinding.xcodeproj -scheme mParticleRoktPaymentsBinding
- name: Build Xcode project for Rokt Payments Kit iOS
run: |
cd ${{ env.PAYMENTS_KIT_PATH }}/macios/native/mParticleRoktPaymentsBinding
xcodebuild -project mParticleRoktPaymentsBinding.xcodeproj -scheme mParticleRoktPaymentsBinding -configuration Debug -sdk iphoneos build
xcodebuild -project mParticleRoktPaymentsBinding.xcodeproj -scheme mParticleRoktPaymentsBinding -configuration Debug -sdk iphonesimulator build
- name: Build Rokt Payments Kit
run: dotnet build ${{ env.PAYMENTS_KIT_PATH }}/${{ env.PAYMENTS_KIT_PROJECT }}.csproj
- name: Build Rokt Kit SampleApp
run: dotnet build Kits/rokt/SampleApp/SampleApp.csproj
- name: Pack SDK
run: dotnet pack ${{ env.SDK_PATH }}/${{ env.SDK_PROJECT }}.csproj
- name: Pack Rokt Kit
run: dotnet pack ${{ env.ROKT_KIT_PATH }}/${{ env.ROKT_KIT_PROJECT }}.csproj
- name: Pack Rokt Payments Kit
run: dotnet pack ${{ env.PAYMENTS_KIT_PATH }}/${{ env.PAYMENTS_KIT_PROJECT }}.csproj
- name: Find and rename SDK nupkg file
run: |
# Find the generated nupkg file
NUPKG_FILE=$(find ${{ env.SDK_PATH }}/bin/Release -name "*.nupkg" | head -1)
if [ -z "$NUPKG_FILE" ]; then
echo "No nupkg file found"
exit 1
fi
echo "Found nupkg file: $NUPKG_FILE"
# Rename to remove version number
RENAMED_FILE="${{ env.SDK_PATH }}/bin/Release/${{ env.SDK_PROJECT }}.nupkg"
cp "$NUPKG_FILE" "$RENAMED_FILE"
echo "Renamed to: $RENAMED_FILE"
- name: Upload SDK Package Artifact
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: ${{ env.SDK_PROJECT }}.nupkg
path: ${{ env.SDK_PATH }}/bin/Release/${{ env.SDK_PROJECT }}.nupkg
- name: Find and rename Rokt Kit nupkg file
run: |
# Find the generated nupkg file
NUPKG_FILE=$(find ${{ env.ROKT_KIT_PATH }}/bin/Release -name "*.nupkg" | head -1)
if [ -z "$NUPKG_FILE" ]; then
echo "No nupkg file found"
exit 1
fi
echo "Found nupkg file: $NUPKG_FILE"
# Rename to remove version number
RENAMED_FILE="${{ env.ROKT_KIT_PATH }}/bin/Release/${{ env.ROKT_KIT_PROJECT }}.nupkg"
cp "$NUPKG_FILE" "$RENAMED_FILE"
echo "Renamed to: $RENAMED_FILE"
- name: Upload Rokt Kit Package Artifact
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: ${{ env.ROKT_KIT_PROJECT }}.nupkg
path: ${{ env.ROKT_KIT_PATH }}/bin/Release/${{ env.ROKT_KIT_PROJECT }}.nupkg
- name: Find and rename Rokt Payments Kit nupkg file
run: |
# Find the generated nupkg file
NUPKG_FILE=$(find ${{ env.PAYMENTS_KIT_PATH }}/bin/Release -name "*.nupkg" | head -1)
if [ -z "$NUPKG_FILE" ]; then
echo "No nupkg file found"
exit 1
fi
echo "Found nupkg file: $NUPKG_FILE"
# Rename to remove version number
RENAMED_FILE="${{ env.PAYMENTS_KIT_PATH }}/bin/Release/${{ env.PAYMENTS_KIT_PROJECT }}.nupkg"
cp "$NUPKG_FILE" "$RENAMED_FILE"
echo "Renamed to: $RENAMED_FILE"
- name: Upload Rokt Payments Kit Package Artifact
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: ${{ env.PAYMENTS_KIT_PROJECT }}.nupkg
path: ${{ env.PAYMENTS_KIT_PATH }}/bin/Release/${{ env.PAYMENTS_KIT_PROJECT }}.nupkg
pr-notify:
if: >
github.event_name == 'pull_request' &&
github.event.pull_request.draft == false
needs: [trunk-check, build]
name: Notify GChat
uses: ROKT/rokt-workflows/.github/workflows/oss_pr_opened_notification.yml@main
secrets:
gchat_webhook: ${{ secrets.GCHAT_PRS_WEBHOOK }}