Skip to content

Commit

Permalink
Build the carthage frameworks in a github action (#1107)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
younata authored Jan 10, 2024
1 parent 1b75ed0 commit 390f387
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 20 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 0 additions & 2 deletions Cartfile.private

This file was deleted.

2 changes: 0 additions & 2 deletions Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,2 +0,0 @@
github "mattgallagher/CwlCatchException" "2.0.0"
github "mattgallagher/CwlPreconditionTesting" "2.1.0"
8 changes: 4 additions & 4 deletions Nimble.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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";
Expand Down Expand Up @@ -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";
Expand All @@ -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";
Expand Down Expand Up @@ -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;
Expand Down
13 changes: 2 additions & 11 deletions script/release
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ POD_NAME=Nimble
PODSPEC=Nimble.podspec

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

function help {
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -178,14 +168,15 @@ 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 ================"
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"
Expand Down
2 changes: 1 addition & 1 deletion test
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 390f387

Please sign in to comment.