Create SDK update PR for android player to 3.93.0+jason #146
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: Create SDK update PR | |
run-name: Create SDK update PR for ${{ inputs.sdk_name == 'ios' && 'iOS' || inputs.sdk_name }} player to ${{ inputs.version_number }} | |
on: | |
workflow_dispatch: | |
inputs: | |
sdk_name: | |
description: 'The SDK for which the version should be updated' | |
required: true | |
type: choice | |
options: | |
- android | |
- ios | |
version_number: | |
description: 'The version number to which the SDK should be updated' | |
required: true | |
type: string | |
env: | |
NO_FLIPPER: 1 | |
jobs: | |
update: | |
name: Update SDK version | |
runs-on: macos-14 | |
env: | |
GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup git user | |
run: | | |
git config --global user.name "Update Bot" | |
git config --global user.email "[email protected]" | |
- name: Set update branch name | |
id: branching | |
run: | | |
branch_name="update_${{ inputs.sdk_name }}_player_to_${{ inputs.version_number }}" | |
echo "branch_name=$branch_name" >> $GITHUB_OUTPUT | |
- name: Create update branch | |
run: | | |
git push origin --delete ${{ steps.branching.outputs.branch_name }} || true | |
git checkout -b ${{ steps.branching.outputs.branch_name }} | |
- name: Setup Environment | |
uses: ./.github/actions/setup-environment | |
with: | |
node: true | |
brew: true | |
- name: Restore Pods cache | |
id: pods-cache-restore | |
uses: actions/cache/restore@v3 | |
with: | |
path: | | |
.cocoapods-cache | |
example/ios/Pods | |
key: pods-${{ hashFiles('example/ios/Podfile.lock') }}-${{ hashFiles('integration_test/ios/Podfile.lock') }} | |
restore-keys: pods- | |
- name: Bump iOS player SDK version | |
if: ${{ inputs.sdk_name == 'ios' }} | |
run: | | |
sed -i '' 's/s.dependency "BitmovinPlayer", ".*/s.dependency "BitmovinPlayer", "${{ inputs.version_number }}"/g' RNBitmovinPlayer.podspec | |
yarn bootstrap | |
- name: Save Pods cache | |
if: ${{ inputs.sdk_name == 'ios' && steps.pods-cache-restore.outputs.cache-hit != 'true' }} | |
uses: actions/cache/save@v3 | |
with: | |
path: | | |
.cocoapods-cache | |
example/ios/Pods | |
integration_test/ios/Pods | |
key: ${{ steps.pods-cache-restore.outputs.cache-primary-key }} | |
- name: Bump Android player SDK version | |
if: ${{ inputs.sdk_name == 'android' }} | |
run: | | |
sed -i '' "s/com.bitmovin.player:player:.*/com.bitmovin.player:player:${{ inputs.version_number }}'/g" android/build.gradle | |
- name: Commit version bump | |
run: | | |
git add RNBitmovinPlayer.podspec android/build.gradle example/ios/Podfile.lock integration_test/ios/Podfile.lock | |
git commit -m "chore(${{ inputs.sdk_name }}): update ${{ inputs.sdk_name }} player version to ${{ inputs.version_number }}" | |
git push origin ${{ steps.branching.outputs.branch_name }} | |
- name: Create PR | |
run: | | |
gh pr create \ | |
--base "${{ github.ref }}" \ | |
--title "Update ${{ inputs.sdk_name == 'ios' && 'iOS' || inputs.sdk_name }} player to ${{ inputs.version_number }}" \ | |
--body "Automated ${{ inputs.sdk_name == 'ios' && 'iOS' || inputs.sdk_name }} player version update to ${{ inputs.version_number }}" |