Unverified 提交 6d0a4e14 authored 作者: Iñaki Baz Castillo's avatar Iñaki Baz Castillo 提交者: GitHub

Automate and publish prebuilt mediasoup-worker binaries (#1087)

上级 c977028c
...@@ -12,18 +12,21 @@ jobs: ...@@ -12,18 +12,21 @@ jobs:
ci: ci:
strategy: strategy:
matrix: matrix:
# Different Node versions on Ubuntu, the latest Node on other platforms.
ci: ci:
- os: ubuntu-22.04 - os: ubuntu-20.04
node: 16
- os: ubuntu-22.04
node: 18 node: 18
- os: ubuntu-22.04
node: 20
- os: macos-12 - os: macos-12
node: 18 node: 18
- os: windows-2022 - os: windows-2022
node: 18 node: 18
runs-on: ${{ matrix.ci.os }} runs-on: ${{ matrix.ci.os }}
env:
MEDIASOUP_SKIP_WORKER_PREBUILT_DOWNLOAD: "true"
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@v3
......
name: mediasoup-worker-prebuild
on:
push:
# Only trigger for production releases.
tags:
- "*.*.*"
# Only trigger when other workflows succeeded.
workflow_run:
workflows: [mediasoup-worker, mediasoup-node, mediasoup-rust]
types:
- completed
jobs:
ci:
strategy:
fail-fast: false
matrix:
build:
- os: ubuntu-22.04
cc: gcc
cxx: g++
- os: macos-12
cc: clang
cxx: clang++
- os: windows-2022
cc: cl
cxx: cl
node:
- 18
runs-on: ${{ matrix.build.os }}
env:
CC: ${{ matrix.build.cc }}
CXX: ${{ matrix.build.cxx }}
MEDIASOUP_SKIP_WORKER_PREBUILT_DOWNLOAD: "true"
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Node.js
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
# We need to install some NPM production deps for npm-scripts.js to work.
- run: npm ci --ignore-scripts --omit=dev
- run: npm run worker:build
# Publish prebuild binaries on tag.
- run: npm run worker:prebuild
- name: Upload mediasoup-worker prebuilt binary
uses: softprops/action-gh-release@v1
with:
files: worker/prebuild/mediasoup-worker-*.tgz
...@@ -44,6 +44,7 @@ jobs: ...@@ -44,6 +44,7 @@ jobs:
env: env:
CC: ${{ matrix.build.cc }} CC: ${{ matrix.build.cc }}
CXX: ${{ matrix.build.cxx }} CXX: ${{ matrix.build.cxx }}
MEDIASOUP_SKIP_WORKER_PREBUILT_DOWNLOAD: "true"
steps: steps:
- name: Checkout - name: Checkout
...@@ -54,6 +55,8 @@ jobs: ...@@ -54,6 +55,8 @@ jobs:
with: with:
node-version: ${{ matrix.node }} node-version: ${{ matrix.node }}
# We need to install some NPM production deps for npm-scripts.js to work.
- run: npm ci --ignore-scripts --omit=dev
- run: npm run install-clang-tools - run: npm run install-clang-tools
# TODO: Maybe fix this one day. # TODO: Maybe fix this one day.
if: runner.os != 'Windows' if: runner.os != 'Windows'
......
## Meson. ## Meson.
/worker/out
/worker/subprojects/* /worker/subprojects/*
!/worker/subprojects/*.wrap !/worker/subprojects/*.wrap
!/worker/subprojects/.clang-tidy !/worker/subprojects/.clang-tidy
...@@ -14,8 +15,8 @@ ...@@ -14,8 +15,8 @@
/target /target
## Worker. ## Worker.
/worker/out
/worker/scripts/node_modules /worker/scripts/node_modules
/worker/prebuild
# Vistual Studio generated Stuff. # Vistual Studio generated Stuff.
/worker/**/Debug /worker/**/Debug
/worker/**/Release /worker/**/Release
......
# Changelog # Changelog
### NEXT
* Automate and publish prebuilt `mediasoup-worker` binaries ([PR #1087](https://github.com/versatica/mediasoup/pull/1087), thanks to @barlock for his work in ([PR #1083](https://github.com/versatica/mediasoup/pull/1083)).
### 3.11.26 ### 3.11.26
* `Worker`: Fix NACK timer and avoid negative RTT ([PR #1082](https://github.com/versatica/mediasoup/pull/1082), thanks to o-u-p for his work in ([PR #1076](https://github.com/versatica/mediasoup/pull/1076)). * `Worker`: Fix NACK timer and avoid negative RTT ([PR #1082](https://github.com/versatica/mediasoup/pull/1082), thanks to @o-u-p for his work in ([PR #1076](https://github.com/versatica/mediasoup/pull/1076)).
### 3.11.25 ### 3.11.25
......
...@@ -18,6 +18,10 @@ Compiles mediasoup TypeScript code (`lib` folder) JavaScript, places it into the ...@@ -18,6 +18,10 @@ Compiles mediasoup TypeScript code (`lib` folder) JavaScript, places it into the
Builds the `mediasoup-worker` binary. It invokes `make`below. Builds the `mediasoup-worker` binary. It invokes `make`below.
### `npm run worker:prebuild`
Creates a prebuilt of `mediasoup-worker` in the `worker/prebuild` folder.
### `npm run lint` ### `npm run lint`
Runs both `npm run lint:node` and `npm run lint:worker`. Runs both `npm run lint:node` and `npm run lint:worker`.
...@@ -60,7 +64,7 @@ Installs clang tools needed for local development. ...@@ -60,7 +64,7 @@ Installs clang tools needed for local development.
## Rust ## Rust
The only special feature in Rust case is special environment variable `KEEP_BUILD_ARTIFACTS`, that when set to `1` will allow incremental recompilation of changed C++ sources during hacking on mediasoup. The only special feature in Rust case is special environment variable `"KEEP_BUILD_ARTIFACTS", that when set to `1` will allow incremental recompilation of changed C++ sources during hacking on mediasoup.
It is not necessary for normal usage of mediasoup as a dependency. It is not necessary for normal usage of mediasoup as a dependency.
## Makefile ## Makefile
...@@ -132,7 +136,7 @@ MEDIASOUP_WORKER_BIN="/home/xxx/src/foo/mediasoup-worker" node myapp.js ...@@ -132,7 +136,7 @@ MEDIASOUP_WORKER_BIN="/home/xxx/src/foo/mediasoup-worker" node myapp.js
Builds the `libmediasoup-worker` static library at `worker/out/Release/`. Builds the `libmediasoup-worker` static library at `worker/out/Release/`.
`MEDIASOUP_MAX_CORES` and `MEDIASOUP_BUILDTYPE` environment variables from above still apply for static library build. "MEDIASOUP_MAX_CORES"` and "MEDIASOUP_BUILDTYPE" environment variables from above still apply for static library build.
### `make xcode` ### `make xcode`
...@@ -160,7 +164,7 @@ Runs [clang-tidy](http://clang.llvm.org/extra/clang-tidy/) and performs C++ code ...@@ -160,7 +164,7 @@ Runs [clang-tidy](http://clang.llvm.org/extra/clang-tidy/) and performs C++ code
* [PyYAML](https://pyyaml.org/) is required. * [PyYAML](https://pyyaml.org/) is required.
- In OSX install it with `brew install libyaml` and `sudo easy_install-X.Y pyyaml`. - In OSX install it with `brew install libyaml` and `sudo easy_install-X.Y pyyaml`.
`MEDIASOUP_TIDY_CHECKS` environment variable with a comma separated list of checks overrides the checks defined in `.clang-tidy` file. "MEDIASOUP_TIDY_CHECKS" environment variable with a comma separated list of checks overrides the checks defined in `.clang-tidy` file.
### `make fuzzer` ### `make fuzzer`
......
...@@ -13,13 +13,13 @@ const eslintConfig = ...@@ -13,13 +13,13 @@ const eslintConfig =
settings : {}, settings : {},
parserOptions : parserOptions :
{ {
ecmaVersion : 2018, ecmaVersion : 2022,
sourceType : 'module', sourceType : 'module',
ecmaFeatures : ecmaFeatures :
{ {
impliedStrict : true impliedStrict : true
}, },
lib : [ 'es2018' ], lib : [ 'es2022' ],
project : 'node/tsconfig.json' project : 'node/tsconfig.json'
}, },
globals : globals :
...@@ -78,7 +78,7 @@ const eslintConfig = ...@@ -78,7 +78,7 @@ const eslintConfig =
'max-len' : [ 2, 100, 'max-len' : [ 2, 100,
{ {
tabWidth : 2, tabWidth : 2,
comments : 84, comments : 88,
ignoreUrls : true, ignoreUrls : true,
ignoreStrings : true, ignoreStrings : true,
ignoreTemplateLiterals : true, ignoreTemplateLiterals : true,
...@@ -166,7 +166,12 @@ const eslintConfig = ...@@ -166,7 +166,12 @@ const eslintConfig =
'prefer-rest-params' : 2, 'prefer-rest-params' : 2,
'prefer-spread' : 2, 'prefer-spread' : 2,
'prefer-template' : 2, 'prefer-template' : 2,
'quotes' : [ 2, 'single', { avoidEscape: true } ], 'quotes' : [ 2, 'single',
{
avoidEscape : true,
allowTemplateLiterals : true
}
],
'semi' : [ 2, 'always' ], 'semi' : [ 2, 'always' ],
'semi-spacing' : 2, 'semi-spacing' : 2,
'space-before-blocks' : 2, 'space-before-blocks' : 2,
......
差异被折叠。
差异被折叠。
...@@ -53,6 +53,7 @@ ...@@ -53,6 +53,7 @@
"typescript:build": "node npm-scripts.js typescript:build", "typescript:build": "node npm-scripts.js typescript:build",
"typescript:watch": "node npm-scripts.js typescript:watch", "typescript:watch": "node npm-scripts.js typescript:watch",
"worker:build": "node npm-scripts.js worker:build", "worker:build": "node npm-scripts.js worker:build",
"worker:prebuild": "node npm-scripts.js worker:prebuild",
"lint": "npm run lint:node && npm run lint:worker", "lint": "npm run lint:node && npm run lint:worker",
"lint:node": "node npm-scripts.js lint:node", "lint:node": "node npm-scripts.js lint:node",
"lint:worker": "node npm-scripts.js lint:worker", "lint:worker": "node npm-scripts.js lint:worker",
...@@ -64,7 +65,8 @@ ...@@ -64,7 +65,8 @@
"install-deps:node": "node npm-scripts.js install-deps:node", "install-deps:node": "node npm-scripts.js install-deps:node",
"install-clang-tools": "node npm-scripts.js install-clang-tools", "install-clang-tools": "node npm-scripts.js install-clang-tools",
"release:check": "node npm-scripts.js release:check", "release:check": "node npm-scripts.js release:check",
"release": "node npm-scripts.js release" "release": "node npm-scripts.js release",
"release:upload-mac-arm-prebuilt-worker": "node npm-scripts.js release:upload-mac-arm-prebuilt-worker"
}, },
"jest": { "jest": {
"verbose": true, "verbose": true,
...@@ -87,19 +89,23 @@ ...@@ -87,19 +89,23 @@
"dependencies": { "dependencies": {
"debug": "^4.3.4", "debug": "^4.3.4",
"h264-profile-level-id": "^1.0.1", "h264-profile-level-id": "^1.0.1",
"node-fetch": "^2.6.11",
"supports-color": "^9.3.1", "supports-color": "^9.3.1",
"tar": "^6.1.15",
"uuid": "^9.0.0" "uuid": "^9.0.0"
}, },
"devDependencies": { "devDependencies": {
"@types/debug": "^4.1.7", "@octokit/rest": "^19.0.11",
"@types/debug": "^4.1.8",
"@types/jest": "^29.5.1", "@types/jest": "^29.5.1",
"@types/node": "^18.15.11", "@types/node": "^18.15.11",
"@types/uuid": "^9.0.1", "@types/uuid": "^9.0.1",
"@typescript-eslint/eslint-plugin": "^5.59.6", "@typescript-eslint/eslint-plugin": "^5.59.7",
"@typescript-eslint/parser": "^5.59.6", "@typescript-eslint/parser": "^5.59.7",
"eslint": "^8.40.0", "eslint": "^8.41.0",
"eslint-plugin-jest": "^27.2.1", "eslint-plugin-jest": "^27.2.1",
"jest": "^29.5.0", "jest": "^29.5.0",
"marked": "^5.0.2",
"open-cli": "^7.2.0", "open-cli": "^7.2.0",
"pick-port": "^1.0.1", "pick-port": "^1.0.1",
"sctp": "^1.0.0", "sctp": "^1.0.0",
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论