Skip to content

Commit 574c864

Browse files
authored
Merge branch 'SDWebImage:master' into master
2 parents 6a82d53 + 0d6e4fe commit 574c864

File tree

163 files changed

+7083
-1355
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

163 files changed

+7083
-1355
lines changed

.github/workflows/CD.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: "SDWebImage CD"
2+
3+
on:
4+
push:
5+
# Pattern matched against refs/tags
6+
tags:
7+
- '*'
8+
9+
jobs:
10+
Release:
11+
name: Release XCFramework
12+
runs-on: macos-15
13+
env:
14+
LC_ALL: en_US.UTF-8
15+
CODESIGN_KEY_BASE64: "${{ secrets.CODESIGN_KEY_BASE64 }}"
16+
DEVELOPER_DIR: /Applications/Xcode_16.0.app
17+
XCODE_VERSION_MAJOR: 1600
18+
XCODE_VERSION_MINOR: 1600
19+
strategy:
20+
fail-fast: true
21+
matrix:
22+
linkage: [dynamic, static]
23+
include:
24+
- linkage: dynamic
25+
MACH_O_TYPE: mh_dylib
26+
- linkage: static
27+
MACH_O_TYPE: staticlib
28+
steps:
29+
- name: Checkout
30+
uses: actions/checkout@v3
31+
32+
- name: Build XCFramework
33+
run: |
34+
set -o pipefail
35+
export MACH_O_TYPE="${{ matrix.MACH_O_TYPE }}"
36+
./Scripts/build-frameworks.sh
37+
rm -rf ~/Library/Developer/Xcode/DerivedData/
38+
39+
- name: Create XCFramework
40+
run: |
41+
set -o pipefail
42+
export MACH_O_TYPE="${{ matrix.MACH_O_TYPE }}"
43+
./Scripts/create-xcframework.sh
44+
./Scripts/sign-xcframework.sh
45+
46+
- name: Archive XCFramework
47+
run: |
48+
cd build
49+
zip -r -y SDWebImage-${{ matrix.linkage }}.xcframework.zip SDWebImage.xcframework
50+
cd ../
51+
mv build/SDWebImage-${{ matrix.linkage }}.xcframework.zip SDWebImage-${{ matrix.linkage }}.xcframework.zip
52+
rm -rf build
53+
54+
- uses: softprops/[email protected]
55+
env:
56+
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
57+
GITHUB_REPOSITORY: "${{ github.repository }}"
58+
with:
59+
files: "SDWebImage-${{ matrix.linkage }}.xcframework.zip"

.github/workflows/CI.yml

Lines changed: 68 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@ permissions:
1212
contents: read
1313

1414
jobs:
15-
Pods:
15+
Lint:
1616
name: Cocoapods Lint
17-
runs-on: macos-11
17+
runs-on: macos-15
1818
env:
19-
DEVELOPER_DIR: /Applications/Xcode_13.2.1.app
19+
LC_ALL: en_US.UTF-8
20+
DEVELOPER_DIR: /Applications/Xcode_16.0.app
2021
steps:
2122
- name: Checkout
2223
uses: actions/checkout@v3
@@ -27,10 +28,10 @@ jobs:
2728
- name: Install Xcpretty
2829
run: gem install xcpretty --no-document --quiet
2930

30-
- name: Pod Update.
31+
- name: Pod Update
3132
run: pod repo update --silent
3233

33-
- name: Pod Install.
34+
- name: Pod Install
3435
run: pod install
3536

3637
- name: Run SDWebImage podspec lint
@@ -39,22 +40,19 @@ jobs:
3940
pod lib lint SDWebImage.podspec --allow-warnings --skip-tests
4041
4142
Demo:
42-
name: Run Demo
43-
runs-on: macos-11
43+
name: Cocoapods Demo
44+
runs-on: macos-15
4445
env:
45-
DEVELOPER_DIR: /Applications/Xcode_13.2.1.app
46+
LC_ALL: en_US.UTF-8
47+
DEVELOPER_DIR: /Applications/Xcode_16.0.app
4648
WORKSPACE_NAME: SDWebImage.xcworkspace
47-
OSXSCHEME: SDWebImage OSX Demo
48-
iOSSCHEME: SDWebImage iOS Demo
49-
TVSCHEME: SDWebImage TV Demo
50-
WATCHSCHEME: SDWebImage Watch Demo
51-
strategy:
52-
matrix:
53-
iosDestination: ["name=iPhone 13 Pro"]
54-
tvOSDestination: ["name=Apple TV 4K"]
55-
watchOSDestination: ["platform=watchOS Simulator,name=Apple Watch Series 7 - 45mm"]
56-
macOSDestination: ["platform=macOS"]
57-
macCatalystDestination: ["platform=macOS,arch=x86_64,variant=Mac Catalyst"]
49+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
50+
iosDestination: generic/platform=iOS Simulator
51+
macOSDestination: platform=macOS,arch=x86_64
52+
macCatalystDestination: platform=macOS,arch=x86_64,variant=Mac Catalyst
53+
tvOSDestination: generic/platform=tvOS Simulator
54+
watchOSDestination: generic/platform=watchOS Simulator
55+
visionOSDestination: generic/platform=visionOS Simulator
5856
steps:
5957
- name: Checkout
6058
uses: actions/checkout@v3
@@ -74,38 +72,63 @@ jobs:
7472
- name: Run demo for OSX
7573
run: |
7674
set -o pipefail
77-
xcodebuild build -workspace "${{ env.WORKSPACE_NAME }}" -scheme "${{ env.OSXSCHEME }}" -destination "${{ matrix.macOSDestination }}" -configuration Debug CODE_SIGNING_ALLOWED=NO | xcpretty -c
75+
xcodebuild build -workspace "${{ env.WORKSPACE_NAME }}" -scheme "SDWebImage OSX Demo" -destination "${{ env.macOSDestination }}" -configuration Debug CODE_SIGNING_ALLOWED=NO | xcpretty -c
7876
7977
- name: Run demo for iOS
8078
run: |
8179
set -o pipefail
82-
xcodebuild build -workspace "${{ env.WORKSPACE_NAME }}" -scheme "${{ env.iOSSCHEME }}" -destination "${{ matrix.iosDestination }}" -configuration Debug CODE_SIGNING_ALLOWED=NO | xcpretty -c
80+
xcodebuild build -workspace "${{ env.WORKSPACE_NAME }}" -scheme "SDWebImage iOS Demo" -destination "${{ env.iosDestination }}" -configuration Debug CODE_SIGNING_ALLOWED=NO | xcpretty -c
8381
8482
- name: Run demo for TV
8583
run: |
8684
set -o pipefail
87-
xcodebuild build -workspace "${{ env.WORKSPACE_NAME }}" -scheme "${{ env.TVSCHEME }}" -destination "${{ matrix.tvOSDestination }}" -configuration Debug CODE_SIGNING_ALLOWED=NO | xcpretty -c
85+
xcodebuild build -workspace "${{ env.WORKSPACE_NAME }}" -scheme "SDWebImage TV Demo" -destination "${{ env.tvOSDestination }}" -configuration Debug CODE_SIGNING_ALLOWED=NO | xcpretty -c
8886
8987
- name: Run demo for Watch
9088
run: |
9189
set -o pipefail
92-
xcodebuild build -workspace "${{ env.WORKSPACE_NAME }}" -scheme "${{ env.WATCHSCHEME }}" -destination "${{ matrix.watchOSDestination }}" -configuration Debug CODE_SIGNING_ALLOWED=NO | xcpretty -c
93-
90+
xcodebuild build -workspace "${{ env.WORKSPACE_NAME }}" -scheme "SDWebImage Watch Demo" -destination "${{ env.watchOSDestination }}" -configuration Debug CODE_SIGNING_ALLOWED=NO | xcpretty -c
91+
92+
- name: Run demo for Vision
93+
run: |
94+
set -o pipefail
95+
xcodebuild build -workspace "${{ env.WORKSPACE_NAME }}" -scheme "SDWebImage Vision Demo" -destination "${{ env.visionOSDestination }}" -configuration Debug CODE_SIGNING_ALLOWED=NO | xcpretty -c
96+
9497
Test:
9598
name: Unit Test
96-
runs-on: macos-11
99+
runs-on: macos-15
97100
env:
98-
DEVELOPER_DIR: /Applications/Xcode_13.2.1.app
101+
LC_ALL: en_US.UTF-8
102+
DEVELOPER_DIR: /Applications/Xcode_16.0.app
99103
WORKSPACE_NAME: SDWebImage.xcworkspace
100104
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
105+
# use matrix to generate jobs for each platform
101106
strategy:
107+
fail-fast: false
102108
matrix:
103-
iosDestination: ["platform=iOS Simulator,name=iPhone 13 Pro"]
104-
macOSDestination: ["platform=macOS,arch=x86_64"]
105-
tvOSDestination: ["platform=tvOS Simulator,name=Apple TV 4K"]
109+
platform: [iOS, macOS, tvOS, visionOS]
110+
include:
111+
- platform: iOS
112+
destination: platform=iOS Simulator,name=iPhone 16 Pro Max
113+
scheme: iOS
114+
flag: ios
115+
- platform: macOS
116+
destination: platform=macOS,arch=x86_64
117+
scheme: Mac
118+
flag: macos
119+
- platform: tvOS
120+
destination: platform=tvOS Simulator,name=Apple TV 4K (3rd generation)
121+
scheme: TV
122+
flag: tvos
123+
- platform: visionOS
124+
destination: platform=visionOS Simulator,name=Apple Vision Pro
125+
scheme: Vision
126+
flag: visionos
106127
steps:
107128
- name: Checkout
108129
uses: actions/checkout@v3
130+
with:
131+
fetch-depth: 0
109132

110133
- name: Install Cocoapods
111134
run: gem install cocoapods --no-document --quiet
@@ -118,62 +141,38 @@ jobs:
118141

119142
- name: Pod Install
120143
run: pod install
121-
144+
122145
- name: Clean DerivedData
123146
run: |
124147
rm -rf ~/Library/Developer/Xcode/DerivedData/
125148
mkdir DerivedData
126149
127-
- name: Test - ${{ matrix.iosDestination }}
150+
- name: Run test
128151
run: |
129152
set -o pipefail
130-
xcodebuild test -workspace "${{ env.WORKSPACE_NAME }}" -scheme "Tests iOS" -destination "${{ matrix.iosDestination }}" -configuration Debug CODE_SIGNING_ALLOWED=NO
131-
mv ~/Library/Developer/Xcode/DerivedData/ ./DerivedData/iOS
132-
133-
- name: Test - ${{ matrix.macOSDestination }}
134-
run: |
135-
set -o pipefail
136-
xcodebuild test -workspace "${{ env.WORKSPACE_NAME }}" -scheme "Tests Mac" -destination "${{ matrix.macOSDestination }}" -configuration Debug CODE_SIGNING_ALLOWED=NO
137-
mv ~/Library/Developer/Xcode/DerivedData/ ./DerivedData/macOS
138-
139-
- name: Test - ${{ matrix.tvOSDestination }}
140-
run: |
141-
set -o pipefail
142-
xcodebuild test -workspace "${{ env.WORKSPACE_NAME }}" -scheme "Tests TV" -destination "${{ matrix.tvOSDestination }}" -configuration Debug CODE_SIGNING_ALLOWED=NO
143-
mv ~/Library/Developer/Xcode/DerivedData/ ./DerivedData/tvOS
153+
xcodebuild build-for-testing -workspace "${{ env.WORKSPACE_NAME }}" -scheme "Tests ${{ matrix.scheme }}" -destination "${{ matrix.destination }}" -configuration Debug CODE_SIGNING_ALLOWED=NO | xcpretty -c
154+
xcodebuild test-without-building -workspace "${{ env.WORKSPACE_NAME }}" -scheme "Tests ${{ matrix.scheme }}" -destination "${{ matrix.destination }}" -configuration Debug CODE_SIGNING_ALLOWED=NO
155+
mv ~/Library/Developer/Xcode/DerivedData/ "./DerivedData/${{ matrix.platform }}"
144156
145157
- name: Code Coverage
146158
run: |
147159
set -o pipefail
148160
export PATH="/usr/local/opt/curl/bin:$PATH"
149161
curl --version
150-
bash <(curl -s https://codecov.io/bash) -v -D './DerivedData/macOS' -J '^SDWebImage$' -c -X gcov -F macos
151-
bash <(curl -s https://codecov.io/bash) -v -D './DerivedData/iOS' -J '^SDWebImage$' -c -X gcov -F ios
152-
bash <(curl -s https://codecov.io/bash) -v -D './DerivedData/tvOS' -J '^SDWebImage$' -c -X gcov -F tvos
162+
bash <(curl -s https://codecov.io/bash) -v -D "./DerivedData/${{ matrix.platform }}" -J '^SDWebImage$' -c -X gcov -F "${{ matrix.flag }}"
153163
154164
Build:
155165
name: Build Library
156-
runs-on: macos-11
166+
runs-on: macos-15
157167
env:
158-
DEVELOPER_DIR: /Applications/Xcode_13.2.1.app
168+
LC_ALL: en_US.UTF-8
169+
DEVELOPER_DIR: /Applications/Xcode_16.0.app
159170
PROJECT_NAME: SDWebImage.xcodeproj
160171
SCHEME_NAME: SDWebImage
161172
steps:
162173
- name: Checkout
163174
uses: actions/checkout@v3
164175

165-
- name: Install Cocoapods
166-
run: gem install cocoapods --no-document --quiet
167-
168-
- name: Install Xcpretty
169-
run: gem install xcpretty --no-document --quiet
170-
171-
- name: Pod Update
172-
run: pod repo update --silent
173-
174-
- name: Pod Install
175-
run: pod install
176-
177176
- name: Build the SwiftPM
178177
run: |
179178
set -o pipefail
@@ -183,14 +182,15 @@ jobs:
183182
- name: Build as static library
184183
run: |
185184
set -o pipefail
186-
xcodebuild build -project "${{ env.PROJECT_NAME }}" -scheme "SDWebImage static" -sdk iphonesimulator PLATFORM_NAME=iphonesimulator -configuration Release | xcpretty -c
185+
xcodebuild build -project "${{ env.PROJECT_NAME }}" -scheme "SDWebImage static" -sdk iphonesimulator PLATFORM_NAME=iphonesimulator -configuration Debug | xcpretty -c
187186
rm -rf ~/Library/Developer/Xcode/DerivedData/
188187
- name: Build as dynamic frameworks
189188
run: |
190189
set -o pipefail
191-
xcodebuild build -project "${{ env.PROJECT_NAME }}" -scheme "${{ env.SCHEME_NAME }}" -sdk macosx -configuration Release | xcpretty -c
192-
xcodebuild build -project "${{ env.PROJECT_NAME }}" -scheme "${{ env.SCHEME_NAME }}" -sdk iphonesimulator PLATFORM_NAME=iphonesimulator -configuration Release | xcpretty -c
193-
xcodebuild build -project "${{ env.PROJECT_NAME }}" -scheme "${{ env.SCHEME_NAME }}" -sdk appletvsimulator -configuration Release | xcpretty -c
194-
xcodebuild build -project "${{ env.PROJECT_NAME }}" -scheme "${{ env.SCHEME_NAME }}" -sdk watchsimulator -configuration Release | xcpretty -c
195-
xcodebuild build -project "${{ env.PROJECT_NAME }}" -scheme "${{ env.SCHEME_NAME }}" -destination "platform=macOS,arch=x86_64,variant=Mac Catalyst" -configuration Release | xcpretty -c
190+
xcodebuild build -project "${{ env.PROJECT_NAME }}" -scheme "${{ env.SCHEME_NAME }}" -sdk macosx -configuration Debug | xcpretty -c
191+
xcodebuild build -project "${{ env.PROJECT_NAME }}" -scheme "${{ env.SCHEME_NAME }}" -sdk iphonesimulator PLATFORM_NAME=iphonesimulator -configuration Debug | xcpretty -c
192+
xcodebuild build -project "${{ env.PROJECT_NAME }}" -scheme "${{ env.SCHEME_NAME }}" -sdk appletvsimulator -configuration Debug | xcpretty -c
193+
xcodebuild build -project "${{ env.PROJECT_NAME }}" -scheme "${{ env.SCHEME_NAME }}" -sdk watchsimulator -configuration Debug | xcpretty -c
194+
xcodebuild build -project "${{ env.PROJECT_NAME }}" -scheme "${{ env.SCHEME_NAME }}" -destination "platform=macOS,arch=x86_64,variant=Mac Catalyst" -configuration Debug | xcpretty -c
195+
xcodebuild build -project "${{ env.PROJECT_NAME }}" -scheme "${{ env.SCHEME_NAME }}" -sdk xrsimulator -configuration Debug | xcpretty -c
196196
rm -rf ~/Library/Developer/Xcode/DerivedData/

0 commit comments

Comments
 (0)