Skip to content

Commit 114798d

Browse files
authored
chore: fixed and upgraded project setup and ci (#113)
* fixed and upgraded ci java * attempt to fix cache issue * possible fix for yarn version * enabled corepack * attempt to set global yarn version * set yarn latest and corepack to all ci files * updated ruby version * updated gemfile * attempt to fix pod install * removed flag from command * removed command * added gemfile.lock * removed gemfile.lock and added attempt to fix bad cache * attempt to fix yarn error * fixed deprecated yarn flag * added some yarn files * attempt to fix gradle lint * removed validate android, because there is no gradlew on lib * changed gradle cache approach * updated gradle version * updated dev packages and added rn cli for android * fixed rn android cli dep * replaced slow and problematic eslint and prettier with biome * fixed many lint and format issues * attempt to fix pod install * updated pod install command * tried pod-install with npx * updated build ios * fixed react import * removed corepack requirement * updated more yarn configs * regenerated yarn lock files * remove unneeded file * enabled corepack back * removed rule that does not make sense if you are auto fixing with lint * refactor repeated job part * removed property in attempt to fix install issue * removed cache pod portion of script * attempt to fix bundle path * keep default as just example * add path to paths in ios script * more ios script changes * removed podfile.lock * attempt to fix ios path * yarn changes * yarn changes * test without check * attempt to fix podfile path * ios changes * returned gemfile to previous state * tried disabling yarn cache * added env to podfile and enabled cache back * separated ios steps * reduced commands to one * attempt to fix path in podfile * removed some yarn conf * added yarn conf * updated rn to fix ios pod no longer working * added upgrade files and updated gemfile * updated gemfile * updated gemfile * fixed pbxproj * attempt to fix path issue from gradle * add android changes * fixed cd * updated android ci script * fixd build-android * removed unneeded package * testing with gradle cache disabled * updated some gradle settings and java version * fixed names in xcodebuild command * fix: lefthook and package script * chore: add commits hooks * fix: lefthook script * chore: added tests and build prepare and removed circleci * chore: some upgrade and possible last build step fixes * fix: removed bundle commands * chore: attempt to add dynamic path to ci * chore: reduced java and gradle version * fix: attempt to fix xcodebuild * chore: added some ios paths * fix: attempt to get xcodebuild working * fix: misplaced possible fix * chore: disabled flipper on podfile * chore: test new xcodebuild flags * chore: attempt replacing ios build command * chore: added xcodebuild command back * fix: added cd ios * chore: attempt podfile fix * chore: attempt fix ios build err * chore: use latest cocoapods * fix: attempt gemfile fix * chore: attempt fix from podfile * chore: removed reviewdog
1 parent b403acf commit 114798d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+11436
-13410
lines changed

.circleci/config.yml

Lines changed: 0 additions & 98 deletions
This file was deleted.

.github/actions/setup/action.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Setup
2+
description: Setup Node.js and install dependencies
3+
4+
inputs:
5+
project-path:
6+
description: "The path to the project directory (e.g., example/)"
7+
required: false
8+
9+
runs:
10+
using: composite
11+
steps:
12+
- name: Enable corepack and set yarn to latest stable
13+
shell: bash
14+
run: |
15+
corepack enable
16+
yarn set version stable
17+
18+
- name: Setup Node.js
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version: "lts/*"
22+
23+
- name: Restore dependencies
24+
id: yarn-cache
25+
uses: actions/cache/restore@v4
26+
with:
27+
path: |
28+
**/node_modules
29+
.yarn/install-state.gz
30+
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}-${{ hashFiles('**/package.json', '!node_modules/**') }}
31+
restore-keys: |
32+
${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
33+
${{ runner.os }}-yarn-
34+
35+
- name: Install dependencies
36+
working-directory: ${{ inputs.project-path }}
37+
shell: bash
38+
run: yarn install --immutable --check-cache
39+
40+
- name: Cache dependencies
41+
if: steps.yarn-cache.outputs.cache-hit != 'true'
42+
uses: actions/cache/save@v4
43+
with:
44+
path: |
45+
**/node_modules
46+
.yarn/install-state.gz
47+
key: ${{ steps.yarn-cache.outputs.cache-primary-key }}
Lines changed: 13 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,6 @@
11
name: Build Android App
22

33
on:
4-
push:
5-
branches:
6-
- master
7-
paths:
8-
- ".github/workflows/build-android.yml"
9-
- "android/**"
10-
- "example/android/**"
11-
- "yarn.lock"
12-
- "example/yarn.lock"
134
pull_request:
145
paths:
156
- ".github/workflows/build-android.yml"
@@ -24,37 +15,24 @@ jobs:
2415
runs-on: ubuntu-latest
2516
defaults:
2617
run:
27-
working-directory: example/android
18+
working-directory: example
2819
steps:
2920
- uses: actions/checkout@v4
3021

31-
- name: Setup JDK 11
22+
- name: Setup JDK 17
3223
uses: actions/setup-java@v4
3324
with:
34-
java-version: 11
25+
java-version: 17
26+
distribution: "temurin"
27+
cache: "gradle"
3528

36-
- name: Get yarn cache directory path
37-
id: yarn-cache-dir-path
38-
run: echo "::set-output name=dir::$(yarn cache dir)"
39-
- name: Restore node_modules from cache
40-
uses: actions/cache@v4
41-
id: yarn-cache
29+
- name: Setup
30+
uses: ./.github/actions/setup
4231
with:
43-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
44-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
45-
restore-keys: |
46-
${{ runner.os }}-yarn-
47-
- name: Install node_modules for example/
48-
run: yarn install --frozen-lockfile --cwd ..
32+
project-path: example
4933

50-
- name: Restore Gradle cache
51-
uses: actions/cache@v4
52-
with:
53-
path: |
54-
~/.gradle/caches
55-
~/.gradle/wrapper
56-
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
57-
restore-keys: |
58-
${{ runner.os }}-gradle-
59-
- name: Run Gradle Build
60-
run: ./gradlew assembleDebug
34+
- name: Run Build
35+
run: |
36+
cd android
37+
./gradlew clean
38+
./gradlew assembleDebug

.github/workflows/build-ios.yml

Lines changed: 23 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,11 @@
11
name: Build iOS App
22

33
on:
4-
push:
5-
branches:
6-
- master
7-
paths:
8-
- ".github/workflows/build-ios.yml"
9-
- "ios/**"
10-
- "*.podspec"
11-
- "example/ios/**"
124
pull_request:
135
paths:
14-
- ".github/workflows/build-ios.yml"
15-
- "ios/**"
166
- "*.podspec"
7+
- "example/**"
8+
- "ios/**"
179
- "example/ios/**"
1810

1911
jobs:
@@ -22,30 +14,21 @@ jobs:
2214
runs-on: macOS-latest
2315
defaults:
2416
run:
25-
working-directory: example/ios
17+
working-directory: example
2618
steps:
2719
- uses: actions/checkout@v4
2820

29-
- name: Get yarn cache directory path
30-
id: yarn-cache-dir-path
31-
run: echo "::set-output name=dir::$(yarn cache dir)"
32-
- name: Restore node_modules from cache
33-
uses: actions/cache@v4
34-
id: yarn-cache
21+
- name: Setup
22+
uses: ./.github/actions/setup
3523
with:
36-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
37-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
38-
restore-keys: |
39-
${{ runner.os }}-yarn-
40-
- name: Install node_modules for example/
41-
run: yarn install --frozen-lockfile --cwd ..
24+
project-path: example
4225

4326
- name: Setup Ruby (bundle)
4427
uses: ruby/setup-ruby@v1
4528
with:
46-
ruby-version: 2.6
47-
bundler-cache: true
48-
working-directory: example/ios
29+
ruby-version: 3.4.5
30+
bundler-cache: false
31+
cache-version: 3
4932

5033
- name: Restore Pods cache
5134
uses: actions/cache@v4
@@ -57,14 +40,19 @@ jobs:
5740
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
5841
restore-keys: |
5942
${{ runner.os }}-pods-
43+
44+
- name: Install Gemfile
45+
run: |
46+
bundle install
47+
6048
- name: Install Pods
61-
run: bundle exec pod check || bundle exec pod install
49+
run: |
50+
cd ios
51+
bundle exec pod repo update --verbose
52+
bundle exec pod install
53+
6254
- name: Build App
63-
run: "xcodebuild \
64-
-workspace CompressorExample.xcworkspace \
65-
-scheme CompressorExample \
66-
-sdk iphonesimulator \
67-
-configuration Debug \
68-
-destination \"generic/platform=iOS Simulator\" \
69-
build \
70-
CODE_SIGNING_ALLOWED=NO"
55+
run: |
56+
cd ios
57+
xcodebuild -project KeysExample.xcodeproj -sdk iphonesimulator -configuration Debug -arch arm64 build -UseModernBuildSystem=YES CODE_SIGN_STYLE=Automatic
58+
# yarn exec react-native build-ios --mode Debug
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Build
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- ".github/workflows/build-android.yml"
7+
- "android/**"
8+
- "example/android/**"
9+
- "yarn.lock"
10+
- "example/yarn.lock"
11+
12+
jobs:
13+
build:
14+
name: Prepare / Build
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Setup
20+
uses: ./.github/actions/setup
21+
22+
- name: Install node_modules (example/)
23+
run: yarn --cwd example install --immutable --check-cache
24+
25+
- name: Prepare / Build
26+
run: yarn prepare

.github/workflows/publishnpm.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- uses: actions/checkout@v4
1616
- uses: actions/setup-node@v4
1717
with:
18-
node-version: 12
18+
node-version: lts/*
1919
- run: yarn install
2020
- name: "Automated Version Bump"
2121
uses: "phips28/gh-action-bump-version@master"

.github/workflows/validate-android.yml

Lines changed: 0 additions & 60 deletions
This file was deleted.

0 commit comments

Comments
 (0)