Skip to content

Commit

Permalink
fix xcode sign style
Browse files Browse the repository at this point in the history
  • Loading branch information
ngocle2497 committed Aug 11, 2024
1 parent fe77a64 commit a4431b2
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 42 deletions.
63 changes: 28 additions & 35 deletions template/GITLABRUNNER.MD
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

You can config gitlab CI runner to create build automatically.

## Config workflow
Expand All @@ -24,7 +23,6 @@ You can config gitlab CI runner to create build automatically.
- Step 2: Add 2 variable:
- BRANCH_NAME: branch of repo want to build. ex: develop, main, ...
- BASE_ENV_ARGS: env want to build. String with "," separator. This will use for fastlane. ex: dev,prod

```

### .gitlab-ci.yml
Expand All @@ -38,13 +36,13 @@ default:
- macos_shared

variables:
GIT_CLEAN_FLAGS: "none"
GIT_CLEAN_FLAGS: 'none'
# BRANCH_NAME: "develop"
FASTLANE_SCRIPT_ANDROID: "bundle exec fastlane android"
FASTLANE_SCRIPT_IOS: "bundle exec fastlane ios"
FASTLANE_SCRIPT_ANDROID: 'bundle exec fastlane android'
FASTLANE_SCRIPT_IOS: 'bundle exec fastlane ios'
# BASE_ENV_ARGS: "dev"
EXPORT_DIR_ARGS_NAME: "export_dir"
EXPORT_FOLDER: "export/$BRANCH_NAME"
EXPORT_DIR_ARGS_NAME: 'export_dir'
EXPORT_FOLDER: 'export/$BRANCH_NAME'

clone-code-project:
stage: clone
Expand Down Expand Up @@ -97,7 +95,7 @@ build-android:
- fnm use $NODE_VERSION
script:
- echo "sdk.dir=$ANDROID_HOME" > android/local.properties
- npx ts-node build_script/build-android.ts $BASE_ENV_ARGS $EXPORT_FOLDER
- node build-ci/build-android.js $BASE_ENV_ARGS $EXPORT_FOLDER
needs:
- job: install-dependencies
allow_failure: true
Expand All @@ -108,7 +106,7 @@ deploy-android:
- echo "Deploy android app ..."
- cd repo/$BRANCH_NAME
script:
- npx ts-node build_script/deploy-android.ts $BASE_ENV_ARGS $EXPORT_FOLDER
- node build-ci/deploy-android.js $BASE_ENV_ARGS $EXPORT_FOLDER
needs:
- job: build-android
allow_failure: true
Expand All @@ -120,7 +118,7 @@ build-ios:
- cd repo/$BRANCH_NAME
- fnm use $NODE_VERSION
script:
- npx ts-node build_script/build-ios.ts $BASE_ENV_ARGS $EXPORT_FOLDER
- node build-ci/build-ios.js $BASE_ENV_ARGS $EXPORT_FOLDER
needs:
- job: install-dependencies
allow_failure: true
Expand All @@ -131,7 +129,7 @@ deploy-ios:
- echo "Deploy ios app ..."
- cd repo/$BRANCH_NAME
script:
- npx ts-node build_script/deploy-ios.ts $BASE_ENV_ARGS $EXPORT_FOLDER
- node build-ci/deploy-ios.js $BASE_ENV_ARGS $EXPORT_FOLDER
needs:
- job: build-ios
allow_failure: true
Expand All @@ -154,7 +152,6 @@ clean-up:
script:
- rm -rf $BRANCH_NAME
needs: [release, deploy-ios, deploy-android]

```
### pull_repo.sh
Expand All @@ -168,9 +165,9 @@ mkdir -p repo/$branch
cd repo/$branch
rm -rf fastlane
git clone $repo -b $branch .
# copy fastlane and build_script to $branch folder
# copy fastlane and build-ci to $branch folder
cp -r ../../fastlane .
cp -r ../../build_script .
cp -r ../../build-ci .

```

Expand Down Expand Up @@ -203,9 +200,9 @@ done

### build-ci

#### build-android.ts
#### build-android.js

```ts
```js
import { execSync } from 'child_process';

(() => {
Expand All @@ -231,12 +228,11 @@ import { execSync } from 'child_process';
);
});
})();

```

#### deploy-android.ts
#### deploy-android.js

```ts
```js
import { execSync } from 'child_process';

(() => {
Expand All @@ -255,12 +251,11 @@ import { execSync } from 'child_process';
);
});
})();

```

#### build-ios.ts
#### build-ios.js

```ts
```js
import { execSync } from 'child_process';

(() => {
Expand All @@ -279,12 +274,11 @@ import { execSync } from 'child_process';
);
});
})();

```

#### deploy-ios.ts
#### deploy-ios.js

```ts
```js
import { execSync } from 'child_process';

(() => {
Expand All @@ -303,19 +297,18 @@ import { execSync } from 'child_process';
);
});
})();

```

> Folder structure like:
.
├── fastlane
├── build-ci
│ ├── build-android.ts
│ ├── deploy-android.ts
│ ├── build-ios.ts
│ └── deploy-ios.ts
├── .gitlab-ci.yml
├── pull_repo.sh
├── release.sh
├── fastlane
├── build-ci
│ ├── build-android.js
│ ├── deploy-android.js
│ ├── build-ios.js
│ └── deploy-ios.js
├── .gitlab-ci.yml
├── pull_repo.sh
├── release.sh
└── README.md
2 changes: 2 additions & 0 deletions template/ios/HelloWorld.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,7 @@
baseConfigurationReference = 3B4392A12AC88292D35C810B /* Pods-HelloWorld.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = "$(ASSETCATALOG_COMPILER_APPICON_NAME)";
CODE_SIGN_STYLE = Manual;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 1;
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = "$(APPLE_DEVELOPMENT_TEAM)";
Expand Down Expand Up @@ -385,6 +386,7 @@
baseConfigurationReference = 5709B34CF0A7D63546082F79 /* Pods-HelloWorld.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = "$(ASSETCATALOG_COMPILER_APPICON_NAME)";
CODE_SIGN_STYLE = Manual;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 1;
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = "$(APPLE_DEVELOPMENT_TEAM)";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Release"
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
Expand All @@ -70,7 +70,7 @@
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
buildConfiguration = "Debug"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
Expand All @@ -90,7 +90,7 @@
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
buildConfiguration = "Debug"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
4 changes: 2 additions & 2 deletions template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"format": "prettier --write **/*.{ts,tsx,js,json,md}",
"splash": "node ./scripts/splash.js assets/splash/splash.png FFFFFF 150 main BootSplash",
"type:check": "yarn tsc --noEmit --skipLibCheck",
"app-icon": "npx rn-ml appicon -s assets/appicon/appicon.png",
"app-icon:dev": "npx rn-ml appicon -s assets/appicon/appicon-dev.png -f dev -icn AppIcon-Dev",
"app-icon": "npx -y rn-ml appicon -s assets/appicon/appicon.png",
"app-icon:dev": "npx -y rn-ml appicon -s assets/appicon/appicon-dev.png -f dev -icn AppIcon-Dev",
"ios:notification:dev": "node ./scripts/ios.js push-notification env/dev.json ",
"android:report": "node scripts/android.js report",
"android:hash": "node scripts/android.js hash",
Expand Down
4 changes: 2 additions & 2 deletions template/scripts/splash.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/* eslint-disable @typescript-eslint/no-var-requires */
const { execSync } = require('child_process');

const { readFileSync, rmSync, writeFileSync } = require('fs');
const { readFileSync, rmSync, writeFileSync, copyFileSync } = require('fs');
const { resolve } = require('path');

(function () {
Expand Down Expand Up @@ -61,7 +61,7 @@ const { resolve } = require('path');
'utf8',
);

execSync(`mv -f ${oldBootSplashPath} ${newBootSplashPath}`);
copyFileSync(oldBootSplashPath, newBootSplashPath);

if (oldBootSplashLogoPath !== newBootSplashLogoPath) {
execSync(`mv -f ${oldBootSplashLogoPath} ${newBootSplashLogoPath}`);
Expand Down

0 comments on commit a4431b2

Please sign in to comment.