From 6cdffa57c925f60ccbe0dd9e431642f0912776ac Mon Sep 17 00:00:00 2001 From: Rachel Brindle Date: Mon, 18 Dec 2023 22:39:47 -0800 Subject: [PATCH] Build the carthage frameworks in a github action --- .github/workflows/carthage.yml | 26 ++++++++++++++++++++++++++ script/release | 13 ++----------- 2 files changed, 28 insertions(+), 11 deletions(-) create mode 100644 .github/workflows/carthage.yml diff --git a/.github/workflows/carthage.yml b/.github/workflows/carthage.yml new file mode 100644 index 000000000..81eaf5989 --- /dev/null +++ b/.github/workflows/carthage.yml @@ -0,0 +1,26 @@ +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: | + carthage build --archive --use-xcframeworks + 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 + Nimble.framework.zip 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"