diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 89edf7a93..ff6dc43da 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,15 +24,14 @@ on: - .git/ - .vscode/ - "**.txt" +permissions: + checks: write + contents: read jobs: check_lint_errors: name: Trunk Check Runner runs-on: ubuntu-latest - # trunk-ignore(checkov/CKV2_GHA_1) - permissions: - checks: write - contents: read steps: - name: Checkout diff --git a/.github/workflows/release-apps.yml b/.github/workflows/release-apps.yml new file mode 100644 index 000000000..c31fb5a97 --- /dev/null +++ b/.github/workflows/release-apps.yml @@ -0,0 +1,79 @@ +name: Release + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref }} + cancel-in-progress: true + +on: + workflow_dispatch: + pull_request: + types: + - opened + - reopened + - synchronize + - ready_for_review + branches: + - main + - develop + paths-ignore: + - "**.md" + - doc/** + - .git/ + - .vscode/ + - "**.txt" + +jobs: + + release_android: + name: Release Android App on Firebase + if: github.event.pull_request.draft == false + runs-on: ubuntu-latest + timeout-minutes: 30 + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - uses: actions/setup-java@v3 + with: + distribution: zulu + java-version: 11.x + - name: Setup Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.2' + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 16.0.0 + - name: Setup Fastlane + env: + REACT_NATIVE_HMS_JSON: ${{ secrets.REACT_NATIVE_HMS_JSON }} + IOS_APPFILE: ${{ secrets.IOS_APPFILE }} + IOS_FASTFILE: ${{ secrets.IOS_FASTFILE }} + IOS_PLUGINFILE: ${{ secrets.IOS_PLUGINFILE }} + run: | + cd packages/react-native-room-kit/example/android + + echo $REACT_NATIVE_HMS_JSON > reactnative-hms-a32ef61302c5.json + + cd fastlane + + pwd + ls -la + + cd ../../ios + echo $REACT_NATIVE_HMS_JSON > reactnative-hms-a32ef61302c5.json + + pwd + mkdir fastlane + cd fastlane + echo $IOS_APPFILE > Appfile + echo $IOS_FASTFILE > Fastfile + echo $IOS_PLUGINFILE > Pluginfile + pwd + ls -la + - name: Run Release Script + env: + FIREBASE_APP_ID: ${{ secrets.FIREBASE_APP_ID }} + SLACK_URL: ${{ secrets.SLACK_URL }} + run: sh release-apps.sh diff --git a/packages/react-native-hms/README.md b/packages/react-native-hms/README.md index 296b43ed3..903bf28bb 100644 --- a/packages/react-native-hms/README.md +++ b/packages/react-native-hms/README.md @@ -22,6 +22,11 @@ With support for HLS and RTMP Live Streaming and Recording, Picture-in-Picture ( 📖 Read the Complete Documentation here: https://www.100ms.live/docs/react-native/v2/foundation/basics +| Package | Version | +| -------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| @100mslive/react-native-room-kit | [![npm](https://img.shields.io/npm/v/@100mslive/react-native-room-kit)](https://www.npmjs.com/package/@100mslive/react-native-room-kit) | +| @100mslive/react-native-hms | [![npm](https://img.shields.io/npm/v/@100mslive/react-native-hms)](https://www.npmjs.com/package/@100mslive/react-native-hms) | + ## 🏃 Example App 📲 Download the Example iOS app here: https://testflight.apple.com/join/v4bSIPad diff --git a/packages/react-native-room-kit/README.md b/packages/react-native-room-kit/README.md index dc8deda6c..c1b2ef472 100644 --- a/packages/react-native-room-kit/README.md +++ b/packages/react-native-room-kit/README.md @@ -22,6 +22,12 @@ With support for HLS and RTMP Live Streaming and Recording, Picture-in-Picture ( 📖 Read the Complete Documentation here: https://www.100ms.live/docs/react-native/v2/foundation/basics +| Package | Version | +| -------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| @100mslive/react-native-room-kit | [![npm](https://img.shields.io/npm/v/@100mslive/react-native-room-kit)](https://www.npmjs.com/package/@100mslive/react-native-room-kit) | +| @100mslive/react-native-hms | [![npm](https://img.shields.io/npm/v/@100mslive/react-native-hms)](https://www.npmjs.com/package/@100mslive/react-native-hms) | + + ## 🏃 Example App 📲 Download the Example iOS app here: https://testflight.apple.com/join/v4bSIPad diff --git a/packages/react-native-room-kit/example/android/Gemfile.lock b/packages/react-native-room-kit/example/android/Gemfile.lock index d7921f828..f7f157dc3 100644 --- a/packages/react-native-room-kit/example/android/Gemfile.lock +++ b/packages/react-native-room-kit/example/android/Gemfile.lock @@ -8,20 +8,20 @@ GEM artifactory (3.0.15) atomos (0.1.3) aws-eventstream (1.2.0) - aws-partitions (1.826.0) - aws-sdk-core (3.183.0) + aws-partitions (1.843.0) + aws-sdk-core (3.185.2) aws-eventstream (~> 1, >= 1.0.2) aws-partitions (~> 1, >= 1.651.0) aws-sigv4 (~> 1.5) jmespath (~> 1, >= 1.6.1) - aws-sdk-kms (1.71.0) - aws-sdk-core (~> 3, >= 3.177.0) + aws-sdk-kms (1.72.0) + aws-sdk-core (~> 3, >= 3.184.0) aws-sigv4 (~> 1.1) - aws-sdk-s3 (1.135.0) + aws-sdk-s3 (1.136.0) aws-sdk-core (~> 3, >= 3.181.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.6) - aws-sigv4 (1.6.0) + aws-sigv4 (1.6.1) aws-eventstream (~> 1, >= 1.0.2) babosa (1.0.4) claide (1.1.0) @@ -36,7 +36,7 @@ GEM unf (>= 0.0.5, < 1.0.0) dotenv (2.8.1) emoji_regex (3.2.3) - excon (0.103.0) + excon (0.104.0) faraday (1.10.3) faraday-em_http (~> 1.0) faraday-em_synchrony (~> 1.0) @@ -109,9 +109,9 @@ GEM fastlane-plugin-firebase_app_distribution (0.7.4) google-apis-firebaseappdistribution_v1 (~> 0.3.0) gh_inspector (1.1.3) - google-apis-androidpublisher_v3 (0.49.0) + google-apis-androidpublisher_v3 (0.51.0) google-apis-core (>= 0.11.0, < 2.a) - google-apis-core (0.11.1) + google-apis-core (0.11.2) addressable (~> 2.5, >= 2.5.1) googleauth (>= 0.16.2, < 2.a) httpclient (>= 2.8.1, < 3.a) @@ -165,7 +165,7 @@ GEM os (1.1.4) plist (3.7.0) public_suffix (5.0.3) - rake (13.0.6) + rake (13.1.0) representable (3.2.0) declarative (< 0.1.0) trailblazer-option (>= 0.1.1, < 0.2.0) @@ -196,10 +196,10 @@ GEM unf (0.1.4) unf_ext unf_ext (0.0.8.2) - unicode-display_width (2.4.2) + unicode-display_width (2.5.0) webrick (1.8.1) word_wrap (1.0.0) - xcodeproj (1.22.0) + xcodeproj (1.23.0) CFPropertyList (>= 2.3.3, < 4.0) atomos (~> 0.1.3) claide (>= 1.0.2, < 2.0) @@ -219,4 +219,4 @@ DEPENDENCIES fastlane-plugin-firebase_app_distribution BUNDLED WITH - 2.4.13 + 2.4.21 diff --git a/packages/react-native-room-kit/example/android/fastlane/Appfile b/packages/react-native-room-kit/example/android/fastlane/Appfile new file mode 100644 index 000000000..c7ed72399 --- /dev/null +++ b/packages/react-native-room-kit/example/android/fastlane/Appfile @@ -0,0 +1,2 @@ +json_key_file("") # Path to the json secret file - Follow https://docs.fastlane.tools/actions/supply/#setup to get one +package_name("live.hms.rn") # e.g. com.krausefx.app diff --git a/packages/react-native-room-kit/example/android/fastlane/Fastfile b/packages/react-native-room-kit/example/android/fastlane/Fastfile new file mode 100644 index 000000000..d90b37bf0 --- /dev/null +++ b/packages/react-native-room-kit/example/android/fastlane/Fastfile @@ -0,0 +1,56 @@ +update_fastlane + +default_platform(:android) + +platform :android do + desc "Firebase App Distribution" + lane :distribute_app do |options| + + path = '../app/build.gradle' + re = /versionCode\s+(\d+)/ + vn = /versionName\s+"\d.\d.(\d+)"/ + s = File.read(path) + versionCode = s[re, 1].to_i + versionName = s[vn, 1].to_i + s[re, 1] = (versionCode+1).to_s + s[vn, 1] = (versionName+1).to_s + + updatedVersionCode = s[re, 1] + updatedVersionName = s[/versionName\s+"(\d.\d.\d+)"/, 1] + + f = File.new(path, 'w') + f.write(s) + f.close + + build_android_app( + task: 'assemble', + build_type: 'Release' + ) + + commit = last_git_commit + firebase_app_distribution( + app: options[:FIREBASE_APP_ID], + groups: "internal, External", + service_credentials_file: "reactnative-hms-a32ef61302c5.json", + android_artifact_path: lane_context[SharedValues::GRADLE_APK_OUTPUT_PATH], + release_notes_file: "../ExampleAppChangelog.txt" + ) + + slack( + message: ":react: 🎉 React Native Android App released! 🎊 :react:", + slack_url: options[:SLACK_URL], + payload: { + "📲 Download from Firebase 🤖" => "https://appdistribution.firebase.dev/i/7b7ab3b30e627c35", + "📝 Changelog with Tickets" => File.read("../../ExampleAppChangelog.txt") + }, + default_payloads: ["git_branch"], + attachment_properties: { + fields: [{ + title: "🎊 App Version", + value: updatedVersionName + " (" + updatedVersionCode + ")", + short: false + }] + } + ) + end +end diff --git a/packages/react-native-room-kit/example/android/fastlane/Pluginfile b/packages/react-native-room-kit/example/android/fastlane/Pluginfile new file mode 100644 index 000000000..b18539bc9 --- /dev/null +++ b/packages/react-native-room-kit/example/android/fastlane/Pluginfile @@ -0,0 +1,5 @@ +# Autogenerated by fastlane +# +# Ensure this file is checked in to source control! + +gem 'fastlane-plugin-firebase_app_distribution' diff --git a/packages/react-native-room-kit/example/ios/Gemfile.lock b/packages/react-native-room-kit/example/ios/Gemfile.lock index 784904e24..5fc46214b 100644 --- a/packages/react-native-room-kit/example/ios/Gemfile.lock +++ b/packages/react-native-room-kit/example/ios/Gemfile.lock @@ -8,8 +8,8 @@ GEM artifactory (3.0.15) atomos (0.1.3) aws-eventstream (1.2.0) - aws-partitions (1.834.0) - aws-sdk-core (3.185.1) + aws-partitions (1.843.0) + aws-sdk-core (3.185.2) aws-eventstream (~> 1, >= 1.0.2) aws-partitions (~> 1, >= 1.651.0) aws-sigv4 (~> 1.5) @@ -21,7 +21,7 @@ GEM aws-sdk-core (~> 3, >= 3.181.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.6) - aws-sigv4 (1.6.0) + aws-sigv4 (1.6.1) aws-eventstream (~> 1, >= 1.0.2) babosa (1.0.4) claide (1.1.0) @@ -110,9 +110,9 @@ GEM google-apis-firebaseappdistribution_v1 (~> 0.3.0) fastlane-plugin-versioning (0.5.2) gh_inspector (1.1.3) - google-apis-androidpublisher_v3 (0.50.0) + google-apis-androidpublisher_v3 (0.51.0) google-apis-core (>= 0.11.0, < 2.a) - google-apis-core (0.11.1) + google-apis-core (0.11.2) addressable (~> 2.5, >= 2.5.1) googleauth (>= 0.16.2, < 2.a) httpclient (>= 2.8.1, < 3.a) @@ -166,7 +166,7 @@ GEM os (1.1.4) plist (3.7.0) public_suffix (5.0.3) - rake (13.0.6) + rake (13.1.0) representable (3.2.0) declarative (< 0.1.0) trailblazer-option (>= 0.1.1, < 0.2.0) @@ -221,4 +221,4 @@ DEPENDENCIES fastlane-plugin-versioning BUNDLED WITH - 2.4.13 + 2.4.21 diff --git a/release-apps.sh b/release-apps.sh index a7ee1bb71..a7d1c149a 100644 --- a/release-apps.sh +++ b/release-apps.sh @@ -5,9 +5,12 @@ set -e set -x perform_npm_actions() { - cd ./packages/react-native-room-kit - git pull --verbose + cd packages/react-native-hms + + npm install + + cd ../react-native-room-kit npm install @@ -21,17 +24,18 @@ release_android() { bundle install --verbose - bundle exec fastlane distribute_app + bundle exec fastlane distribute_app FIREBASE_APP_ID: $FIREBASE_APP_ID SLACK_URL: $SLACK_URL } release_iOS() { - cd ./ios + pwd + # cd ./ios - pod install --verbose + # pod install --verbose - bundle install --verbose + # bundle install --verbose - bundle exec fastlane distribute_app + # bundle exec fastlane distribute_app } perform_git_actions() { @@ -56,18 +60,20 @@ perform_git_actions() { } perform_npm_actions -P1=$! +release_android +# perform_npm_actions +# P1=$! -wait $P1 +# wait $P1 -release_android & -P2=$! +# release_android & +# P2=$! -release_iOS & -P3=$! +# release_iOS & +# P3=$! -wait $P2 $P3 +# wait $P2 $P3 -perform_git_actions +# perform_git_actions -say done +# say done