-
Notifications
You must be signed in to change notification settings - Fork 3
ci: automated release workflow (semantic-release + OIDC trusted publishing) #46
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
Changes from all commits
98b99a2
807fb2b
a6cbefa
65aee1d
d3a7d66
60e2b62
6e59f3f
1b13c47
be82633
9674327
24e9941
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| name: Setup Node | ||
| description: Setup Node from .nvmrc and install dependencies with npm | ||
| inputs: | ||
| node-version: | ||
| description: Optional Node version override | ||
| required: false | ||
| runs: | ||
| using: composite | ||
| steps: | ||
| - uses: actions/setup-node@v6 | ||
| with: | ||
| node-version: ${{ inputs.node-version }} | ||
| node-version-file: .nvmrc | ||
| cache: npm | ||
|
|
||
| - name: Install dependencies | ||
| shell: bash | ||
| run: npm ci # respects .npmrc (legacy-peer-deps=true) |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| name: Release | ||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| dry_run: | ||
| description: Run release in "dry run" mode (does not publish) | ||
| default: false | ||
| type: boolean | ||
|
|
||
| permissions: | ||
| id-token: write # Required for npm Trusted Publishing (OIDC) + provenance | ||
| contents: write # Required to push the changelog/version commit + create the GH Release | ||
| issues: write # @semantic-release/github comments on / labels released issues | ||
| pull-requests: write # ...and on released pull requests | ||
|
|
||
| # Never cancel a release in flight: semantic-release pushes the tag and release | ||
| # commit before it publishes, so a cancelled run can leave the repo tagged with | ||
| # nothing on npm. Queue instead. | ||
| concurrency: | ||
| group: release-${{ github.ref }} | ||
| cancel-in-progress: false | ||
|
|
||
| jobs: | ||
| package_release: | ||
| name: Release from "${{ github.ref_name }}" branch | ||
| runs-on: ubuntu-latest | ||
| # GH does not allow limiting branches in workflow_dispatch settings, so guard here. | ||
| if: ${{ inputs.dry_run || github.ref_name == 'master' || github.ref_name == 'beta' || github.ref_name == 'alpha' || startsWith(github.ref_name, 'release') || endsWith(github.ref_name, '.x') }} | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v6 | ||
| with: | ||
| fetch-depth: 0 # full history + tags required by semantic-release | ||
|
|
||
| - uses: ./.github/actions/setup-node | ||
|
|
||
| - name: Release | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| run: > | ||
| npx semantic-release | ||
| ${{ inputs.dry_run && '--dry-run' || '' }} |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,34 @@ | ||||||||||||||||||
| { | ||||||||||||||||||
| "branches": [ | ||||||||||||||||||
| "+([0-9])?(.{+([0-9]),x}).x", | ||||||||||||||||||
| "master", | ||||||||||||||||||
| { "name": "beta", "prerelease": true }, | ||||||||||||||||||
| { "name": "alpha", "prerelease": true } | ||||||||||||||||||
| ], | ||||||||||||||||||
| "plugins": [ | ||||||||||||||||||
| [ | ||||||||||||||||||
| "@semantic-release/commit-analyzer", | ||||||||||||||||||
| { | ||||||||||||||||||
| "preset": "conventionalcommits", | ||||||||||||||||||
| "releaseRules": [ | ||||||||||||||||||
| { "type": "refactor", "release": "patch" }, | ||||||||||||||||||
| { "scope": "deps", "release": "patch" } | ||||||||||||||||||
| ] | ||||||||||||||||||
|
Comment on lines
+13
to
+16
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The Line 14 matches any commit with scope 📝 Alternative configuration if type-based versioning should be preserved "releaseRules": [
{ "type": "refactor", "release": "patch" },
- { "scope": "deps", "release": "patch" }
+ { "type": "chore", "scope": "deps", "release": "patch" }
]Or document the current behavior if intentional. 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||
| } | ||||||||||||||||||
| ], | ||||||||||||||||||
| [ | ||||||||||||||||||
| "@semantic-release/release-notes-generator", | ||||||||||||||||||
| { "preset": "conventionalcommits" } | ||||||||||||||||||
| ], | ||||||||||||||||||
| ["@semantic-release/changelog", { "changelogFile": "CHANGELOG.md" }], | ||||||||||||||||||
| "@semantic-release/npm", | ||||||||||||||||||
| [ | ||||||||||||||||||
| "@semantic-release/git", | ||||||||||||||||||
| { | ||||||||||||||||||
| "assets": ["CHANGELOG.md", "package.json", "package-lock.json"], | ||||||||||||||||||
| "message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}" | ||||||||||||||||||
| } | ||||||||||||||||||
| ], | ||||||||||||||||||
| "@semantic-release/github" | ||||||||||||||||||
| ] | ||||||||||||||||||
| } | ||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -2,58 +2,19 @@ | |||||
|
|
||||||
| # React-Native-WebRTC | ||||||
|
|
||||||
| [](https://www.npmjs.com/package/react-native-webrtc) | ||||||
| [](https://www.npmjs.com/package/react-native-webrtc) | ||||||
| [](https://react-native-webrtc.discourse.group/) | ||||||
| [](https://www.npmjs.com/package/@stream-io/react-native-webrtc) | ||||||
| [](https://www.npmjs.com/package/@stream-io/react-native-webrtc) | ||||||
|
|
||||||
| A WebRTC module for React Native. | ||||||
|
|
||||||
| ## Feature Overview | ||||||
|
|
||||||
| | | Android | iOS | tvOS | macOS* | Windows* | Web* | Expo* | | ||||||
| | :- | :-: | :-: | :-: | :-: | :-: | :-: | :-: | | ||||||
| | Audio/Video | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | - | - | :heavy_check_mark: | :heavy_check_mark: | | ||||||
| | Data Channels | :heavy_check_mark: | :heavy_check_mark: | - | - | - | :heavy_check_mark: | :heavy_check_mark: | | ||||||
| | Screen Capture | :heavy_check_mark: | :heavy_check_mark: | - | - | - | :heavy_check_mark: | :heavy_check_mark: | | ||||||
| | Plan B | - | - | - | - | - | - | - | | ||||||
| | Unified Plan* | :heavy_check_mark: | :heavy_check_mark: | - | - | - | :heavy_check_mark: | :heavy_check_mark: | | ||||||
| | Simulcast* | :heavy_check_mark: | :heavy_check_mark: | - | - | - | :heavy_check_mark: | :heavy_check_mark: | | ||||||
|
|
||||||
| > **macOS** - We don't currently actively support macOS at this time. | ||||||
| Support might return in the future. | ||||||
|
|
||||||
| > **Windows** - We don't currently support the [react-native-windows](https://github.com/microsoft/react-native-windows) platform at this time. | ||||||
| Anyone interested in getting the ball rolling? We're open to contributions. | ||||||
|
|
||||||
| > **Web** - The [react-native-webrtc-web-shim](https://github.com/react-native-webrtc/react-native-webrtc-web-shim) project provides a shim for [react-native-web](https://github.com/necolas/react-native-web) support. | ||||||
| Which will allow you to use [(almost)](https://github.com/react-native-webrtc/react-native-webrtc-web-shim/tree/main#setup) the exact same code in your [react-native-web](https://github.com/necolas/react-native-web) project as you would with [react-native](https://reactnative.dev/) directly. | ||||||
|
|
||||||
| > **Expo** - As this module includes native code it is not available in the [Expo Go](https://expo.dev/client) app by default. | ||||||
| However you can get things working via the [expo-dev-client](https://docs.expo.dev/development/getting-started/) library and out-of-tree [config-plugins/react-native-webrtc](https://github.com/expo/config-plugins/tree/master/packages/react-native-webrtc) package. | ||||||
|
|
||||||
| > **Unified Plan** - As of version 106.0.0 Unified Plan is the only supported mode. | ||||||
| Those still in need of Plan B will need to use an older release. | ||||||
|
|
||||||
| > **Simulcast** - As of version 111.0.0 Simulcast is now possible with ease. | ||||||
| Software encode/decode factories have been enabled by default. | ||||||
|
|
||||||
| ## WebRTC Revision | ||||||
|
|
||||||
| * Currently used revision: [M124](https://github.com/jitsi/webrtc/tree/M124) | ||||||
| * Supported architectures | ||||||
| * Android: armeabi-v7a, arm64-v8a, x86, x86_64 | ||||||
| * iOS: arm64, x86_64 | ||||||
| * tvOS: arm64 | ||||||
| * macOS: arm64, x86_64 | ||||||
| A WebRTC module for React Native tailored for the [`@stream-io/video-react-native-sdk`](https://github.com/GetStream/stream-video-js) needs. | ||||||
|
|
||||||
| ## Getting Started | ||||||
|
|
||||||
| Use one of the following preferred package install methods to immediately get going. | ||||||
| Don't forget to follow platform guides below to cover any extra required steps. | ||||||
| Don't forget to follow platform guides below to cover any extra required steps. | ||||||
|
|
||||||
| **npm:** `npm install react-native-webrtc --save` | ||||||
| **yarn:** `yarn add react-native-webrtc` | ||||||
| **pnpm:** `pnpm install react-native-webrtc` | ||||||
| **npm:** `npm install @stream-io/react-native-webrtc --save` | ||||||
| **yarn:** `yarn add @stream-io/react-native-webrtc` | ||||||
| **pnpm:** `pnpm install @stream-io/react-native-webrtc` | ||||||
|
|
||||||
| ## Guides | ||||||
|
|
||||||
|
|
@@ -68,18 +29,37 @@ Don't forget to follow platform guides below to cover any extra required steps. | |||||
| ## Example Projects | ||||||
|
|
||||||
| We have some very basic example projects included in the [examples](./examples) directory. | ||||||
| Don't worry, there are plans to include a much more broader example with backend included. | ||||||
| Don't worry, there are plans to include a much more broader example with backend included. | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix grammatical error: "much more broader" is incorrect. The phrase "much more broader" uses a double comparative, which is grammatically incorrect. It should be either "much broader" or "a more comprehensive". 📝 Proposed fix-Don't worry, there are plans to include a much more broader example with backend included.
+Don't worry, there are plans to include a much broader example with backend included.📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
|
|
||||||
| ## Releasing | ||||||
|
|
||||||
| Releases are automated with [semantic-release](https://semantic-release.gitbook.io/) via the | ||||||
| [`Release`](./.github/workflows/release.yml) workflow, which is triggered manually from the | ||||||
| Actions tab (**Run workflow**). | ||||||
|
|
||||||
| There is no channel input — **the branch you dispatch from selects the release channel**, using | ||||||
| the *"Use workflow from"* branch dropdown: | ||||||
|
|
||||||
| ## Community | ||||||
| | Dispatch from | Version | npm dist-tag | | ||||||
| | :- | :- | :- | | ||||||
| | `master` | `145.1.0` | `latest` | | ||||||
| | `beta` | `145.1.0-beta.1` | `beta` | | ||||||
| | `alpha` | `145.1.0-alpha.1` | `alpha` | | ||||||
| | `<major>.x` (e.g. `145.x`) | `145.0.1` | `145.x` | | ||||||
|
|
||||||
| Come join our [Discourse Community](https://react-native-webrtc.discourse.group/) if you want to discuss any React Native and WebRTC related topics. | ||||||
| Everyone is welcome and every little helps. | ||||||
| A branch only appears in the dropdown once it exists on the remote and contains the workflow | ||||||
| file, so `alpha`/`beta`/`<major>.x` need to be branched off `master` before their first use. | ||||||
|
|
||||||
| ## Picture-in-Picture (PIP) | ||||||
| Tick **`dry_run`** to run `semantic-release --dry-run`: it computes the next version and prints | ||||||
| the release notes without publishing, tagging, or pushing. | ||||||
|
|
||||||
| This package does not include a built-in PIP implementation. PIP support is available via [`@stream-io/video-react-native-sdk`](https://github.com/GetStream/stream-video-js). | ||||||
| The version is derived from the [Conventional Commits](https://www.conventionalcommits.org/) | ||||||
| since the last tag — never by hand-editing `package.json`. `feat:` yields a minor, `fix:` a | ||||||
| patch, and `refactor:` and any `deps`-scoped commit also yield a patch. Publishing uses npm | ||||||
| [Trusted Publishing](https://docs.npmjs.com/trusted-publishers) (OIDC), so no npm token is | ||||||
| involved. | ||||||
|
|
||||||
| ## Related Projects | ||||||
|
|
||||||
| Looking for extra functionality coverage? | ||||||
| The [react-native-webrtc](https://github.com/react-native-webrtc) organization provides a number of packages which are more than useful when developing Real Time Communication applications. | ||||||
| The [react-native-webrtc](https://github.com/react-native-webrtc) organization provides a number of packages which are more than useful when developing Real Time Communication applications. | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add hyphen to compound adjective "Real Time Communication". When "Real Time" modifies "Communication" as a compound adjective, it should be hyphenated as "Real-Time Communication" for correct English grammar. 📝 Proposed fix-The [react-native-webrtc](https://github.com/react-native-webrtc) organization provides a number of packages which are more than useful when developing Real Time Communication applications.
+The [react-native-webrtc](https://github.com/react-native-webrtc) organization provides a number of packages which are more than useful when developing Real-Time Communication applications.📝 Committable suggestion
Suggested change
🧰 Tools🪛 LanguageTool[uncategorized] ~37-~37: If this is a compound adjective that modifies the following noun, use a hyphen. (EN_COMPOUND_ADJECTIVE_INTERNAL) 🤖 Prompt for AI AgentsSource: Linters/SAST tools |
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: GetStream/react-native-webrtc
Length of output: 382
🏁 Script executed:
Repository: GetStream/react-native-webrtc
Length of output: 2912
Disable checkout credential persistence for this build job.
This job only needs read access to check out the repository, but it then runs repository-controlled
npm install,pod install, and Xcode build commands. The default persisted checkout token would unnecessarily remain available to those later steps; setpersist-credentials: falseunless a later step requires authenticated Git operations.🧰 Tools
🪛 zizmor (1.26.1)
[warning] 20-20: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false
(artipacked)
🤖 Prompt for AI Agents
Source: Linters/SAST tools