-
Notifications
You must be signed in to change notification settings - Fork 265
273 lines (263 loc) · 9.18 KB
/
release.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
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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
name: Release
on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+**"
env:
BUNDLE_PATH: vendor/bundle
jobs:
check-version:
if: github.repository == 'urbanairship/ios-library'
runs-on: macos-13-xlarge
steps:
- uses: actions/checkout@v4
- name: Get the version
id: get_version
run: |
echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
- name: Check Version
run: bash ./scripts/check_version.sh ${{ steps.get_version.outputs.VERSION }}
- name: Slack Notification
uses: homoluctus/slatify@master
with:
type: ${{ job.status }}
job_name: "iOS SDK Release Started :apple_og:"
url: ${{ secrets.SLACK_WEBHOOK }}
build-package:
needs: check-version
runs-on: macos-13-xlarge
steps:
- uses: actions/checkout@v4
- name: Install Coreutils
run: brew install coreutils
- name: Install Apple Certificate
uses: apple-actions/import-codesign-certs@v1
with:
p12-file-base64: ${{ secrets.CERTIFICATEXC }}
p12-password: ${{ secrets.CERTIFICATEXC_PASS }}
- name: Build SDK
run: make build-package XCODE=14.3.1
- name: Upload zip distribution
uses: actions/upload-artifact@v3
with:
name: airship
path: ./build/Airship.zip
- name: Upload zip distribution
uses: actions/upload-artifact@v3
with:
name: airship-carthage
path: ./build/Airship.xcframeworks.zip
- name: Upload Documentation
uses: actions/upload-artifact@v3
with:
name: docs
path: ./build/Documentation
build-package-xcode15:
needs: check-version
runs-on: macos-13-xlarge
steps:
- uses: actions/checkout@v4
- name: Install Coreutils
run: brew install coreutils
- name: Install Apple Certificate
uses: apple-actions/import-codesign-certs@v1
with:
p12-file-base64: ${{ secrets.CERTIFICATEXC }}
p12-password: ${{ secrets.CERTIFICATEXC_PASS }}
- name: Build SDK
run: make build-package
- name: Upload zip distribution
uses: actions/upload-artifact@v3
with:
name: airship-xcode15
path: ./build/Airship.zip
- name: Upload zip distribution
uses: actions/upload-artifact@v3
with:
name: airship-carthage-xcode15
path: ./build/Airship.xcframeworks.zip
- name: Upload Documentation
uses: actions/upload-artifact@v3
with:
name: docs
path: ./build/Documentation
build-samples:
needs: check-version
runs-on: macos-13-xlarge
steps:
- uses: actions/checkout@v4
- name: Build samples
run: make build-samples
run-tests:
needs: check-version
runs-on: macos-13-xlarge
steps:
- uses: actions/checkout@v4
- name: Install xcodegen
run: brew install xcodegen
- name: Test
run: make test test-packages XCODE=14.3.1 TEST_DESTINATION="platform=iOS Simulator,OS=16.4,name=iPhone 14" TEST_DESTINATION_TVOS="platform=tvOS Simulator,OS=16.4,name=Apple TV"
deploy-github:
runs-on: macos-13-xlarge
needs: [run-tests, build-package, build-samples, build-package-xcode15]
steps:
- uses: actions/checkout@v4
- name: Get the version
id: get_version
run: |
echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
- name: Get the release notes
id: get_release_notes
run: |
VERSION=${{ steps.get_version.outputs.VERSION }}
NOTES="$(awk "/## Version $VERSION/{flag=1;next}/## Version/{flag=0}flag" CHANGELOG.md)"
NOTES="${NOTES//'%'/%25}"
NOTES="${NOTES//$'\n'/%0A}"
NOTES="${NOTES//$'\r'/%0D}"
echo ::set-output name=NOTES::"$NOTES"
- name: Download zip distribution
uses: actions/download-artifact@v3
with:
name: airship
path: ./build
- name: Download Carthage zip distribution
uses: actions/download-artifact@v3
with:
name: airship-carthage-xcode15
path: ./build
- name: Download Xcode15 zip distribution
uses: actions/download-artifact@v3
with:
name: airship-xcode15
path: ./buildXcode15
- name: Download Xcode15 Carthage zip distribution
uses: actions/download-artifact@v3
with:
name: airship-carthage
path: ./buildXcode15
- name: Github Release
id: create_release
uses: actions/create-release@v1.1.4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.get_version.outputs.VERSION }}
release_name: ${{ steps.get_version.outputs.VERSION }}
body: ${{ steps.get_release_notes.outputs.NOTES }}
draft: false
prerelease: false
- name: Upload zip distribution
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./build/Airship.zip
asset_name: Airship.zip
asset_content_type: application/zip
- name: Upload carthage zip distribution
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./build/Airship.xcframeworks.zip
asset_name: Airship.xcframeworks.zip
asset_content_type: application/zip
- name: Upload Xcode15 zip distribution
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./buildXcode15/Airship.zip
asset_name: Airship-Xcode15.zip
asset_content_type: application/zip
- name: Upload Xcode 15 carthage zip distribution
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./buildXcode15/Airship.xcframeworks.zip
asset_name: Airship-Xcode15.xcframeworks.zip
asset_content_type: application/zip
- name: Update prebuilt Xcode 14 repo
env:
GITHUB_TOKEN: ${{ secrets.IOS_DEPLOY_PREBUILT_PAT }}
run: gh --repo urbanairship/ios-library-prebuilt workflow run release.yml
- name: Update prebuilt Xcode 15 repo
env:
GITHUB_TOKEN: ${{ secrets.IOS_DEPLOY_PREBUILT_PAT }}
run: gh --repo urbanairship/ios-library-prebuilt --ref xcode-15 workflow run release.yml
- name: Slack Notification
uses: homoluctus/slatify@master
if: always()
with:
type: ${{ job.status }}
job_name: "Deploy iOS SDK to Github :octocat:"
url: ${{ secrets.SLACK_WEBHOOK }}
deploy-pods:
runs-on: macos-13-xlarge
needs: [run-tests, build-package, build-samples]
steps:
- uses: actions/checkout@v4
- name: Get the version
id: get_version
run: |
echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
- name: Publish Pods
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
run: make pod-publish
- name: Slack Notification
uses: homoluctus/slatify@master
if: always()
with:
type: ${{ job.status }}
job_name: "Publish the Pods ${{ steps.get_version.outputs.VERSION }} :tidepod:"
url: ${{ secrets.SLACK_WEBHOOK }}
deploy-docs:
runs-on: macos-13-xlarge
needs: [run-tests, build-package, build-samples]
steps:
- uses: actions/checkout@v4
- name: Get the version
id: get_version
run: |
echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
- name: Download docs
uses: actions/download-artifact@v3
with:
name: docs
path: ./build/Documentation
- name: Setup GCP Auth
uses: google-github-actions/auth@v1
with:
credentials_json: ${{ secrets.GCP_SA_KEY }}
- name: Set up Google Cloud SDK
uses: google-github-actions/setup-gcloud@v1
- name: Upload Docs
run: bash ./scripts/upload_docs.sh
- name: Slack Notification
uses: homoluctus/slatify@master
if: always()
with:
type: ${{ job.status }}
job_name: "Uploaded iOS SDK API docs :female-doctor: :male-doctor:"
url: ${{ secrets.SLACK_WEBHOOK }}
finished:
runs-on: ubuntu-latest
needs: [deploy-github, deploy-pods, deploy-docs]
steps:
- name: Get the version
id: get_version
run: |
echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
- name: Slack Notification
uses: homoluctus/slatify@master
if: always()
with:
type: ${{ job.status }}
job_name: ":raised_hands: iOS SDK Released! :raised_hands:"
url: ${{ secrets.SLACK_WEBHOOK }}