Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions .github/workflows/update-bom.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Update BOM Versions

on:
workflow_dispatch:
inputs:
ticket_number:
description: 'Ticket number (e.g., MOEN-12345)'
required: true
target_native_bom_version:
description: 'Target native android-bom version'
required: false
default: ''
current_plugin_base_metadata:
description: 'Current plugin-base module versions JSON'
required: false
default: ''
target_plugin_base_metadata:
description: 'Target plugin-base module versions JSON'
required: false
default: ''

jobs:
update_bom:
runs-on: ubuntu-latest
steps:
- name: Validate inputs
run: |
if [ -z "${{ github.event.inputs.target_native_bom_version }}" ] && [ -z "${{ github.event.inputs.target_plugin_base_metadata }}" ]; then
echo "Error: At least one target BOM version must be provided"
exit 1
fi

- name: Checkout React-Native
uses: actions/checkout@v3
with:
ref: development
token: ${{ secrets.SDK_BOT_ACCESS_TOKEN }}

- name: Checkout sdk-automation-scripts
uses: actions/checkout@v3
with:
repository: moengage/sdk-automation-scripts
path: ../sdk-automation-scripts
token: ${{ secrets.SDK_BOT_ACCESS_TOKEN }}

- name: Checkout android-dependency-catalog
if: ${{ github.event.inputs.target_native_bom_version != '' }}
uses: actions/checkout@v3
with:
repository: moengage/android-dependency-catalog
path: ../android-dependency-catalog
token: ${{ secrets.SDK_BOT_ACCESS_TOKEN }}
fetch-depth: 0

- name: Run version update script
env:
GH_TOKEN: ${{ secrets.SDK_BOT_ACCESS_TOKEN }}
run: |
kotlin ./scripts/update-bom.main.kts \
"${{ github.event.inputs.ticket_number }}" \
"${{ github.event.inputs.target_native_bom_version }}" \
'${{ github.event.inputs.current_plugin_base_metadata }}' \
'${{ github.event.inputs.target_plugin_base_metadata }}'
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
*.DS_Store
*node_modules/
*google-services.json
/.idea
8 changes: 8 additions & 0 deletions scripts/update-bom.main.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import kotlin.system.exitProcess

val script = "../sdk-automation-scripts/scripts/hybrid/react-native-version-update.main.kts"
val repoPath = "."

val cmd = "kotlin $script \"$repoPath\" ${args.joinToString(" ") { "\"$it\"" }}"
val process = ProcessBuilder("/bin/bash", "-c", cmd).inheritIO().start()
exitProcess(process.waitFor())
Loading