-
Notifications
You must be signed in to change notification settings - Fork 2.2k
185 lines (185 loc) · 6.34 KB
/
publish-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
name: Publish release
on: workflow_dispatch
env:
XCODE_VERSION: "['15.3', '15.4', '16', '16.1_beta_3']"
TEST_XCODE_VERSION: '16'
jobs:
prepare:
runs-on: ubuntu-latest
name: Prepare outputs
outputs:
XCODE_VERSIONS_MATRIX: ${{ env.XCODE_VERSION }}
VERSION: ${{ steps.get-version.outputs.VERSION }}
steps:
- uses: actions/checkout@v4
- name: Compute outputs
run: |
echo "XCODE_VERSIONS_MATRIX=${{ env.XCODE_VERSION }}" >> $GITHUB_OUTPUT
- name: Read SDK version
id: get-version
run: |
version="$(sed -n 's/^VERSION=\(.*\)$/\1/p' "${GITHUB_WORKSPACE}/dependencies.list")"
echo "VERSION=$version" >> $GITHUB_OUTPUT
tag-release:
runs-on: ubuntu-latest
name: Tag Release
needs: prepare
steps:
- uses: actions/checkout@v4
- uses: rickstaa/action-create-tag@v1
id: "tag_create"
with:
tag: "v${{ needs.prepare.outputs.VERSION }}"
tag_exists_error: false
message: ""
publish-docs:
runs-on: macos-15
name: Publish docs to S3 Bucket
needs: tag-release
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_DOCS_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_DOCS_SECRET_ACCESS_KEY }}
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- run: brew install s3cmd
- name: Publish docs
run: bundle exec sh -x build.sh publish-docs ${{ github.sha }}
create-release:
runs-on: macos-15
name: Create github release
needs: [tag-release, prepare]
env:
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Create Github release
run: bundle exec ./build.sh publish-github ${{ github.sha }}
publish-cocoapods:
runs-on: macos-15
name: Publish Cocoapods specs
needs: [tag-release, prepare]
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Publish
run: bundle exec ./build.sh publish-cocoapods v${{ needs.prepare.outputs.VERSION }}
update-checker:
runs-on: macos-15
name: Update to latest version update checker file
needs: tag-release
env:
AWS_ACCESS_KEY_ID: ${{ secrets.UPDATE_CHECKER_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.UPDATE_CHECKER_SECRET_KEY }}
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- run: brew install s3cmd
- run: bundle exec ./build.sh publish-update-checker
test-installation:
runs-on: macos-15
name: Run installation test for ${{ matrix.platform }}, ${{ matrix.installation }} and ${{ matrix.linkage }}
needs: [create-release, prepare, publish-cocoapods]
strategy:
fail-fast: false
matrix:
platform: [ios, osx, watchos, tvos, catalyst, visionos]
installation: [cocoapods, spm, carthage, xcframework]
linkage: [static, dynamic]
exclude:
- installation: carthage
linkage: static
- platform: catalyst
installation: carthage
- platform: osx
installation: xcframework
linkage: static
- platform: watchos
installation: xcframework
linkage: static
- platform: tvos
installation: xcframework
linkage: static
- platform: catalyst
installation: xcframework
linkage: static
- platform: visionos
installation: xcframework
linkage: static
- platform: catalyst
installation: carthage
linkage: static
- platform: visionos
installation: carthage
- platform: visionos
installation: cocoapods
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: ${{ env.TEST_XCODE_VERSION }}
- name: Run installation test
uses: nick-fields/retry@v3
env:
REALM_TEST_RELEASE: ${{ needs.prepare.outputs.VERSION }}
with:
command: |
cd examples/installation
bundle exec ./build.rb ${{ matrix.platform }} ${{ matrix.installation }} ${{ matrix.linkage }}
timeout_minutes: 30
max_attempts: 10
retry_wait_seconds: 60
retry_on: error
post-slack-release:
runs-on: macos-15
name: Publish to release Slack channel
needs: [create-release, prepare, publish-cocoapods, update-checker, publish-docs]
env:
WEBHOOK_URL: ${{ secrets.SLACK_RELEASES_WEBHOOK }}
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Prepare Changelog
run: bundle exec ./build.sh prepare-publish-changelog
- name: 'Post to #realm-releases'
uses: realm/ci-actions/release-to-slack@a2191a6cbf2f5b50aa71026dd068582dbd5016cc
with:
changelog: ExtractedChangelog/CHANGELOG.md
sdk: Swift
webhook-url: ${{ env.WEBHOOK_URL }}
version: ${{ needs.prepare.outputs.VERSION }}
add-empty-changelog:
runs-on: macos-15
permissions:
contents: write
name: Add empty changelog and commits/push it
needs: [post-slack-release]
env:
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
- name: Add template to changelog
run: |
sh build.sh add-empty-changelog
- name: Auto-commit CHANGELOG.md
uses: stefanzweifel/git-auto-commit-action@v4
with:
file_pattern: 'CHANGELOG.md'
commit_message: 'Add an empty changelog section'