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
67 changes: 40 additions & 27 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,35 +13,48 @@ jobs:
name: build-example-ios
runs-on: macos-latest
steps:
- name: Set up Ruby
uses: ruby/setup-ruby@v1
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Setup Node
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
ruby-version: '2.7.4'
- name: Checkout
uses: actions/checkout@v3
- name: Install modules
run: yarn
- name: Install example
run: yarn bootstrap
- name: Build
run: cd example/ios && xcodebuild -workspace CameraKitExample.xcworkspace -configuration Debug -scheme CameraKitExample -sdk iphoneos build CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO
cache: 'yarn'

- name: Install dependencies
run: |
yarn
yarn bootstrap

- name: Rock Remote Build - iOS simulator
uses: callstackincubator/ios@041de517c0d8ddaff73bd62c33b9f5d77ed578d4 # v3
with:
destination: simulator
scheme: CameraKitExample
configuration: Debug
github-token: ${{ secrets.GITHUB_TOKEN }}
working-directory: example

build-example-android:
name: build-example-android
runs-on: ubuntu-latest # using linux runner for speed
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v4
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Setup Node
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
cache: 'yarn'

- name: Install dependencies
run: |
yarn
yarn bootstrap-linux

- name: Rock Remote Build - Android
uses: callstackincubator/android@3c81e08edf2fb43bd97267f223729b989661a25d # v3
with:
java-version: '17'
distribution: 'zulu'
cache: 'gradle'
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
- name: Install modules
run: yarn
- name: Install example
run: yarn bootstrap-linux
- name: Build
run: cd example/android && ./gradlew assembleDebug
variant: debug
working-directory: example
github-token: ${{ secrets.GITHUB_TOKEN }}
3 changes: 3 additions & 0 deletions example/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,6 @@ yarn-error.log
!.yarn/releases
!.yarn/sdks
!.yarn/versions

# Rock
.rock/
2 changes: 1 addition & 1 deletion example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ react {
// The folder where the react-native Codegen package is. Default is ../../node_modules/@react-native/codegen
// codegenDir = file("../../node_modules/@react-native/codegen")
// The cli.js file which is the React Native CLI entrypoint. Default is ../../node_modules/react-native/cli.js
// cliFile = file("../../node_modules/react-native/cli.js")
cliFile = file("../../node_modules/rock/dist/src/bin.js")

/* Variants */
// The list of variants to that are debuggable. For those we're going to
Expand Down
2 changes: 1 addition & 1 deletion example/android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
pluginManagement { includeBuild("../node_modules/@react-native/gradle-plugin") }
plugins { id("com.facebook.react.settings") }
extensions.configure(com.facebook.react.ReactSettingsExtension){ ex -> ex.autolinkLibrariesFromCommand() }
extensions.configure(com.facebook.react.ReactSettingsExtension){ ex -> ex.autolinkLibrariesFromCommand(['npx', 'rock', 'config', '-p', 'android']) }
rootProject.name = 'CameraKitExample'
include ':app'
includeBuild('../node_modules/@react-native/gradle-plugin')
2 changes: 1 addition & 1 deletion example/ios/CameraKitExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "set -e\n\nWITH_ENVIRONMENT=\"$REACT_NATIVE_PATH/scripts/xcode/with-environment.sh\"\nREACT_NATIVE_XCODE=\"$REACT_NATIVE_PATH/scripts/react-native-xcode.sh\"\n\n/bin/sh -c \"$WITH_ENVIRONMENT $REACT_NATIVE_XCODE\"\n";
shellScript = "set -e\nif [[ -f \"$PODS_ROOT/../.xcode.env\" ]]; then\nsource \"$PODS_ROOT/../.xcode.env\"\nfi\nif [[ -f \"$PODS_ROOT/../.xcode.env.local\" ]]; then\nsource \"$PODS_ROOT/../.xcode.env.local\"\nfi\nexport CONFIG_CMD=\"dummy-workaround-value\"\nexport CLI_PATH=\"$(\"$NODE_BINARY\" --print \"require('path').dirname(require.resolve('rock/package.json')) + '/dist/src/bin.js'\")\"\nWITH_ENVIRONMENT=\"$REACT_NATIVE_PATH/scripts/xcode/with-environment.sh\"\n";
};
7AE0101032D021A93E0531B9 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
Expand Down
2 changes: 1 addition & 1 deletion example/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if linkage != nil
end

target 'CameraKitExample' do
config = use_native_modules!
config = use_native_modules!(['npx', 'rock', 'config', '-p', 'ios'])

use_react_native!(
:path => config[:reactNativePath],
Expand Down
Loading