Skip to content

Commit

Permalink
Updated GitHub actions (#1303)
Browse files Browse the repository at this point in the history
# Description

* Updated GitHub actions

### Pre-launch Checklist

- [x] The [Documentation] is updated accordingly, or this PR doesn't
require it.
- [x] I have updated the `ExampleAppChangelog.txt` file with relevant
changes.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I added new tests to check the change I am making, or this PR is
test-exempt.
- [x] All existing and new tests are passing.

<!-- Links -->
[Documentation]: https://www.100ms.live/docs
  • Loading branch information
ygit authored Dec 26, 2023
2 parents 37db961 + 540c8ce commit 92ae18f
Show file tree
Hide file tree
Showing 15 changed files with 135 additions and 39 deletions.
8 changes: 5 additions & 3 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
# Description

*Replace this paragraph with a description of what this PR is changing or adding, and why. Consider including before/after screenshots.*
_Replace this paragraph with a description of what this PR is changing or adding, and why. Consider including before/after screenshots._

*List which issues are fixed by this PR. You must list at least one issue.*
_List which issues are fixed by this PR. You must list at least one issue._

---

## Additional context

<!-- Add any other context or additional information about the pull request.-->

*
-

### Pre-launch Checklist

- [ ] The [Documentation] is updated accordingly, or this PR doesn't require it.
- [ ] I have updated the `ExampleAppChangelog.txt` file with relevant changes.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] I listed at least one issue that this PR fixes in the description above.
- [ ] I added new tests to check the change I am making, or this PR is test-exempt.
- [ ] All existing and new tests are passing.

<!-- Links -->

[Documentation]: https://www.100ms.live/docs
99 changes: 93 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ concurrency:
cancel-in-progress: true

on:
workflow_dispatch:
workflow_dispatch: {}
push:
branches:
- main
Expand All @@ -30,8 +30,8 @@ permissions:
contents: read

jobs:
build_apk:
name: Build APK
build_android:
name: Build Android App
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
timeout-minutes: 30
Expand All @@ -46,13 +46,100 @@ jobs:
distribution: zulu
java-version: 11.x

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 16

- name: Install dependencies
run: cd packages/react-native-hms/example/ && npm install && cd ../../react-native-room-kit/example/ && npm install
run: |
cd packages/react-native-hms/
npm install
cd example/
npm install
cd ../../react-native-room-kit/
npm install
cd example/
npm install
- name: Publish Dry Run
run: |
cd packages/react-native-hms/ && npm publish --dry-run
cd ../react-native-room-kit/ && npm publish --dry-run
- name: Make Gradlew Executable
run: cd packages/react-native-room-kit/example/android && chmod +x ./gradlew

- name: Generate App APK
- name: Build Android App
run: |
cd packages/react-native-room-kit/example/android
./gradlew assembleDebug --no-daemon
./gradlew assembleRelease --no-daemon
build_ios:
name: Build iOS App
if: github.event.pull_request.draft == false
runs-on: macOS-latest
timeout-minutes: 45
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up JDK 11
uses: actions/setup-java@v3
with:
distribution: zulu
java-version: 11.x

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 16

- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2
bundler-cache: true

- name: Install dependencies
run: |
cd packages/react-native-hms/
npm install
cd example/
npm install
cd ../../react-native-room-kit/
npm install
cd example/
npm install
- name: Cache Pods
id: cache-pods
uses: actions/cache@v3
with:
path: packages/react-native-room-kit/example/ios/Pods
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
restore-keys: |
${{ runner.os }}-pods-
- name: Install Pods if Cache Missed
if: steps.cache-pods.outputs.cache-hit != 'true'
run: |
sudo gem install cocoapods
cd ./packages/react-native-room-kit/example/ios
pod install
- name: Build iOS App
uses: yukiarrr/[email protected]
with:
project-path: packages/react-native-room-kit/example/ios/RNExample.xcodeproj
p12-base64: ${{ secrets.IOS_P12_BASE64 }}
certificate-password: ${{ secrets.IOS_CERTIFICATE_PASSWORD }}
mobileprovision-base64: |
${{ secrets.ADHOC_MOBILEPROVISION_BASE64 }}
${{ secrets.ADHOCEXTENSION_MOBILEPROVISION_BASE64 }}
code-signing-identity: iPhone Distribution
team-id: ${{ secrets.IOS_TEAM_ID }}
workspace-path: packages/react-native-room-kit/example/ios/RNExample.xcworkspace
scheme: RNExample
export-method: ad-hoc
export-options: packages/react-native-room-kit/example/ios/ExportOptions.plist
6 changes: 3 additions & 3 deletions .github/workflows/firstinteraction.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
name: first-interaction

on:
workflow_dispatch:
workflow_dispatch: {}
issues:
types: [opened]
pull_request:
branches:
- main
- develop
- main
- develop
types: [opened]

jobs:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/release_apps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ concurrency:
cancel-in-progress: true

on:
workflow_dispatch:
workflow_dispatch: {}
push:
branches:
- release
tags:
- v*

permissions:
checks: write
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
name: 'Close stale issues and PRs'
name: "Close stale issues and PRs"
on:
workflow_dispatch:
workflow_dispatch: {}
schedule:
- cron: '30 1 * * *'
- cron: "30 1 * * *"

jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v8
with:
stale-issue-message: 'This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.'
stale-pr-message: 'This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days.'
close-issue-message: 'This issue was closed because it has been stalled for 5 days with no activity.'
close-pr-message: 'This PR was closed because it has been stalled for 10 days with no activity.'
stale-issue-message: "This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days."
stale-pr-message: "This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days."
close-issue-message: "This issue was closed because it has been stalled for 5 days with no activity."
close-pr-message: "This PR was closed because it has been stalled for 10 days with no activity."
days-before-issue-stale: 30
days-before-pr-stale: 45
days-before-issue-close: 5
days-before-pr-close: 10
days-before-pr-close: 10
2 changes: 1 addition & 1 deletion .github/workflows/vale.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Vale Linter

on:
workflow_dispatch:
workflow_dispatch: {}
pull_request:
branches:
- develop
Expand Down
9 changes: 4 additions & 5 deletions .trunk/trunk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ lint:
- [email protected]
- [email protected]
- [email protected]
- [email protected].40
- [email protected].43
- [email protected]
- [email protected]
- [email protected].5
- [email protected].7
- [email protected]
- [email protected]
- [email protected]
Expand All @@ -32,9 +32,8 @@ runtimes:
- [email protected]
- [email protected]
actions:
disabled:
- trunk-check-pre-push
- trunk-fmt-pre-commit
enabled:
- trunk-announce
- trunk-upgrade-available
- trunk-check-pre-push
- trunk-fmt-pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -1049,8 +1049,8 @@ export const RtcStatsModal = () => {
value?.width ?? 0
}`
: key === 'qualityLimitationReasons'
? value.reason
: value}
? value.reason
: value}
</Text>
</View>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1053,7 +1053,9 @@ const DisplayView = (data: {
// remove Session Store key update listener on cleanup
sessionStoreListeners.current.forEach(listener => listener.remove());

if (toastTimeoutId !== null) clearTimeout(toastTimeoutId);
if (toastTimeoutId !== null) {
clearTimeout(toastTimeoutId);
}
};
}
}, [hmsSessionStore]);
Expand Down
2 changes: 1 addition & 1 deletion packages/react-native-hms/src/classes/HMSPIPConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ export interface HMSPIPConfig {
endButton?: boolean;
audioButton?: boolean;
videoButton?: boolean;
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,10 @@ const _HMSHLSPlayer: React.ForwardRefRenderFunction<
) {
setHMSHLSPlayerPlaybackError(data.error);
} else if (
event === HMSHLSPlayerPlaybackEventTypes.ON_PLAYBACK_RESOLUTION_CHANGE_EVENT
event ===
HMSHLSPlayerPlaybackEventTypes.ON_PLAYBACK_RESOLUTION_CHANGE_EVENT
) {
setHMSHLSPlayerResolution({...data});
setHMSHLSPlayerResolution({ ...data });

const aspectRatio = data.width / data.height;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,7 @@ export const useHMSHLSPlayerCue = (
export const setHMSHLSPlayerPlaybackState =
useHMSStore.getState().setPlaybackState;

export const setHMSHLSPlayerResolution =
useHMSStore.getState().setResolution;
export const setHMSHLSPlayerResolution = useHMSStore.getState().setResolution;

export const setHMSHLSPlayerCue = useHMSStore.getState().setCue;

Expand Down
4 changes: 3 additions & 1 deletion packages/react-native-hms/src/hooks/hmsviews.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import { useHMSStore } from '../stores/hms-store';
// use latest state (with component rerender)

export const useHmsViewsResolutionsState = (trackId?: TrackId) => {
return useHMSStore((state) => trackId ? state.hmsviewsResolutions[trackId] : undefined);
return useHMSStore((state) =>
trackId ? state.hmsviewsResolutions[trackId] : undefined
);
};

// state setters
Expand Down
2 changes: 1 addition & 1 deletion packages/react-native-hms/src/stores/hms-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ import type { HMSStore } from './types';
export const useHMSStore = create<HMSStore>()(
subscribeWithSelector((...a) => ({
...createHMSHLSPlayerPlaybackSlice(...a),
...createHMSViewsSlice(...a)
...createHMSViewsSlice(...a),
}))
);
6 changes: 4 additions & 2 deletions packages/react-native-hms/src/stores/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export type Resolution = {
export interface HMSViewsSlice {
hmsviewsResolutions: Record<TrackId, Resolution | undefined>;
setHmsviewsResolutions(trackId: TrackId, resolution: Resolution): void;
};
}

// HLS Player Playback Slice

Expand All @@ -40,7 +40,9 @@ export type HMSHLSPlayerPlaybackError =
| HMSHLSPlayerPlaybackFailureEventData['error']
| undefined;

export type HMSHLSPlayerResolution = HMSHLSPlayerPlaybackResolutionChangeEventData | undefined;
export type HMSHLSPlayerResolution =
| HMSHLSPlayerPlaybackResolutionChangeEventData
| undefined;

export interface HMSHLSPlayerPlaybackSlice {
cue: HMSHLSPlayerCue;
Expand Down

0 comments on commit 92ae18f

Please sign in to comment.