Skip to content

Commit

Permalink
iOS CI Release on macos-12 (#690)
Browse files Browse the repository at this point in the history
* Draft ios.yml

* Fix indentation

* Update ios.yml

* Build app for release

* Fix prod build error w Flipper, set env flag

Issue
- reactwg/react-native-releases#21 (comment)
- facebook/react-native#33764
PR
- facebook/react-native#33882

* Remove stale comment

* Temporarily add `npx react-native info`

* Move `npx react-native info` after `yarn`

* Add release bundle step before build

* Update bundle script

* Update bundle script

* Update RN CLI from next (8.0.0-alpha.0) to 9.0.0-alpha.5

* Remove devDep @react-native-community/cli

No luck with 9.0.0-alpha.5

Should now use npm:9.0.0-alpha.4 (via npm:^9.0.0-alpha.3)

* Try bundling also to ios/MyApp/main.jsbundle

* Add debug before release bundle/build

* Fix yarn lockfile/cache conflict res

* Add normal pod install before debug

* Comment debug pod install and build, working fine

* Update pbxproj and xcscheme

Follow-up:
- facebook/react-native#34274 (comment)

Also update parts in-line with current main
- https://github.com/facebook/react-native/tree/main/template

* Disable Metro experimentalImportSupport

* Resolve Yarn lockfile

From conflict res

* Rename xcode.env prefix _ to .

* Remove react-native-flipper

* Revert "Remove react-native-flipper"

This reverts commit 646dd74.

* Revert "Rename xcode.env prefix _ to ."

This reverts commit 8f15810.

* Revert "Disable Metro experimentalImportSupport"

This reverts commit 41ed14b.

* Add index.js for iOS Release bundling

* Add back @react-native-community/cli 9.0.0-alpha.5

* Revert "Try bundling also to ios/MyApp/main.jsbundle"

This reverts commit 80e7354.

* Revert "Comment debug pod install and build, working fine"

This reverts commit 0ea4d01.

* Update workflow comments
  • Loading branch information
leotm authored Aug 5, 2022
1 parent 19aac8b commit fd823fd
Show file tree
Hide file tree
Showing 56 changed files with 119 additions and 728 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/ios.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: iOS CI with Xcode

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build-ios:

runs-on: macos-12

# ruby: 2.7.6, 3.0.4, 3.1.2 (../.ruby-version: 2.7.5)
# CocoaPods: 1.11.3

steps:

- uses: actions/checkout@v3

# - uses: mikehardy/buildcache-action@v1

# yarn cache
# node_modules cache

- name: Install all project dependencies
run: yarn

- name: npx react-native info
run: npx react-native info

# - uses: ruby/setup-ruby@v1
# with:
# bundler-cache: true # bundle install and cache installed gems automatically
# - run: bundle exec rake

# - uses: setup/cocoapods # cache

- name: Install pods
run: cd ios && pod install && cd ..

- name: Build app for Debug
run: npx react-native run-ios --configuration Debug

# - name: Xcode clean
# run: xcodebuild clean

- name: Install pods (prod)
run: cd ios && PRODUCTION=1 pod install && cd ..
# --repo-update
# --clean-install

- name: Bundle app for release
run: npx react-native bundle --entry-file='index.ts' --bundle-output='./ios/main.jsbundle' --dev=false --platform='ios' --assets-dest='./ios'

- name: Build app for release
run: npx react-native run-ios --configuration Release
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed .yarn/cache/ob1-npm-0.70.2-1b23ee5270-e36d9e7729.zip
Binary file not shown.
Binary file removed .yarn/cache/ob1-npm-0.70.3-b86ecc9472-5053160676.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
11 changes: 11 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**
* Use index.ts
* Only here for iOS Release build bundling
*/

import { AppRegistry } from 'react-native'

import { name } from './app.json'
import Root from './src'

AppRegistry.registerComponent(name, () => Root)
6 changes: 1 addition & 5 deletions ios/MyApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
008F07F21AC5B25A0029DE68 /* main.jsbundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = main.jsbundle; sourceTree = "<group>"; };
00E356EE1AD99517003FC87E /* MyAppTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = MyAppTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
00E356F21AD99517003FC87E /* MyAppTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MyAppTests.m; sourceTree = "<group>"; };
Expand All @@ -44,7 +43,6 @@
B3561C4B24410BD300AE4B32 /* MyApp-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "MyApp-Bridging-Header.h"; sourceTree = "<group>"; };
B36B6748266D0E86007CD52E /* Launch Screen.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = "Launch Screen.storyboard"; path = "/Users/leo/Documents/GitHub/LeoTMApp/ios/Launch Screen.storyboard"; sourceTree = "<absolute>"; };
ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
ED2971642150620600B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS12.0.sdk/System/Library/Frameworks/JavaScriptCore.framework; sourceTree = DEVELOPER_DIR; };
F52DFF8E484078E0BFF2BDBE /* Pods-MyApp-MyAppTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MyApp-MyAppTests.debug.xcconfig"; path = "Target Support Files/Pods-MyApp-MyAppTests/Pods-MyApp-MyAppTests.debug.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */

Expand Down Expand Up @@ -89,7 +87,6 @@
isa = PBXGroup;
children = (
B36B6748266D0E86007CD52E /* Launch Screen.storyboard */,
008F07F21AC5B25A0029DE68 /* main.jsbundle */,
13B07FAF1A68108700A75B9A /* AppDelegate.h */,
13B07FB01A68108700A75B9A /* AppDelegate.mm */,
13B07FB51A68108700A75B9A /* Images.xcassets */,
Expand All @@ -104,7 +101,6 @@
isa = PBXGroup;
children = (
ED297162215061F000B7C4FE /* JavaScriptCore.framework */,
ED2971642150620600B7C4FE /* JavaScriptCore.framework */,
7FF4B8C4D42B2E7AC629DD93 /* libPods-MyApp.a */,
39C30EA5EC35B0DE95DF8892 /* libPods-MyApp-MyAppTests.a */,
);
Expand Down Expand Up @@ -205,7 +201,7 @@
83CBB9F71A601CBA00E9B192 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1130;
LastUpgradeCheck = 1210;
ORGANIZATIONNAME = LeoTM;
TargetAttributes = {
00E356ED1AD99517003FC87E = {
Expand Down
2 changes: 1 addition & 1 deletion ios/MyApp.xcodeproj/xcshareddata/xcschemes/MyApp.xcscheme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1130"
LastUpgradeVersion = "1210"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"@babel/runtime": "7.18.9",
"@curveball/core": "0.19.0",
"@curveball/router": "0.4.1",
"@react-native-community/cli": "next",
"@react-native-community/cli": "9.0.0-alpha.5",
"@react-native-community/eslint-config": "3.0.3",
"@storybook/addon-actions": "6.5.10",
"@storybook/addon-controls": "6.5.10",
Expand Down
Loading

0 comments on commit fd823fd

Please sign in to comment.