BlueWallet/.github/workflows/lockfiles_update.yml

68 lines
2.1 KiB
YAML
Raw Normal View History

2024-09-11 12:22:50 -04:00
name: Update lock files
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:
- name: Checkout project
uses: actions/checkout@v4
with:
2024-09-11 12:35:35 -04:00
fetch-depth: 0 # Fetches all history
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:35:35 -04:00
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: 15.4
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
- name: Install dependencies with Bundler
2024-09-11 12:22:50 -04:00
run: |
2024-09-11 12:35:35 -04:00
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3 --quiet
- name: Install node_modules
run: npm install --production
2024-09-11 12:22:50 -04:00
2024-09-11 12:35:35 -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
# Step 5: Set up Git authentication to push changes
- name: Set up Git Authentication
env:
2024-09-11 12:44:23 -04:00
ACCESS_TOKEN: ${{ secrets.LOCKFILES_WORKFLOW }}
2024-09-11 12:22:50 -04:00
run: |
git config --global credential.helper 'cache --timeout=3600'
git config --global http.https://github.com/.extraheader "AUTHORIZATION: basic $(echo -n x-access-token:${ACCESS_TOKEN} | base64)"
# Step 6: Commit and push changes for package-lock.json, Podfile.lock, and Gemfile.lock
- name: Commit and create PR for dependency updates
run: |
git checkout -b pod-update-branch
git add package-lock.json ios/Podfile.lock Gemfile.lock
git commit -m "Update dependencies (npm, CocoaPods, Ruby gems)"
git push origin pod-update-branch
gh pr create --title "Pod and Dependency Update" --body "This PR updates npm, CocoaPods, and Ruby gem dependencies" --base master
env:
2024-09-11 12:25:25 -04:00
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}