Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added App Release Script Github Actions #1254

Closed
wants to merge 35 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
d48fad3
added trunk check job
ygit Nov 1, 2023
b270add
updated yml
ygit Nov 1, 2023
032e3c7
updated yml
ygit Nov 1, 2023
ad6de7c
updated yml
ygit Nov 1, 2023
2a972c9
updated build.gradle settings
ygit Nov 1, 2023
9f1deee
updated yml
ygit Nov 1, 2023
5a5b544
added release apps script
ygit Nov 1, 2023
37c0d0d
updated script
ygit Nov 1, 2023
8ddc863
updated release yml
ygit Nov 2, 2023
ddbb093
updated release script
ygit Nov 2, 2023
fd46fc5
creating iOS fastlane files
ygit Nov 2, 2023
93f7912
corrected iOS path
ygit Nov 2, 2023
e618c94
added reactnative-hms.json file
ygit Nov 2, 2023
118d53d
updated release script to run only Android build
ygit Nov 2, 2023
bf0fdf9
updated script
ygit Nov 2, 2023
cf4e0b6
removed git pull step
ygit Nov 2, 2023
f2d874e
update release script
ygit Nov 2, 2023
494cb69
added install ruby step
ygit Nov 2, 2023
1859f39
updated ruby step
ygit Nov 2, 2023
393b776
updated ruby step
ygit Nov 2, 2023
544a5f0
updated release script
ygit Nov 2, 2023
fbe3880
updated scripts
ygit Nov 2, 2023
33b4174
updated script
ygit Nov 2, 2023
a147ce9
added installing node step
ygit Nov 2, 2023
be7ae71
updated release script
ygit Nov 2, 2023
a4b7c32
updated release script
ygit Nov 2, 2023
fc45478
added env variables to Fastfile
ygit Nov 2, 2023
a313623
getting secrets as ENV variables
ygit Nov 2, 2023
9b4c348
using env variables from github action
ygit Nov 2, 2023
82bdf0c
using shell command output in fastfile
ygit Nov 2, 2023
1593d78
passing params to fastlane
ygit Nov 3, 2023
f1939b6
updated env variables
ygit Nov 3, 2023
5937ebb
removed cat
ygit Nov 3, 2023
2b8d85c
Merge branch 'main' into feature/releaseScript
ygit Nov 18, 2023
6c13d4b
updated readme
ygit Nov 18, 2023
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
7 changes: 3 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
79 changes: 79 additions & 0 deletions .github/workflows/release-apps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Release

Check failure on line 1 in .github/workflows/release-apps.yml

View workflow job for this annotation

GitHub Actions / Trunk Check

checkov(CKV2_GHA_1)

[new] Ensure top-level permissions are not set to write-all

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true

on:
workflow_dispatch:

Check failure on line 8 in .github/workflows/release-apps.yml

View workflow job for this annotation

GitHub Actions / Trunk Check

yamllint(empty-values)

[new] empty value in block mapping
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
5 changes: 5 additions & 0 deletions packages/react-native-hms/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions packages/react-native-room-kit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
26 changes: 13 additions & 13 deletions packages/react-native-room-kit/example/android/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand All @@ -219,4 +219,4 @@ DEPENDENCIES
fastlane-plugin-firebase_app_distribution

BUNDLED WITH
2.4.13
2.4.21
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Autogenerated by fastlane
#
# Ensure this file is checked in to source control!

gem 'fastlane-plugin-firebase_app_distribution'
14 changes: 7 additions & 7 deletions packages/react-native-room-kit/example/ios/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -221,4 +221,4 @@ DEPENDENCIES
fastlane-plugin-versioning

BUNDLED WITH
2.4.13
2.4.21
38 changes: 22 additions & 16 deletions release-apps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@
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

Expand All @@ -21,17 +24,18 @@

bundle install --verbose

bundle exec fastlane distribute_app
bundle exec fastlane distribute_app FIREBASE_APP_ID: $FIREBASE_APP_ID SLACK_URL: $SLACK_URL

Check notice on line 27 in release-apps.sh

View workflow job for this annotation

GitHub Actions / Trunk Check

shellcheck(SC2250)

[new] Prefer putting braces around variable references even when not strictly required.

Check notice on line 27 in release-apps.sh

View workflow job for this annotation

GitHub Actions / Trunk Check

shellcheck(SC2250)

[new] Prefer putting braces around variable references even when not strictly required.

Check notice on line 27 in release-apps.sh

View workflow job for this annotation

GitHub Actions / Trunk Check

shellcheck(SC2086)

[new] Double quote to prevent globbing and word splitting.

Check notice on line 27 in release-apps.sh

View workflow job for this annotation

GitHub Actions / Trunk Check

shellcheck(SC2086)

[new] Double quote to prevent globbing and word splitting.
}

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() {
Expand All @@ -56,18 +60,20 @@
}

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
Loading