Update #69
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update | |
# Triggered manually | |
on: | |
workflow_dispatch: | |
inputs: | |
increment: | |
description: "Increment (major, minor, patch)" | |
required: true | |
default: "patch" | |
force: | |
description: "Force update (even if sdk is up to date)" | |
required: false | |
default: "false" | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
update: | |
name: Update version and dependencies | |
runs-on: macos-14 # required for pod info / update | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.CUSTOM_GITHUB_TOKEN }} | |
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token | |
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo | |
- name: Check if React Native SDK requires update | |
if: github.event.inputs.force != 'true' | |
run: | | |
bash .github/scripts/check_before_update.sh | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Cache Node dependencies | |
uses: actions/cache@v4 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: Install dependencies | |
run: npm install | |
- name: Update React Native SDK | |
run: | | |
echo "Increment: ${{ github.event.inputs.increment }}" | |
bash .github/scripts/update.sh ${{ github.event.inputs.increment }} | |
- name: Commit & Push changes | |
uses: actions-js/push@master | |
with: | |
author_email: ${{ secrets.AUTHOR_EMAIL }} | |
author_name: ${{ secrets.AUTHOR_NAME }} | |
branch: ${{ github.ref }} | |
github_token: ${{ secrets.CUSTOM_GITHUB_TOKEN }} | |
message: "Update Native SDKs and increment ${{ github.event.inputs.increment }} version" | |
- name: Trigger Tag | |
run: | | |
curl --request POST \ | |
--url 'https://api.github.com/repos/didomi/react-native/actions/workflows/tag.yml/dispatches' \ | |
--header 'authorization: Bearer ${{ secrets.CUSTOM_GITHUB_TOKEN }}' \ | |
--data '{ "ref": "${{ github.ref }}" }' |