Skip to content

Commit

Permalink
Build the carthage frameworks in a github action
Browse files Browse the repository at this point in the history
  • Loading branch information
younata committed Dec 20, 2023
1 parent ebe9d80 commit f0247cb
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 11 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
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: |
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
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

0 comments on commit f0247cb

Please sign in to comment.