Skip to content
Open
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
73 changes: 26 additions & 47 deletions .github/workflows/build-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,78 +19,57 @@ on:
- 'example/yarn.lock'

jobs:

build_example:
name: Build Android Example App
name: Build Android Example App with new arch enabled
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install node
uses: actions/setup-node@v3
with:
node-version: 18

- name: Setup JDK 17
uses: actions/setup-java@v2
with:
java-version: 17
distribution: 'temurin'

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Restore node_modules from cache
uses: actions/cache@v2
id: yarn-cache
- name: Setup Node.js
uses: actions/setup-node@v4
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install node_modules
run: yarn install --frozen-lockfile
- name: Install node_modules for example/
run: yarn install --frozen-lockfile --cwd example

- name: Restore Gradle cache
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Run Gradle Build for example/android/
run: cd example/android && ./gradlew assembleDebug --build-cache && cd ../..
build_example_new_arch:
name: Build Android Example App with new arch enabled
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
node-version: 18

- name: Setup JDK 17
uses: actions/setup-java@v2
with:
java-version: 17
distribution: 'temurin'
- name: Enable Corepack
run: corepack enable

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
run: |
if command -v yarn &> /dev/null; then
CACHE_DIR=$(yarn config get cacheFolder 2>/dev/null || yarn cache dir 2>/dev/null || echo "")
if [ -z "$CACHE_DIR" ]; then
CACHE_DIR="$HOME/.yarn/cache"
fi
else
CACHE_DIR="$HOME/.yarn/cache"
fi
echo "dir=$CACHE_DIR" >> $GITHUB_OUTPUT
- name: Restore node_modules from cache
uses: actions/cache@v2
uses: actions/cache@v5
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
path: |
${{ steps.yarn-cache-dir-path.outputs.dir }}
node_modules
example/node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install node_modules
run: yarn install --frozen-lockfile
- name: Install node_modules for example/
run: yarn install --frozen-lockfile --cwd example
run: yarn install --frozen-lockfile

- name: Restore Gradle cache
uses: actions/cache@v2
uses: actions/cache@v5
with:
path: |
~/.gradle/caches
Expand All @@ -99,4 +78,4 @@ jobs:
restore-keys: |
${{ runner.os }}-gradle-
- name: Run Gradle Build for example/android/
run: cd example/android && ./gradlew assembleDebug -PnewArchEnabled=true --build-cache && cd ../..
run: cd example/android && ./gradlew assembleDebug --build-cache && cd ../..
121 changes: 35 additions & 86 deletions .github/workflows/build-ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,103 +19,58 @@ on:
jobs:
build:
name: Build iOS Example App
runs-on: macOS-13
runs-on: macOS-latest
defaults:
run:
working-directory: example/ios
steps:
- uses: actions/checkout@v4
- name: Install node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 18
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Restore node_modules from cache
uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install node_modules for example/
run: yarn install --frozen-lockfile --cwd ..

- name: Restore buildcache
uses: mikehardy/buildcache-action@v1
continue-on-error: true

- name: Setup Ruby (bundle)
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
bundler-cache: true
working-directory: example

- name: Restore Pods cache
uses: actions/cache@v2
- name: Enable Corepack
run: corepack enable

- name: Setup xcode
uses: maxim-lobanov/setup-xcode@v1
with:
path: |
example/ios/Pods
~/Library/Caches/CocoaPods
~/.cocoapods
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
restore-keys: |
${{ runner.os }}-pods-
- name: Install Pods
run: pod install
- name: Install xcpretty
run: gem install xcpretty
- name: Build App
run: "set -o pipefail && xcodebuild \
CC=clang CPLUSPLUS=clang++ LD=clang LDPLUSPLUS=clang++ \
-derivedDataPath build -UseModernBuildSystem=YES \
-workspace example.xcworkspace \
ONLY_ACTIVE_ARCH=NO \
-scheme example \
-sdk iphonesimulator \
-configuration Debug \
-destination 'platform=iOS Simulator,name=iPhone 11 Pro' \
build \
CODE_SIGNING_ALLOWED=NO | xcpretty"
build_new_arch:
name: Build iOS Example App with new arch enabled
runs-on: macOS-13
defaults:
run:
working-directory: example/ios
steps:
- uses: actions/checkout@v4
xcode-version: 16.4.0

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
run: |
if command -v yarn &> /dev/null; then
CACHE_DIR=$(yarn config get cacheFolder 2>/dev/null || yarn cache dir 2>/dev/null || echo "")
if [ -z "$CACHE_DIR" ]; then
CACHE_DIR="$HOME/.yarn/cache"
fi
else
CACHE_DIR="$HOME/.yarn/cache"
fi
echo "dir=$CACHE_DIR" >> $GITHUB_OUTPUT
- name: Restore node_modules from cache
uses: actions/cache@v2
uses: actions/cache@v5
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
path: |
${{ steps.yarn-cache-dir-path.outputs.dir }}
node_modules
example/node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install node_modules for example/
run: yarn install --frozen-lockfile --cwd ..

- name: Restore buildcache
uses: mikehardy/buildcache-action@v1
continue-on-error: true

run: yarn install --frozen-lockfile
- name: Setup Ruby (bundle)
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
bundler-cache: true
ruby-version: 3.2
working-directory: example

- name: Restore Pods cache
uses: actions/cache@v2
uses: actions/cache@v5
with:
path: |
example/ios/Pods
Expand All @@ -124,19 +79,13 @@ jobs:
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
restore-keys: |
${{ runner.os }}-pods-
- name: Install Pods
run: RCT_NEW_ARCH_ENABLED=1 pod install
- name: Install xcpretty
run: gem install xcpretty
- name: Build App
run: "set -o pipefail && xcodebuild \
CC=clang CPLUSPLUS=clang++ LD=clang LDPLUSPLUS=clang++ \
-derivedDataPath build -UseModernBuildSystem=YES \
-workspace example.xcworkspace \
ONLY_ACTIVE_ARCH=NO \
-scheme example \
-sdk iphonesimulator \
-configuration Debug \
-destination 'platform=iOS Simulator,name=iPhone 11 Pro' \
build \
CODE_SIGNING_ALLOWED=NO | xcpretty"
run: |
bundle install
RCT_USE_RN_DEP=1 RCT_USE_PREBUILT_RNCORE=1 bundle exec pod install
xcodebuild build \
-workspace BlurhashExample.xcworkspace \
-scheme BlurhashExample \
-sdk iphonesimulator


7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ DerivedData
*.ipa
*.xcuserstate
project.xcworkspace
.cxx/

# Android/IntelliJ
#
Expand All @@ -43,3 +44,9 @@ buck-out/

# generated by bob
lib/

# cocoapods
Pods/
Podfile.lock
Podfile.lock.lock
bundle/
Binary file added .yarn/install-state.gz
Binary file not shown.
1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
Empty file added app.txt
Empty file.
66 changes: 0 additions & 66 deletions example/.gitignore

This file was deleted.

7 changes: 0 additions & 7 deletions example/.prettierrc.js

This file was deleted.

13 changes: 11 additions & 2 deletions example/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,14 @@ source 'https://rubygems.org'
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
ruby ">= 2.6.10"

gem 'cocoapods', '~> 1.13'
gem 'activesupport', '>= 6.1.7.3', '< 7.1.0'
# Exclude problematic versions of cocoapods and activesupport that causes build failures.
gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1'
gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0'
gem 'xcodeproj', '< 1.26.0'
gem 'concurrent-ruby', '< 1.3.4'

# Ruby 3.4.0 has removed some libraries from the standard library.
gem 'bigdecimal'
gem 'logger'
gem 'benchmark'
gem 'mutex_m'
Loading
Loading