From 390f3873ce6f65980e099576e1d14e35136d806a Mon Sep 17 00:00:00 2001 From: Rachel Brindle Date: Tue, 9 Jan 2024 23:55:32 -0800 Subject: [PATCH] Build the carthage frameworks in a github action (#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. --- .github/workflows/release.yml | 27 +++++++++++++++++++++++++++ Cartfile.private | 2 -- Cartfile.resolved | 2 -- Nimble.xcodeproj/project.pbxproj | 8 ++++---- script/release | 13 ++----------- test | 2 +- 6 files changed, 34 insertions(+), 20 deletions(-) create mode 100644 .github/workflows/release.yml delete mode 100644 Cartfile.private diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..70128ac59 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,27 @@ +name: "Release Artifacts" + +on: + release: + types: [published] + +jobs: + carthage_archive: + name: Darwin, Xcode 14.0 + runs-on: macos-12 + strategy: + matrix: + xcode: ["14.0.1"] + env: + DEVELOPER_DIR: "/Applications/Xcode_${{ matrix.xcode }}.app" + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Archive Nimble + run: | + ./test carthage + zip -r Nimble.xcframework.zip Carthage/Build/Nimble.xcframework + - name: Upload Nimble.xcframework.zip + uses: softprops/action-gh-release@v1 + with: + files: | + Nimble.xcframework.zip diff --git a/Cartfile.private b/Cartfile.private deleted file mode 100644 index f1d58e1d4..000000000 --- a/Cartfile.private +++ /dev/null @@ -1,2 +0,0 @@ -github "mattgallagher/CwlCatchException" ~> 2.0 -github "mattgallagher/CwlPreconditionTesting" ~> 2.1 diff --git a/Cartfile.resolved b/Cartfile.resolved index 098e53fc3..e69de29bb 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1,2 +0,0 @@ -github "mattgallagher/CwlCatchException" "2.0.0" -github "mattgallagher/CwlPreconditionTesting" "2.1.0" diff --git a/Nimble.xcodeproj/project.pbxproj b/Nimble.xcodeproj/project.pbxproj index 84e896de8..a5b68f08c 100644 --- a/Nimble.xcodeproj/project.pbxproj +++ b/Nimble.xcodeproj/project.pbxproj @@ -1036,6 +1036,7 @@ CODE_SIGN_IDENTITY = ""; COPY_PHASE_STRIP = NO; CURRENT_PROJECT_VERSION = 1; + DRIVERKIT_DEPLOYMENT_TARGET = 23.0; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; ENABLE_TESTING_SEARCH_PATHS = YES; @@ -1110,6 +1111,7 @@ CODE_SIGN_IDENTITY = ""; COPY_PHASE_STRIP = YES; CURRENT_PROJECT_VERSION = 1; + DRIVERKIT_DEPLOYMENT_TARGET = 23.0; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTING_SEARCH_PATHS = YES; @@ -1150,7 +1152,6 @@ BUILD_LIBRARY_FOR_DISTRIBUTION = YES; COMBINE_HIDPI_IMAGES = YES; DEFINES_MODULE = YES; - DRIVERKIT_DEPLOYMENT_TARGET = 20.0; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; @@ -1180,7 +1181,7 @@ PRODUCT_NAME = Nimble; SDKROOT = macosx; SKIP_INSTALL = YES; - SUPPORTED_PLATFORMS = "appletvos appletvsimulator driverkit iphoneos iphonesimulator macosx watchos watchsimulator"; + SUPPORTED_PLATFORMS = "appletvos appletvsimulator iphoneos iphonesimulator macosx watchos watchsimulator"; SUPPORTS_MACCATALYST = YES; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES; TARGETED_DEVICE_FAMILY = "1,2,3,4"; @@ -1194,7 +1195,6 @@ COMBINE_HIDPI_IMAGES = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEFINES_MODULE = YES; - DRIVERKIT_DEPLOYMENT_TARGET = 20.0; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; @@ -1223,7 +1223,7 @@ PRODUCT_NAME = Nimble; SDKROOT = macosx; SKIP_INSTALL = YES; - SUPPORTED_PLATFORMS = "appletvos appletvsimulator driverkit iphoneos iphonesimulator macosx watchos watchsimulator"; + SUPPORTED_PLATFORMS = "appletvos appletvsimulator iphoneos iphonesimulator macosx watchos watchsimulator"; SUPPORTS_MACCATALYST = YES; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES; SWIFT_COMPILATION_MODE = wholemodule; diff --git a/script/release b/script/release index 4cd5c3d0c..742dbcfdb 100755 --- a/script/release +++ b/script/release @@ -4,7 +4,6 @@ POD_NAME=Nimble PODSPEC=Nimble.podspec POD=${COCOAPODS:-"bundle exec pod"} -CARTHAGE=${CARTHAGE:-"carthage"} GH=${GH:-"gh"} function help { @@ -42,11 +41,6 @@ if [ -z "`which $POD`" ]; then fi echo " > Cocoapods is installed" -if [ -z "`which $CARTHAGE`" ]; then - die "Carthage is required to produce a release. Install with brew using 'brew install carthage'. Aborting." -fi -echo " > Carthage is installed" - if [ -z "`which $GH`" ]; then die "gh (github CLI) is required to produce a release. Install with brew using 'brew install gh'. Aborting." fi @@ -164,10 +158,6 @@ echo "Pushing to pod trunk..." $POD trunk push "$PODSPEC" -echo "Creating a carthage archive to include in the release" -$CARTHAGE build --archive --use-xcframeworks -zip -r Nimble.xcframework.zip Carthage/Build/Nimble.xcframework - # Check version tag to determine whether to mark the release as a prerelease version or not. echo $VERSION_TAG | grep -q -E "^v\d+\.\d+\.\d+\$" if [ $? -eq 0 ]; then @@ -178,7 +168,7 @@ fi echo "Creating a github release using auto-generated notes." -$GH release create -R Quick/Nimble $VERSION_TAG Nimble.xcframework.zip Nimble.framework.zip --generate-notes $PRERELEASE_FLAGS +$GH release create -R Quick/Nimble $VERSION_TAG --generate-notes $PRERELEASE_FLAGS echo echo "================ Finalizing the Release ================" @@ -186,6 +176,7 @@ echo echo " - Opening GitHub to allow for any edits to the release notes." echo " - You should add a Highlights section at the top to call out any notable changes or fixes." echo " - In particular, any breaking changes should be listed under Highlights." +echo " - Carthage archive frameworks will be automatically uploaded after the release is published." echo " - Announce!" open "https://github.com/Quick/Nimble/releases/tag/$VERSION_TAG" diff --git a/test b/test index ed5a0cf03..97779c98a 100755 --- a/test +++ b/test @@ -127,7 +127,7 @@ function test_carthage { echo "Gathering Carthage installation information..." run carthage version echo "Verifying that Carthage artifacts build" - run carthage build archive --use-xcframeworks --verbose + run carthage build --no-skip-current --use-xcframeworks --verbose } function test_swiftpm {