Skip to content

Create SDK update PR #66

Create SDK update PR

Create SDK update PR #66

name: Create SDK update PR
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
jobs:
update:
name: Update SDK version
runs-on: macos-14
env:
GH_TOKEN: ${{ secrets.PLAYER_CI_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 }}
- uses: ./.github/actions/prepare-dependencies
- 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" ios/bitmovin_player.podspec
pod repo add bitmovin https://github.com/bitmovin/cocoapod-specs.git
cd example/ios
pod install --repo-update || pod update --silent
- 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 ios/bitmovin_player.podspec android/build.gradle example/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 }}"