forked from Juanpe/SkeletonView
-
Notifications
You must be signed in to change notification settings - Fork 1
199 lines (178 loc) · 7.28 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
name: Release
on:
workflow_dispatch:
pull_request_target:
branches: [main]
types: [closed]
jobs:
build:
name: Build XCFramework
runs-on: macos-latest
strategy:
matrix:
build-config:
- {
scheme: "SkeletonView iOS",
destination: "generic/platform=iOS",
sdk: "iphoneos",
mach_o_type: "mh_dylib",
archive_path: "build/Release-iphoneos/Dynamic",
}
- {
scheme: "SkeletonView iOS",
destination: "generic/platform=iOS Simulator",
sdk: "iphonesimulator",
mach_o_type: "mh_dylib",
archive_path: "build/Release-iphonesimulator/Dynamic",
}
- {
scheme: "SkeletonView tvOS",
destination: "generic/platform=tvOS",
sdk: "appletvos",
mach_o_type: "mh_dylib",
archive_path: "build/Release-appletvos/Dynamic",
}
- {
scheme: "SkeletonView tvOS",
destination: "generic/platform=tvOS Simulator",
sdk: "appletvsimulator",
mach_o_type: "mh_dylib",
archive_path: "build/Release-appletvsimulator/Dynamic",
}
- {
scheme: "SkeletonView iOS",
destination: "generic/platform=iOS",
sdk: "iphoneos",
mach_o_type: "staticlib",
archive_path: "build/Release-iphoneos/Static",
}
- {
scheme: "SkeletonView iOS",
destination: "generic/platform=iOS Simulator",
sdk: "iphonesimulator",
mach_o_type: "staticlib",
archive_path: "build/Release-iphonesimulator/Static",
}
- {
scheme: "SkeletonView tvOS",
destination: "generic/platform=tvOS",
sdk: "appletvos",
mach_o_type: "staticlib",
archive_path: "build/Release-appletvos/Static",
}
- {
scheme: "SkeletonView tvOS",
destination: "generic/platform=tvOS Simulator",
sdk: "appletvsimulator",
mach_o_type: "staticlib",
archive_path: "build/Release-appletvsimulator/Static",
}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build framework
run: |
xcodebuild archive \
-scheme "${{ matrix.build-config.scheme }}" \
-destination "${{ matrix.build-config.destination }}" \
-configuration "Release" \
-sdk "${{ matrix.build-config.sdk }}" \
-archivePath "${{ matrix.build-config.archive_path }}/SkeletonView.xcarchive" \
SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES \
MACH_O_TYPE=${{ matrix.build-config.mach_o_type }}
- name: Upload archive as artifact
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.build-config.sdk }}-build-${{ matrix.build-config.mach_o_type }}
path: ${{ matrix.build-config.archive_path }}
create-xcframework:
name: Create XCFramework
needs: build
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download artifacts
uses: actions/download-artifact@v3
with:
path: build/
- name: Verify downloaded artifacts
run: ls -R build/
- name: Create Static XCFramework
run: |
xcodebuild -create-xcframework \
-framework build/iphoneos-build-staticlib/SkeletonView.xcarchive/Products/Library/Frameworks/SkeletonView.framework \
-framework build/iphonesimulator-build-staticlib/SkeletonView.xcarchive/Products/Library/Frameworks/SkeletonView.framework \
-framework build/appletvos-build-staticlib/SkeletonView.xcarchive/Products/Library/Frameworks/SkeletonView.framework \
-framework build/appletvsimulator-build-staticlib/SkeletonView.xcarchive/Products/Library/Frameworks/SkeletonView.framework \
-output build/XCFramework/SkeletonViewStatic.xcframework
- name: Create Dynamic XCFramework
run: |
xcodebuild -create-xcframework \
-framework build/iphoneos-build-mh_dylib/SkeletonView.xcarchive/Products/Library/Frameworks/SkeletonView.framework \
-framework build/iphonesimulator-build-mh_dylib/SkeletonView.xcarchive/Products/Library/Frameworks/SkeletonView.framework \
-framework build/appletvos-build-mh_dylib/SkeletonView.xcarchive/Products/Library/Frameworks/SkeletonView.framework \
-framework build/appletvsimulator-build-mh_dylib/SkeletonView.xcarchive/Products/Library/Frameworks/SkeletonView.framework \
-output build/XCFramework/SkeletonViewDynamic.xcframework
- name: Compress XCFrameworks
run: |
cd build/XCFramework
zip -r SkeletonViewStatic.xcframework.zip SkeletonViewStatic.xcframework
zip -r SkeletonViewDynamic.xcframework.zip SkeletonViewDynamic.xcframework
- name: Upload XCFrameworks as Artifacts
uses: actions/upload-artifact@v3
with:
name: XCFrameworks-Zip
path: build/XCFramework/*.xcframework.zip
release_version:
name: Release Version
needs: create-xcframework
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Download XCFrameworks ZIP
uses: actions/download-artifact@v3
with:
name: XCFrameworks-Zip
- name: Update version in podspec
run: fastlane bump_version next_version:${{ steps.publish_release.outputs.tag_name }}
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
branch: "main"
commit_message: "Bump version ${{ steps.publish_release.outputs.tag_name }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish release
id: publish_release
uses: release-drafter/release-drafter@v5
with:
publish: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: softprops/action-gh-release@v0.1.15
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
GITHUB_REPOSITORY: "${{ github.repository }}"
with:
files:
- SkeletonViewDynamic.xcframework.zip
- SkeletonViewStatic.xcframework.zip
- name: Deploy to CocoaPods
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
run: |
set -eo pipefail
pod lib lint --allow-warnings
pod trunk push --allow-warnings
- name: Tweet the release
uses: nearform-actions/github-action-notify-twitter@master
with:
message: |
🎉 New release ${{ steps.publish_release.outputs.tag_name }} is out 🚀
Check out all the changes here:
${{ steps.publish_release.outputs.html_url }}
twitter-app-key: ${{ secrets.TWITTER_CONSUMER_API_KEY }}
twitter-app-secret: ${{ secrets.TWITTER_CONSUMER_API_SECRET }}
twitter-access-token: ${{ secrets.TWITTER_ACCESS_TOKEN }}
twitter-access-token-secret: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }}