Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
52 changes: 52 additions & 0 deletions .github/actions/build-xcframework/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Build XCFramework
description: Build XCFramework for iOS and iOS Simulator

inputs:
project_name:
description: Name of the Xcode project or scheme
required: true

outputs:
xcframework_path:
description: Final path to the generated XCFramework
value: ${{ steps.build.outputs.xcframework_path }}

runs:
using: "composite"
steps:
- name: Build XCFramework
id: build
shell: bash
run: |
set -euo pipefail

PROJECT_NAME="${{ inputs.project_name }}"
BUILD_DIR="./build"

echo "🛠️ Building XCFramework..."

xcodebuild archive \
-scheme "$PROJECT_NAME" \
-configuration Release \
-destination 'generic/platform=iOS Simulator' \
-archivePath "$BUILD_DIR/${PROJECT_NAME}.framework-iphonesimulator.xcarchive" \
SKIP_INSTALL=NO \
BUILD_LIBRARIES_FOR_DISTRIBUTION=YES | xcbeautify

xcodebuild archive \
-scheme "$PROJECT_NAME" \
-configuration Release \
-destination 'generic/platform=iOS' \
-archivePath "$BUILD_DIR/${PROJECT_NAME}.framework-iphoneos.xcarchive" \
SKIP_INSTALL=NO \
BUILD_LIBRARIES_FOR_DISTRIBUTION=YES | xcbeautify

XCFRAMEWORK_PATH="$BUILD_DIR/${PROJECT_NAME}.xcframework"

xcodebuild -create-xcframework \
-framework "$BUILD_DIR/${PROJECT_NAME}.framework-iphonesimulator.xcarchive/Products/Library/Frameworks/${PROJECT_NAME}.framework" \
-framework "$BUILD_DIR/${PROJECT_NAME}.framework-iphoneos.xcarchive/Products/Library/Frameworks/${PROJECT_NAME}.framework" \
-output "$XCFRAMEWORK_PATH"

echo "✅ XCFramework built successfully"
echo "xcframework_path=$XCFRAMEWORK_PATH" >> "$GITHUB_OUTPUT"
45 changes: 45 additions & 0 deletions .github/actions/get-project-version/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Get Project Version
description: Extracts MARKETING_VERSION from a .pbxproj file

inputs:
project_name:
description: Name of the Xcode project (without .xcodeproj)
required: false
pbxproj_path:
description: Path to the project.pbxproj file (overrides project_name if provided)
required: false

outputs:
version:
description: The extracted project version
value: ${{ steps.extract.outputs.version }}

runs:
using: "composite"
steps:
- name: Extract current project version
id: extract
shell: bash
run: |
set -euo pipefail

# Determine the pbxproj path
if [[ -n "${{ inputs.pbxproj_path }}" ]]; then
PBXPROJ="${{ inputs.pbxproj_path }}"
elif [[ -n "${{ inputs.project_name }}" ]]; then
PBXPROJ="${{ inputs.project_name }}.xcodeproj/project.pbxproj"
else
echo "❌ Either 'project_name' or 'pbxproj_path' must be provided."
exit 1
fi

# Check if the pbxproj file exists
if [[ ! -f "$PBXPROJ" ]]; then
echo "❌ Project file not found: $PBXPROJ"
exit 1
fi

echo "📦 Extracting current MARKETING_VERSION from $PBXPROJ..."
VERSION=$(grep -m1 'MARKETING_VERSION =' "$PBXPROJ" | sed -E 's/.*MARKETING_VERSION = ([^;]+);/\1/' | xargs)
echo "🔢 Current version: $VERSION"
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
50 changes: 50 additions & 0 deletions .github/actions/install-dependencies/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Install Dependencies
description: Checks for Homebrew and installs any missing CLI tools and Ruby gems

inputs:
tools:
description: Space-separated list of tools to check and install via Homebrew
required: false
gems:
description: Space-separated list of gems to check and install via gem
required: false

runs:
using: "composite"
steps:
- name: Install Dependencies
shell: bash
run: |
set -euo pipefail

if [ -n "${{ inputs.tools }}" ]; then
echo "🔍 Checking for Homebrew..."
if ! command -v brew >/dev/null; then
echo "❌ Homebrew is required but not installed. Aborting."
exit 1
fi

echo "🔧 Installing missing brew tools..."
for tool in ${{ inputs.tools }}; do
if command -v "$tool" >/dev/null; then
echo "✅ $tool is already installed."
else
echo "📦 Installing $tool via brew..."
brew install "$tool"
fi
done
fi

if [ -n "${{ inputs.gems }}" ]; then
echo "🔧 Installing missing gems..."
for gem in ${{ inputs.gems }}; do
if gem list -i "$gem" >/dev/null; then
echo "✅ $gem gem is already installed."
else
echo "💎 Installing $gem via gem..."
gem install "$gem"
fi
done
fi

echo "✅ All dependencies are ready."
34 changes: 34 additions & 0 deletions .github/actions/package-xcframework/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Package XCFramework and LICENSE
description: Zips the built XCFramework and LICENSE into a versioned release artifact

inputs:
package_name:
description: The name of the package (e.g., MyLibrary-1.0.0)
required: true
xcframework_path:
description: The path to the built .xcframework
required: true
license_path:
description: The path to the LICENSE file
required: true

outputs:
zip_name:
description: The name of the created zip file
value: ${{ steps.package.outputs.zip_name }}

runs:
using: "composite"
steps:
- id: package
shell: bash
run: |
set -euo pipefail
ZIP_NAME="${{ inputs.package_name }}.zip"
mkdir -p release
cp -R "${{ inputs.xcframework_path }}" release/
cp "${{ inputs.license_path }}" release/
cd release
zip -r "../$ZIP_NAME" .
echo "✅ Packaged XCFramework and LICENSE into $ZIP_NAME"
echo "zip_name=$ZIP_NAME" >> "$GITHUB_OUTPUT"
18 changes: 18 additions & 0 deletions .github/actions/set-xcode-version/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Set Xcode Version
description: Selects the desired Xcode version using xcode-select.
inputs:
xcode-version:
description: The Xcode version to select (e.g., 16.4)
required: true
runs:
using: 'composite'
steps:
- run: |
set -e
echo "Setting Xcode version to ${{ inputs.xcode-version }}..."
if ! sudo xcode-select -s /Applications/Xcode_${{ inputs.xcode-version }}.app/Contents/Developer; then
echo "❌ Failed to select Xcode ${{ inputs.xcode-version }}. Listing available Xcodes:"
ls /Applications | grep Xcode
exit 1
fi
shell: bash
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
- [ ] Fix (non-breaking change which fixes an issue)
- [ ] Feature (non-breaking change which adds functionality)
- [ ] Refactor (cosmetic changes)
- [ ] Breaking change (change that would cause existing functionality not to work as expected)
- [ ] Breaking change (change that would cause existing functionality to not work as expected)

## Tests
<!--- Describe how you tested your changes in detail -->
Expand All @@ -21,7 +21,7 @@
## Checklist
<!--- Go over all the following items and put an `x` in all the boxes that apply -->
- [ ] Pull request title follows the format `RNMT-XXXX <title>`
- [ ] Code follows the code style of this project
- [ ] Code follows code style of this project
- [ ] CHANGELOG.md file is correctly updated
- [ ] Changes require an update to the documentation
- [ ] Documentation has been updated accordingly
Loading
Loading