Skip to content

Commit 390f387

Browse files
authored
Build the carthage frameworks in a github action (Quick#1107)
* Build the carthage frameworks in a github action * Use the carthage build script to deploy release Drop the unused driverkit platform * Carthage --archive does not work correctly with --use-xcframeworks, so use a workaround.
1 parent 1b75ed0 commit 390f387

File tree

6 files changed

+34
-20
lines changed

6 files changed

+34
-20
lines changed

.github/workflows/release.yml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: "Release Artifacts"
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
carthage_archive:
9+
name: Darwin, Xcode 14.0
10+
runs-on: macos-12
11+
strategy:
12+
matrix:
13+
xcode: ["14.0.1"]
14+
env:
15+
DEVELOPER_DIR: "/Applications/Xcode_${{ matrix.xcode }}.app"
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
- name: Archive Nimble
20+
run: |
21+
./test carthage
22+
zip -r Nimble.xcframework.zip Carthage/Build/Nimble.xcframework
23+
- name: Upload Nimble.xcframework.zip
24+
uses: softprops/action-gh-release@v1
25+
with:
26+
files: |
27+
Nimble.xcframework.zip

Cartfile.private

-2
This file was deleted.

Cartfile.resolved

-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +0,0 @@
1-
github "mattgallagher/CwlCatchException" "2.0.0"
2-
github "mattgallagher/CwlPreconditionTesting" "2.1.0"

Nimble.xcodeproj/project.pbxproj

+4-4
Original file line numberDiff line numberDiff line change
@@ -1036,6 +1036,7 @@
10361036
CODE_SIGN_IDENTITY = "";
10371037
COPY_PHASE_STRIP = NO;
10381038
CURRENT_PROJECT_VERSION = 1;
1039+
DRIVERKIT_DEPLOYMENT_TARGET = 23.0;
10391040
ENABLE_STRICT_OBJC_MSGSEND = YES;
10401041
ENABLE_TESTABILITY = YES;
10411042
ENABLE_TESTING_SEARCH_PATHS = YES;
@@ -1110,6 +1111,7 @@
11101111
CODE_SIGN_IDENTITY = "";
11111112
COPY_PHASE_STRIP = YES;
11121113
CURRENT_PROJECT_VERSION = 1;
1114+
DRIVERKIT_DEPLOYMENT_TARGET = 23.0;
11131115
ENABLE_NS_ASSERTIONS = NO;
11141116
ENABLE_STRICT_OBJC_MSGSEND = YES;
11151117
ENABLE_TESTING_SEARCH_PATHS = YES;
@@ -1150,7 +1152,6 @@
11501152
BUILD_LIBRARY_FOR_DISTRIBUTION = YES;
11511153
COMBINE_HIDPI_IMAGES = YES;
11521154
DEFINES_MODULE = YES;
1153-
DRIVERKIT_DEPLOYMENT_TARGET = 20.0;
11541155
DYLIB_COMPATIBILITY_VERSION = 1;
11551156
DYLIB_CURRENT_VERSION = 1;
11561157
DYLIB_INSTALL_NAME_BASE = "@rpath";
@@ -1180,7 +1181,7 @@
11801181
PRODUCT_NAME = Nimble;
11811182
SDKROOT = macosx;
11821183
SKIP_INSTALL = YES;
1183-
SUPPORTED_PLATFORMS = "appletvos appletvsimulator driverkit iphoneos iphonesimulator macosx watchos watchsimulator";
1184+
SUPPORTED_PLATFORMS = "appletvos appletvsimulator iphoneos iphonesimulator macosx watchos watchsimulator";
11841185
SUPPORTS_MACCATALYST = YES;
11851186
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES;
11861187
TARGETED_DEVICE_FAMILY = "1,2,3,4";
@@ -1194,7 +1195,6 @@
11941195
COMBINE_HIDPI_IMAGES = YES;
11951196
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
11961197
DEFINES_MODULE = YES;
1197-
DRIVERKIT_DEPLOYMENT_TARGET = 20.0;
11981198
DYLIB_COMPATIBILITY_VERSION = 1;
11991199
DYLIB_CURRENT_VERSION = 1;
12001200
DYLIB_INSTALL_NAME_BASE = "@rpath";
@@ -1223,7 +1223,7 @@
12231223
PRODUCT_NAME = Nimble;
12241224
SDKROOT = macosx;
12251225
SKIP_INSTALL = YES;
1226-
SUPPORTED_PLATFORMS = "appletvos appletvsimulator driverkit iphoneos iphonesimulator macosx watchos watchsimulator";
1226+
SUPPORTED_PLATFORMS = "appletvos appletvsimulator iphoneos iphonesimulator macosx watchos watchsimulator";
12271227
SUPPORTS_MACCATALYST = YES;
12281228
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES;
12291229
SWIFT_COMPILATION_MODE = wholemodule;

script/release

+2-11
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ POD_NAME=Nimble
44
PODSPEC=Nimble.podspec
55

66
POD=${COCOAPODS:-"bundle exec pod"}
7-
CARTHAGE=${CARTHAGE:-"carthage"}
87
GH=${GH:-"gh"}
98

109
function help {
@@ -42,11 +41,6 @@ if [ -z "`which $POD`" ]; then
4241
fi
4342
echo " > Cocoapods is installed"
4443

45-
if [ -z "`which $CARTHAGE`" ]; then
46-
die "Carthage is required to produce a release. Install with brew using 'brew install carthage'. Aborting."
47-
fi
48-
echo " > Carthage is installed"
49-
5044
if [ -z "`which $GH`" ]; then
5145
die "gh (github CLI) is required to produce a release. Install with brew using 'brew install gh'. Aborting."
5246
fi
@@ -164,10 +158,6 @@ echo "Pushing to pod trunk..."
164158

165159
$POD trunk push "$PODSPEC"
166160

167-
echo "Creating a carthage archive to include in the release"
168-
$CARTHAGE build --archive --use-xcframeworks
169-
zip -r Nimble.xcframework.zip Carthage/Build/Nimble.xcframework
170-
171161
# Check version tag to determine whether to mark the release as a prerelease version or not.
172162
echo $VERSION_TAG | grep -q -E "^v\d+\.\d+\.\d+\$"
173163
if [ $? -eq 0 ]; then
@@ -178,14 +168,15 @@ fi
178168

179169
echo "Creating a github release using auto-generated notes."
180170

181-
$GH release create -R Quick/Nimble $VERSION_TAG Nimble.xcframework.zip Nimble.framework.zip --generate-notes $PRERELEASE_FLAGS
171+
$GH release create -R Quick/Nimble $VERSION_TAG --generate-notes $PRERELEASE_FLAGS
182172

183173
echo
184174
echo "================ Finalizing the Release ================"
185175
echo
186176
echo " - Opening GitHub to allow for any edits to the release notes."
187177
echo " - You should add a Highlights section at the top to call out any notable changes or fixes."
188178
echo " - In particular, any breaking changes should be listed under Highlights."
179+
echo " - Carthage archive frameworks will be automatically uploaded after the release is published."
189180
echo " - Announce!"
190181

191182
open "https://github.com/Quick/Nimble/releases/tag/$VERSION_TAG"

test

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ function test_carthage {
127127
echo "Gathering Carthage installation information..."
128128
run carthage version
129129
echo "Verifying that Carthage artifacts build"
130-
run carthage build archive --use-xcframeworks --verbose
130+
run carthage build --no-skip-current --use-xcframeworks --verbose
131131
}
132132

133133
function test_swiftpm {

0 commit comments

Comments
 (0)