2024-09-11 12:53:10 -04:00
|
|
|
name: Lock files Update Workflow
|
2024-09-11 12:35:35 -04:00
|
|
|
|
2024-09-11 12:22:50 -04:00
|
|
|
on:
|
|
|
|
workflow_dispatch: # Manual trigger
|
2024-09-11 12:25:25 -04:00
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- master
|
2024-09-11 12:22:50 -04:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
pod-update:
|
|
|
|
runs-on: macos-latest
|
|
|
|
permissions:
|
|
|
|
contents: write
|
|
|
|
steps:
|
2024-09-11 12:53:10 -04:00
|
|
|
# Step 1: Checkout the repository
|
2024-09-11 12:22:50 -04:00
|
|
|
- name: Checkout project
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
with:
|
2024-09-11 12:53:10 -04:00
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
# Step 2: Specify the node version and install node dependencies
|
2024-09-11 12:22:50 -04:00
|
|
|
- name: Specify node version
|
|
|
|
uses: actions/setup-node@v4
|
|
|
|
with:
|
|
|
|
node-version: 20
|
2024-09-11 12:53:10 -04:00
|
|
|
|
|
|
|
- name: Install node modules
|
|
|
|
run: npm install
|
|
|
|
|
|
|
|
# Step 3: Set up Ruby and install Bundler dependencies
|
2024-09-11 12:22:50 -04:00
|
|
|
- name: Set up Ruby
|
|
|
|
uses: ruby/setup-ruby@v1
|
|
|
|
with:
|
|
|
|
ruby-version: 3.1.6
|
|
|
|
bundler-cache: true
|
2024-09-11 12:35:35 -04:00
|
|
|
|
2024-09-11 12:53:10 -04:00
|
|
|
- name: Install and update Ruby Gems
|
|
|
|
run: |
|
|
|
|
bundle install
|
2024-09-11 12:22:50 -04:00
|
|
|
|
2024-09-11 12:53:10 -04:00
|
|
|
# Step 4: Install CocoaPods and update pods
|
2024-09-11 12:22:50 -04:00
|
|
|
- name: Install CocoaPods Dependencies
|
|
|
|
run: |
|
|
|
|
cd ios
|
|
|
|
pod install
|
|
|
|
pod update
|
|
|
|
|
2024-09-11 13:06:29 -04:00
|
|
|
# Step 5: Commit the changes
|
|
|
|
- name: Commit changes
|
2024-09-11 12:22:50 -04:00
|
|
|
run: |
|
|
|
|
git checkout -b pod-update-branch
|
2024-09-11 13:06:29 -04:00
|
|
|
git add package-lock.json ios/Podfile.lock Gemfile.lock
|
2024-09-11 12:58:39 -04:00
|
|
|
git commit -m "Update dependencies (CocoaPods)"
|
2024-09-11 13:06:29 -04:00
|
|
|
|
|
|
|
# Step 6: Push the changes and create the PR using the LockFiles PAT
|
|
|
|
- name: Push and create PR
|
|
|
|
run: |
|
2024-09-11 12:22:50 -04:00
|
|
|
git push origin pod-update-branch
|
2024-09-11 13:06:29 -04:00
|
|
|
gh pr create --title "Pod and Dependency Update" --body "This PR updates npm, CocoaPods, and Ruby gem dependencies" --base master
|
2024-09-11 12:22:50 -04:00
|
|
|
env:
|
2024-09-11 13:06:29 -04:00
|
|
|
GITHUB_TOKEN: ${{ secrets.LOCKFILES_WORKFLOW }} # Use the LockFiles PAT for PR creation
|