cobrowse-sdk-react-native 2.18.3 → 2.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
name: Update native SDKs and create a pull request if necessary
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
inputs:
|
|
6
|
+
platform:
|
|
7
|
+
description: 'SDK platform (Android or iOS)'
|
|
8
|
+
default: ''
|
|
9
|
+
type: string
|
|
10
|
+
required: true
|
|
11
|
+
cobrowse_sdk_version:
|
|
12
|
+
description: 'Native SDK version'
|
|
13
|
+
default: ''
|
|
14
|
+
type: string
|
|
15
|
+
required: false
|
|
16
|
+
|
|
17
|
+
permissions:
|
|
18
|
+
contents: write
|
|
19
|
+
pull-requests: write
|
|
20
|
+
|
|
21
|
+
jobs:
|
|
22
|
+
android:
|
|
23
|
+
runs-on: ubuntu-latest
|
|
24
|
+
if: ${{ github.event.inputs.platform == 'Android' }}
|
|
25
|
+
steps:
|
|
26
|
+
- name: Checkout repository
|
|
27
|
+
uses: actions/checkout@v3
|
|
28
|
+
|
|
29
|
+
- name: Get the new Android version from the input parameter
|
|
30
|
+
if: "${{ github.event.inputs.cobrowse_sdk_version != '' }}"
|
|
31
|
+
run: echo "COBROWSE_VERSION=${{ inputs.cobrowse_sdk_version }}" >> $GITHUB_ENV
|
|
32
|
+
|
|
33
|
+
- name: Find the new Android version if it is not set
|
|
34
|
+
if: "${{ github.event.cobrowse_sdk_version.level == '' }}"
|
|
35
|
+
run: |
|
|
36
|
+
COBROWSE_VERSION=$(wget -O - -o /dev/null https://raw.githubusercontent.com/cobrowseio/cobrowse-sdk-android-binary/master/io/cobrowse/cobrowse-sdk-android/maven-metadata.xml | grep -Po '(?<=<version>)([0-9\.]+(-SNAPSHOT)?)' | sort --version-sort -r| head -n 1)
|
|
37
|
+
echo "COBROWSE_VERSION=${COBROWSE_VERSION}" >> $GITHUB_ENV
|
|
38
|
+
|
|
39
|
+
- name: Update build.gradle file
|
|
40
|
+
run: sed -i "s/\(io\.cobrowse\:cobrowse-sdk-android\:\).*/\\1${COBROWSE_VERSION}'/" android/build.gradle
|
|
41
|
+
|
|
42
|
+
# If the SDK was updated, commit the changes and open a new pull request
|
|
43
|
+
- name: Create a new pull request
|
|
44
|
+
env:
|
|
45
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
46
|
+
FILES_TO_COMMIT: android/build.gradle
|
|
47
|
+
NEW_BRANCH_NAME: feature/update_packages_${{ github.run_id }}
|
|
48
|
+
run: |
|
|
49
|
+
if [[ `git status --porcelain $FILES_TO_COMMIT` ]]; then
|
|
50
|
+
git config --local user.name "Cobrowse.io Bot"
|
|
51
|
+
git config --local user.email "github@cobrowse.io"
|
|
52
|
+
git checkout -b $NEW_BRANCH_NAME
|
|
53
|
+
git add $FILES_TO_COMMIT
|
|
54
|
+
git commit -m "feat: update Cobrowse.io SDK"
|
|
55
|
+
git push origin $NEW_BRANCH_NAME
|
|
56
|
+
gh pr create -B master -H $NEW_BRANCH_NAME --title 'Update native Android SDK' --body ''
|
|
57
|
+
else
|
|
58
|
+
echo "No changes to commit"
|
|
59
|
+
fi
|
|
60
|
+
|
|
61
|
+
ios:
|
|
62
|
+
runs-on: macos-14
|
|
63
|
+
if: ${{ github.event.inputs.platform == 'iOS' }}
|
|
64
|
+
steps:
|
|
65
|
+
- name: Checkout repository
|
|
66
|
+
uses: actions/checkout@v3
|
|
67
|
+
|
|
68
|
+
- name: Get the new iOS version from the input parameter
|
|
69
|
+
if: "${{ github.event.inputs.cobrowse_sdk_version != '' }}"
|
|
70
|
+
run: echo "COBROWSE_VERSION=${{ inputs.cobrowse_sdk_version }}" >> $GITHUB_ENV
|
|
71
|
+
|
|
72
|
+
- name: Find the new iOS version if it is not set
|
|
73
|
+
if: "${{ github.event.cobrowse_sdk_version.level == '' }}"
|
|
74
|
+
run: |
|
|
75
|
+
COBROWSE_VERSION=$(wget -O - -o /dev/null https://raw.githubusercontent.com/cobrowseio/cobrowse-sdk-ios-binary/master/CobrowseIO.podspec | grep -Eo "s\.version\ +=\ +'[0-9]+\.[0-9]+\.[0-9]+'" | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+')
|
|
76
|
+
echo "COBROWSE_VERSION=${COBROWSE_VERSION}" >> $GITHUB_ENV
|
|
77
|
+
|
|
78
|
+
- name: Update Podspec file
|
|
79
|
+
run: sed -i '.bak' "s/\(s\.dependency\ *'CobrowseIO\/XCFramework'\,\ *'\).*/\\1${COBROWSE_VERSION}'/" cobrowse-sdk-react-native.podspec
|
|
80
|
+
|
|
81
|
+
# If the SDK was updated, commit the changes and open a new pull request
|
|
82
|
+
- name: Create a new pull request
|
|
83
|
+
env:
|
|
84
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
85
|
+
FILES_TO_COMMIT: cobrowse-sdk-react-native.podspec
|
|
86
|
+
NEW_BRANCH_NAME: feature/update_packages_${{ github.run_id }}
|
|
87
|
+
run: |
|
|
88
|
+
if [[ `git status --porcelain $FILES_TO_COMMIT` ]]; then
|
|
89
|
+
git config --local user.name "Cobrowse.io Bot"
|
|
90
|
+
git config --local user.email "github@cobrowse.io"
|
|
91
|
+
git checkout -b $NEW_BRANCH_NAME
|
|
92
|
+
git add $FILES_TO_COMMIT
|
|
93
|
+
git commit -m "feat: update Cobrowse.io SDK"
|
|
94
|
+
git push origin $NEW_BRANCH_NAME
|
|
95
|
+
gh pr create -B master -H $NEW_BRANCH_NAME --title 'Update native iOS SDKs' --body ''
|
|
96
|
+
else
|
|
97
|
+
echo "No changes to commit"
|
|
98
|
+
fi
|
package/android/build.gradle
CHANGED
|
@@ -11,7 +11,7 @@ Pod::Spec.new do |s|
|
|
|
11
11
|
s.homepage = package["homepage"]
|
|
12
12
|
s.source = { :git => 'https://github.com/cobrowseio/cobrowse-sdk-react-native.git' }
|
|
13
13
|
s.platform = :ios, '11.0'
|
|
14
|
-
s.dependency 'CobrowseIO/XCFramework', '2.
|
|
14
|
+
s.dependency 'CobrowseIO/XCFramework', '2.31.1'
|
|
15
15
|
s.dependency 'React'
|
|
16
16
|
s.source_files = 'ios/*.{h,m}'
|
|
17
17
|
end
|