-
Notifications
You must be signed in to change notification settings - Fork 265
190 lines (181 loc) · 5.83 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
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-15-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: lazy-actions/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-15-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
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-samples:
needs: check-version
runs-on: macos-15-xlarge
steps:
- uses: actions/checkout@v4
- name: Build samples
run: make build-samples
run-tests:
needs: check-version
runs-on: macos-15-xlarge
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- name: Install xcodegen
run: brew install xcodegen
- name: Test
run: make test
deploy-github:
permissions:
contents: write
runs-on: macos-15-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: 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
path: ./build
- name: Github Release
id: create_release
uses: softprops/action-gh-release@v1
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
files: |
./build/Airship.zip
./build/Airship.xcframeworks.zip
- name: Kickoff prebuilt repo
env:
GITHUB_TOKEN: ${{ secrets.IOS_DEPLOY_PREBUILT_PAT }}
run: gh --repo urbanairship/ios-library-prebuilt workflow run release.yml
deploy-pods:
runs-on: macos-15-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: lazy-actions/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-15-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: lazy-actions/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: lazy-actions/slatify@master
if: always()
with:
type: ${{ job.status }}
job_name: ":raised_hands: iOS SDK Released! :raised_hands:"
url: ${{ secrets.SLACK_WEBHOOK }}