Skip to content

Commit 835cca0

Browse files
committed
chore: added podfile update workflow
1 parent 960873a commit 835cca0

File tree

1 file changed

+63
-0
lines changed

1 file changed

+63
-0
lines changed
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Update Podfile
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'package.json'
9+
- 'Example/package.json'
10+
- 'FabricExample/package.json'
11+
jobs:
12+
update_podfile:
13+
runs-on: ubuntu-latest
14+
timeout-minutes: 60
15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.ref }}
17+
cancel-in-progress: true
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
- name: Use Node.js 18
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: 18
25+
- name: Install CocoaPods
26+
run: sudo gem install cocoapods
27+
- name: Identify changed package.json files
28+
id: changes
29+
run: |
30+
ROOT_CHANGED=false
31+
EXAMPLE_CHANGED=false
32+
FABRIC_CHANGED=false
33+
34+
if git diff-tree --no-commit-id --name-only -r ${{ github.sha }} | grep -q '^package.json'; then
35+
ROOT_CHANGED=true
36+
fi
37+
38+
if git diff-tree --no-commit-id --name-only -r ${{ github.sha }} | grep -q '^Example/package.json'; then
39+
EXAMPLE_CHANGED=true
40+
fi
41+
42+
if git diff-tree --no-commit-id --name-only -r ${{ github.sha }} | grep -q '^FabricExample/package.json'; then
43+
FABRIC_CHANGED=true
44+
fi
45+
46+
echo "ROOT_CHANGED=${ROOT_CHANGED}" >> $GITHUB_ENV
47+
echo "EXAMPLE_CHANGED=${EXAMPLE_CHANGED}" >> $GITHUB_ENV
48+
echo "FABRIC_CHANGED=${FABRIC_CHANGED}" >> $GITHUB_ENV
49+
50+
- name: Update Podfile in Example
51+
if: env.ROOT_CHANGED == 'true' || env.EXAMPLE_CHANGED == 'true'
52+
run: |
53+
cd Example
54+
yarn install
55+
cd ios
56+
pod install
57+
- name: Update Podfile in FabricExample
58+
if: env.ROOT_CHANGED == 'true' || env.FABRIC_CHANGED == 'true'
59+
run: |
60+
cd FabricExample
61+
yarn install
62+
cd ios
63+
pod install

0 commit comments

Comments
 (0)