Skip to content
Merged
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
185 changes: 185 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
name: React Native

on:
pull_request:
branches: [master]

env:
EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
EXPO_APPLE_ID: ${{ secrets.EXPO_APPLE_ID }}
EXPO_APPLE_PASSWORD: ${{ secrets.EXPO_APPLE_PASSWORD }}
EXPO_TEAM_ID: ${{ secrets.EXPO_TEAM_ID }}
NODE_OPTIONS: --openssl-legacy-provider

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: 🏗 Checkout repository
uses: actions/checkout@v4

- name: 🏗 Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: "yarn"

- name: 📦 Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT

- name: 📦 Setup yarn cache
uses: actions/cache@v3
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-

- name: 📦 Install dependencies
run: yarn install

- name: 🧪 Run TypeScript check
run: yarn tsc

- name: 🧹 Run ESLint
run: yarn lint

build-android:
needs: lint
runs-on: ubuntu-latest
steps:
- name: 🏗 Checkout repository
uses: actions/checkout@v4

- name: 🏗 Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: "yarn"

- name: 📦 Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT

- name: 📦 Setup yarn cache
uses: actions/cache@v3
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-

- name: 📦 Install dependencies
run: yarn install

- name: 🔄 Verify EAS CLI installation
run: |
echo "EAS CLI version:"
yarn dlx eas-cli@latest --version

- name: 📋 Fix package.json main entry
working-directory: ./example
run: |
# EAS local builds require `main` to be "node_modules/expo/AppEntry.js".
# The checked-in value ("index.ts") works for local dev with Metro/Expo Go
# but causes EAS to fail to resolve the entry point during a local build.
# Check if jq is installed, if not install it
if ! command -v jq &> /dev/null; then
echo "Installing jq..."
sudo apt-get update && sudo apt-get install -y jq
fi

# Fix the main entry in package.json
if [ -f ./package.json ]; then
# Create a backup
cp package.json package.json.bak
# Update the package.json
jq '.main = "node_modules/expo/AppEntry.js"' package.json > package.json.tmp && mv package.json.tmp package.json
echo "Updated package.json main entry"
cat package.json | grep "main"
else
echo "package.json not found"
exit 1
fi

- name: 📱 Build Android Dev .apk
working-directory: ./example
run: |
export NODE_OPTIONS="--openssl-legacy-provider --max_old_space_size=4096"
yarn dlx eas-cli@latest build --platform android --profile development --local --non-interactive --output=./app-dev.apk
env:
NODE_ENV: development

- name: 📦 Upload build artifact to GitHub
uses: actions/upload-artifact@v4
with:
name: app-builds-android
path: ./example/app-dev.apk
retention-days: 7

build-ios:
needs: lint
runs-on: macos-latest
steps:
- name: 🏗 Checkout repository
uses: actions/checkout@v4

- name: 🏗 Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: "yarn"

- name: 📦 Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT

- name: 📦 Setup yarn cache
uses: actions/cache@v3
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-

- name: 📦 Install dependencies
run: yarn install

- name: 🔄 Verify EAS CLI installation
run: |
echo "EAS CLI version:"
yarn dlx eas-cli@latest --version

- name: 📋 Fix package.json main entry
working-directory: ./example
run: |
# EAS local builds require `main` to be "node_modules/expo/AppEntry.js".
# The checked-in value ("index.ts") works for local dev with Metro/Expo Go
# but causes EAS to fail to resolve the entry point during a local build.
if [ -f ./package.json ]; then
# Create a backup
cp package.json package.json.bak
# Update the package.json
jq '.main = "node_modules/expo/AppEntry.js"' package.json > package.json.tmp && mv package.json.tmp package.json
echo "Updated package.json main entry"
cat package.json | grep "main"
else
echo "package.json not found"
exit 1
fi

- name: 📱 Build iOS Dev .app
working-directory: ./example
run: |
export NODE_OPTIONS="--openssl-legacy-provider --max_old_space_size=4096"
yarn dlx eas-cli@latest build --platform ios --profile development --local --non-interactive --output=./app-ios-dev.app
env:
NODE_ENV: development

- name: 📦 Upload build artifact to GitHub
uses: actions/upload-artifact@v4
with:
name: app-builds-ios
path: ./example/app-ios-dev.app
retention-days: 7
75 changes: 75 additions & 0 deletions .github/workflows/update-ios-sdk.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Update iOS SDK

on:
workflow_dispatch:
inputs:
version:
description: 'iOS SDK version (e.g., 3.27.2)'
required: true
type: string
workflow_call:
inputs:
version:
description: 'iOS SDK version (e.g., 3.27.2)'
required: true
type: string

jobs:
update-ios-sdk:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write

steps:
- name: Determine version
id: version
env:
INPUT_VERSION: ${{ inputs.version }}
run: |
VERSION="${INPUT_VERSION#v}"
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
echo "branch=chore/update-ios-sdk-${VERSION}" >> "$GITHUB_OUTPUT"

Comment thread
brax10ward marked this conversation as resolved.
- uses: actions/checkout@v4
with:
ref: master

- name: Update iOS SDK frameworks
env:
VERSION: ${{ steps.version.outputs.version }}
run: ./scripts/update-ios-sdk.sh "$VERSION"

- name: Check for changes
id: changes
run: |
if git diff --quiet && git diff --cached --quiet; then
echo "has_changes=false" >> "$GITHUB_OUTPUT"
else
echo "has_changes=true" >> "$GITHUB_OUTPUT"
fi

- name: Create Pull Request
if: steps.changes.outputs.has_changes == 'true'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${{ steps.version.outputs.version }}
BRANCH: ${{ steps.version.outputs.branch }}
run: |

git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"

git checkout -b "$BRANCH"
git add ios/frameworks/ atomicfi-transact-react-native.podspec
git commit -m "chore: upgrade iOS SDK to ${VERSION}"
git push origin "$BRANCH"

gh pr create \
--title "chore: upgrade iOS SDK to ${VERSION}" \
--body "Automated upgrade of vendored iOS XCFrameworks to version ${VERSION}.

**Release notes**: https://github.com/atomicfi/atomic-transact-ios/releases/tag/${VERSION}" \
--base master \
--head "$BRANCH" \
--reviewer atomicfi/sdk
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -86,5 +86,3 @@ android/keystores/debug.keystore
# generated by bob
lib/

# frameworks
ios/frameworks/
10 changes: 7 additions & 3 deletions atomicfi-transact-react-native.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,23 @@ Pod::Spec.new do |s|
s.platforms = { :ios => "13.0" }
s.source = { :git => "https://github.com/atomicfi/atomic-transact-react-native.git", :tag => "#{s.version}" }

s.source_files = "ios/**/*.{h,m,mm,swift}"
s.source_files = "ios/*.{h,m,mm,swift}"

s.vendored_frameworks = [
"ios/frameworks/AtomicTransact.xcframework",
"ios/frameworks/MuppetIOS.xcframework",
"ios/frameworks/QuantumIOS.xcframework"
]

# Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
# See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79.
if respond_to?(:install_modules_dependencies, true)
install_modules_dependencies(s)
s.dependency "AtomicSDK", "3.26.0"
s.pod_target_xcconfig = {
"DEFINES_MODULE" => "YES",
}
else
s.dependency "React-Core"
s.dependency "AtomicSDK", "3.27.1"

# Don't install the dependencies when we run `pod install` in the old architecture.
if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
Expand Down
15 changes: 12 additions & 3 deletions example/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@
},
"ios": {
"supportsTablet": true,
"bundleIdentifier": "com.atomicfi.transact.example"
"bundleIdentifier": "com.atomicfi.transact.example",
"infoPlist": {
"ITSAppUsesNonExemptEncryption": false
}
},
"android": {
"adaptiveIcon": {
Expand All @@ -32,6 +35,12 @@
],
"developmentClient": {
"silentLaunch": false
}
},
"extra": {
"eas": {
"projectId": "91cfcf2c-8510-4834-b9ca-8444a34104a4"
}
},
"owner": "atomicfi"
}
}
}
1 change: 1 addition & 0 deletions ios/frameworks/.sdk-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.27.2
44 changes: 44 additions & 0 deletions ios/frameworks/AtomicTransact.xcframework/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AvailableLibraries</key>
<array>
<dict>
<key>BinaryPath</key>
<string>AtomicTransact.framework/AtomicTransact</string>
<key>LibraryIdentifier</key>
<string>ios-arm64</string>
<key>LibraryPath</key>
<string>AtomicTransact.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
</dict>
<dict>
<key>BinaryPath</key>
<string>AtomicTransact.framework/AtomicTransact</string>
<key>LibraryIdentifier</key>
<string>ios-arm64_x86_64-simulator</string>
<key>LibraryPath</key>
<string>AtomicTransact.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
</array>
<key>CFBundlePackageType</key>
<string>XFWK</string>
<key>XCFrameworkFormatVersion</key>
<string>1.0</string>
</dict>
</plist>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Loading