Skip to content

Commit

Permalink
Merge branch 'ossrs:4.0release' into 4.0release
Browse files Browse the repository at this point in the history
  • Loading branch information
mingyang0921 authored Jan 19, 2022
2 parents b5f94de + dc43a11 commit 57f2308
Show file tree
Hide file tree
Showing 28 changed files with 302 additions and 258 deletions.
133 changes: 78 additions & 55 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,13 @@ jobs:
runs-on: ubuntu-20.04

steps:
################################################################
##################################################################################################################
##################################################################################################################
##################################################################################################################
# Git checkout
- name: Checkout repository
uses: actions/checkout@v2

# The github.ref is, for example, refs/tags/v4.0.145 or refs/tags/v4.0-r8
# Generate variables like:
# SRS_TAG=v4.0-r8
Expand All @@ -32,32 +35,7 @@ jobs:
echo "SRS_VERSION=$SRS_VERSION" >> $GITHUB_ENV
SRS_MAJOR=$(echo $SRS_TAG| cut -c 2)
echo "SRS_MAJOR=$SRS_MAJOR" >> $GITHUB_ENV
# Create source tar for release
# Generate variables like:
# SRS_SOURCE_TAR=srs-server-4.0.145.tar.gz
# SRS_SOURCE_MD5=83e38700a80a26e30b2df054e69956e5
- name: Create source tar.gz
run: |
DEST_DIR=srs-server-$SRS_VERSION && mkdir -p $DEST_DIR &&
cp README.md $DEST_DIR && cp LICENSE $DEST_DIR && cp -R trunk $DEST_DIR/trunk &&
(cd $DEST_DIR/trunk/3rdparty && rm -rf *.zip openssl-*.gz srs-bench) &&
tar zcf ${DEST_DIR}.tar.gz ${DEST_DIR} && du -sh ${DEST_DIR}* && rm -rf ${DEST_DIR} &&
echo "SRS_SOURCE_TAR=${DEST_DIR}.tar.gz" >> $GITHUB_ENV &&
echo "SRS_SOURCE_MD5=$(md5sum ${DEST_DIR}.tar.gz| awk '{print $1}')" >> $GITHUB_ENV
# Create package tar for release
# Generate variables like:
# SRS_PACKAGE_ZIP=SRS-CentOS7-x86_64-4.0.145.zip
# SRS_PACKAGE_MD5=3880a26e30b283edf05700a4e69956e5
- name: Create package zip
run: |
docker build --tag srs:pkg --build-arg version=$SRS_VERSION -f trunk/Dockerfile.pkg . &&
SRS_PACKAGE_ZIP=SRS-CentOS7-x86_64-$SRS_VERSION.zip &&
docker run --rm -v $(pwd):/output srs:pkg cp objs/$SRS_PACKAGE_ZIP /output/ &&
du -sh $SRS_PACKAGE_ZIP &&
echo "SRS_PACKAGE_ZIP=$SRS_PACKAGE_ZIP" >> $GITHUB_ENV &&
echo "SRS_PACKAGE_MD5=$(md5sum $SRS_PACKAGE_ZIP| awk '{print $1}')" >> $GITHUB_ENV
################################################################
# Tests
- name: Build test image
run: docker build --tag srs:test -f trunk/Dockerfile.test .
Expand All @@ -68,29 +46,37 @@ jobs:
- name: Run SRS regression-test
run: docker run --rm srs:test bash -c 'make && ./objs/srs -c conf/regression-test.conf && cd 3rdparty/srs-bench && make && ./objs/srs_test -test.v'

################################################################
# Build
# Build SRS image
##################################################################################################################
##################################################################################################################
##################################################################################################################
# Build SRS docker images
- name: Build SRS docker image
env:
PACKAGER: ${{ secrets.SRS_PACKAGER_DOCKER }}
PACKAGER_DROPLET: ${{ secrets.SRS_PACKAGER_DROPLET }}
run: |
echo "Release ossrs/srs:$SRS_TAG"
docker build --tag ossrs/srs:$SRS_TAG -f trunk/Dockerfile .
docker build --tag ossrs/srs:$SRS_TAG --build-arg SRS_AUTO_PACKAGER=$PACKAGER -f trunk/Dockerfile .
echo "Release ossrs/droplet:$SRS_TAG"
docker build --tag ossrs/droplet:$SRS_TAG --build-arg SRS_AUTO_PACKAGER=$PACKAGER_DROPLET -f trunk/Dockerfile .
################################################################
# Docker
# Docker hub
- name: Login docker hub
uses: docker/login-action@v1
with:
username: "${{ secrets.DOCKER_USERNAME }}"
password: "${{ secrets.DOCKER_PASSWORD }}"
- name: Push to docker hub
run: |
docker push ossrs/srs:$SRS_TAG
docker tag ossrs/srs:$SRS_TAG ossrs/srs:$SRS_MAJOR
docker push ossrs/srs:$SRS_MAJOR
docker tag ossrs/srs:$SRS_TAG ossrs/srs:latest
docker push ossrs/srs:latest
# Aliyun ACR
docker push --all-tags ossrs/srs
#
docker tag ossrs/droplet:$SRS_TAG ossrs/droplet:$SRS_MAJOR
docker tag ossrs/droplet:$SRS_TAG ossrs/droplet:latest
docker push --all-tags ossrs/droplet
# Aliyun ACR hub
- name: Login Aliyun docker hub
uses: aliyun/acr-login@v1
with:
Expand All @@ -100,31 +86,50 @@ jobs:
- name: Push to Aliyun docker hub
run: |
docker tag ossrs/srs:$SRS_TAG registry.cn-hangzhou.aliyuncs.com/ossrs/srs:$SRS_TAG
docker push registry.cn-hangzhou.aliyuncs.com/ossrs/srs:$SRS_TAG
docker tag ossrs/srs:$SRS_TAG registry.cn-hangzhou.aliyuncs.com/ossrs/srs:$SRS_VERSION
docker push registry.cn-hangzhou.aliyuncs.com/ossrs/srs:$SRS_VERSION
docker tag ossrs/srs:$SRS_TAG registry.cn-hangzhou.aliyuncs.com/ossrs/srs:v$SRS_MAJOR
docker push registry.cn-hangzhou.aliyuncs.com/ossrs/srs:v$SRS_MAJOR
docker tag ossrs/srs:$SRS_TAG registry.cn-hangzhou.aliyuncs.com/ossrs/srs:$SRS_MAJOR
docker push registry.cn-hangzhou.aliyuncs.com/ossrs/srs:$SRS_MAJOR
docker tag ossrs/srs:$SRS_TAG registry.cn-hangzhou.aliyuncs.com/ossrs/srs:latest
docker push registry.cn-hangzhou.aliyuncs.com/ossrs/srs:latest
docker push --all-tags registry.cn-hangzhou.aliyuncs.com/ossrs/srs
#
docker tag ossrs/droplet:$SRS_TAG registry.cn-hangzhou.aliyuncs.com/ossrs/droplet:$SRS_TAG
docker tag ossrs/droplet:$SRS_TAG registry.cn-hangzhou.aliyuncs.com/ossrs/droplet:$SRS_VERSION
docker tag ossrs/droplet:$SRS_TAG registry.cn-hangzhou.aliyuncs.com/ossrs/droplet:v$SRS_MAJOR
docker tag ossrs/droplet:$SRS_TAG registry.cn-hangzhou.aliyuncs.com/ossrs/droplet:$SRS_MAJOR
docker tag ossrs/droplet:$SRS_TAG registry.cn-hangzhou.aliyuncs.com/ossrs/droplet:latest
docker push --all-tags registry.cn-hangzhou.aliyuncs.com/ossrs/droplet
################################################################
# K8S
- name: Setup KUBCONFIG for Aliyun ACK
run: |-
KUBECONFIG=$RUNNER_TEMP/kubeconfig_$(date +%s)
echo "${{ secrets.KUBCONFIG }}" > $KUBECONFIG
echo "KUBECONFIG=$KUBECONFIG" >> $GITHUB_ENV
# K8S for SRS 4.0
- name: Release SRS 4.0 to Aliyun ACK
if: ${{ startsWith(github.ref, 'refs/tags/v4') }}
run: |-
kubectl set image deploy/srs4-deploy srs4=registry.cn-hangzhou.aliyuncs.com/ossrs/srs:$SRS_TAG
kubectl describe deploy/srs4-deploy
##################################################################################################################
##################################################################################################################
##################################################################################################################
# Create source tar for release
# Generate variables like:
# SRS_SOURCE_TAR=srs-server-4.0.145.tar.gz
# SRS_SOURCE_MD5=83e38700a80a26e30b2df054e69956e5
- name: Create source tar.gz
run: |
DEST_DIR=srs-server-$SRS_VERSION && mkdir -p $DEST_DIR &&
cp README.md $DEST_DIR && cp LICENSE $DEST_DIR && cp -R trunk $DEST_DIR/trunk &&
(cd $DEST_DIR/trunk/3rdparty && rm -rf *.zip openssl-*.gz srs-bench) &&
tar zcf ${DEST_DIR}.tar.gz ${DEST_DIR} && du -sh ${DEST_DIR}* && rm -rf ${DEST_DIR} &&
echo "SRS_SOURCE_TAR=${DEST_DIR}.tar.gz" >> $GITHUB_ENV &&
echo "SRS_SOURCE_MD5=$(md5sum ${DEST_DIR}.tar.gz| awk '{print $1}')" >> $GITHUB_ENV
# Create package tar for release
# Generate variables like:
# SRS_PACKAGE_ZIP=SRS-CentOS7-x86_64-4.0.145.zip
# SRS_PACKAGE_MD5=3880a26e30b283edf05700a4e69956e5
- name: Create package zip
env:
PACKAGER: ${{ secrets.SRS_PACKAGER_BINARY }}
run: |
docker build --tag srs:pkg --build-arg version=$SRS_VERSION --build-arg SRS_AUTO_PACKAGER=$PACKAGER -f trunk/Dockerfile.pkg . &&
SRS_PACKAGE_ZIP=SRS-CentOS7-x86_64-$SRS_VERSION.zip &&
docker run --rm -v $(pwd):/output srs:pkg cp objs/$SRS_PACKAGE_ZIP /output/ &&
du -sh $SRS_PACKAGE_ZIP &&
echo "SRS_PACKAGE_ZIP=$SRS_PACKAGE_ZIP" >> $GITHUB_ENV &&
echo "SRS_PACKAGE_MD5=$(md5sum $SRS_PACKAGE_ZIP| awk '{print $1}')" >> $GITHUB_ENV
################################################################
# Create release.
- name: Create release
id: create_release
Expand Down Expand Up @@ -152,6 +157,7 @@ jobs:
* [FAQ](https://github.com/ossrs/srs/issues/2716), [Features](https://github.com/ossrs/srs/blob/4.0release/trunk/doc/Features.md#features) or [ChangeLogs](https://github.com/ossrs/srs/blob/4.0release/trunk/doc/CHANGELOG.md#changelog)
draft: false
prerelease: false

# Upload release source files
- name: Upload Release Assets Source
id: upload-release-assets-source
Expand All @@ -161,6 +167,7 @@ jobs:
with:
release_id: ${{ steps.create_release.outputs.id }}
assets_path: ${{ env.SRS_SOURCE_TAR }}

# Upload release package files
- name: Upload Release Assets Package
id: upload-release-assets-package
Expand All @@ -171,3 +178,19 @@ jobs:
release_id: ${{ steps.create_release.outputs.id }}
assets_path: ${{ env.SRS_PACKAGE_ZIP }}

##################################################################################################################
##################################################################################################################
##################################################################################################################
# K8S release to official website
- name: Setup KUBCONFIG for Aliyun ACK
run: |-
KUBECONFIG=$RUNNER_TEMP/kubeconfig_$(date +%s)
echo "${{ secrets.KUBCONFIG }}" > $KUBECONFIG
echo "KUBECONFIG=$KUBECONFIG" >> $GITHUB_ENV
# K8S for SRS 4.0
- name: Release SRS 4.0 to Aliyun ACK
if: ${{ startsWith(github.ref, 'refs/tags/v4') }}
run: |-
kubectl set image deploy/srs4-deploy srs4=registry.cn-hangzhou.aliyuncs.com/ossrs/srs:$SRS_TAG
kubectl describe deploy/srs4-deploy
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Welome to contribute to SRS!

1. Please read [FAQ](https://github.com/ossrs/srs/issues/2716) before file new PR.
2. Fix some [issues](https://github.com/ossrs/srs/issues), then follow the [guide](https://github.com/ossrs/srs/wiki/HowToFilePR).
1. Please read **Contribution([CN](https://github.com/ossrs/srs/issues/2866#contribution) EN)** before file new PR.
2. Please start from fixing some [Issues: good first issue](https://github.com/ossrs/srs/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22), then follow the [guide](https://github.com/ossrs/srs/wiki/HowToFilePR).
3. We will review your PR ASAP.
29 changes: 18 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@
[![](https://ossrs.net/wiki/images/srs-faq.svg)](https://github.com/ossrs/srs/issues/2716)
[![](https://ossrs.net/wiki/images/mulan-incubating.svg)](http://mulanos.cn)
[![](https://ossrs.net/wiki/images/srs-alternativeto.svg)](https://alternativeto.net/software/srs/about/)
[![](https://ossrs.net/wiki/images/srs-facebook.svg)](https://www.facebook.com/winlinvip)
[![](https://badgen.net/twitter/follow/winlinvip)](https://twitter.com/winlinvip)
[![](https://img.shields.io/youtube/channel/views/UCP6ZblCL_fIJoEyUzZxC1ng?style=social)](https://www.youtube.com/channel/UCP6ZblCL_fIJoEyUzZxC1ng)
[![](https://img.shields.io/twitch/status/winlinvip?style=social)](https://www.twitch.tv/winlinvip)
[![](https://badgen.net/discord/members/yZ4BnPmHAd)](https://discord.gg/yZ4BnPmHAd)
[![](https://opencollective.com/srs-server/tiers/badge.svg)](https://opencollective.com/srs-server/contribute)
[![](https://badgen.net/badge/srs/stackoverflow/orange?icon=terminal)](https://stackoverflow.com/questions/tagged/simple-realtime-server)
Expand All @@ -32,12 +29,6 @@ SRS is licenced under [MIT][LICENSE], but some depended libraries are distribute
<a name="usage-docker"></a>
## Usage

> Highly recommend that directly run SRS by
> **docker([CN](https://github.com/ossrs/srs/wiki/v4_CN_Home#docker) / [EN](https://github.com/ossrs/srs/wiki/v4_EN_Home#docker))**,
> or **K8s([CN](https://github.com/ossrs/srs/wiki/v4_CN_Home#k8s) / [EN](https://github.com/ossrs/srs/wiki/v4_EN_Home#k8s))**,
> however it's also easy to build SRS from source code, for detail please see
> **Getting Started([CN](https://github.com/ossrs/srs/wiki/v4_CN_Home#getting-started) / [EN](https://github.com/ossrs/srs/wiki/v4_EN_Home#getting-started))**.
Build SRS from source:

```
Expand All @@ -52,8 +43,6 @@ by [FFmpeg](https://ffmpeg.org/download.html) or [OBS](https://obsproject.com/do
ffmpeg -re -i ./doc/source.flv -c copy -f flv -y rtmp://localhost/live/livestream
```

> Note: It's also able to [publish by H5](http://localhost:8080/players/rtc_publisher.html?autostart=true) if WebRTC is enabled.
Play the following streams by [players](https://ossrs.net):

* RTMP (by [VLC](https://www.videolan.org/)): rtmp://localhost/live/livestream
Expand All @@ -64,6 +53,22 @@ Note that if convert RTMP to WebRTC, please use [`rtmp2rtc.conf`](https://github

* H5(WebRTC): [webrtc://localhost/live/livestream](http://localhost:8080/players/rtc_player.html?autostart=true)

> Note: Besides of FFmpeg or OBS, it's also able to [publish by H5](http://localhost:8080/players/rtc_publisher.html?autostart=true)
> if [WebRTC](https://github.com/ossrs/srs/issues/307) is enabled.
> Highly recommend that directly run SRS by
> **docker([CN](https://github.com/ossrs/srs/wiki/v4_CN_Home#docker) / [EN](https://github.com/ossrs/srs/wiki/v4_EN_Home#docker))**,
> **Cloud Virtual Machine([CN](https://github.com/ossrs/srs/wiki/v4_CN_Home#cloud-virtual-machine) / [EN](https://github.com/ossrs/srs/wiki/v4_EN_Home#cloud-virtual-machine))**,
> or **K8s([CN](https://github.com/ossrs/srs/wiki/v4_CN_Home#k8s) / [EN](https://github.com/ossrs/srs/wiki/v4_EN_Home#k8s))**,
> however it's also easy to build SRS from source code, for detail please see
> **Getting Started([CN](https://github.com/ossrs/srs/wiki/v4_CN_Home#getting-started) / [EN](https://github.com/ossrs/srs/wiki/v4_EN_Home#getting-started))**.
> Note: If need HTTPS, by which WebRTC and modern browsers require, please read
> **HTTPS API([CN](https://github.com/ossrs/srs/wiki/v4_CN_HTTPApi#https-api) / [EN](https://github.com/ossrs/srs/wiki/v4_EN_HTTPApi#https-api))**
> and **HTTPS Callback([CN](https://github.com/ossrs/srs/wiki/v4_CN_HTTPCallback#https-callback) / [EN](https://github.com/ossrs/srs/wiki/v4_EN_HTTPCallback#https-callback))**
> and **HTTPS Live Streaming([CN](https://github.com/ossrs/srs/wiki/v4_EN_DeliveryHttpStream#https-flv-live-stream) / [EN](https://github.com/ossrs/srs/wiki/v4_EN_DeliveryHttpStream#https-flv-live-stream))**,
> however HTTPS proxy also works perfect with SRS such as Nginx.
<a name="srs-40-wiki"></a>
<a name="wiki"></a>

Expand Down Expand Up @@ -126,6 +131,8 @@ A big THANK YOU goes to:

## Releases

* 2022-01-17, Release [v4.0-b4](https://github.com/ossrs/srs/releases/tag/v4.0-b4), v4.0-b4, 4.0 beta4, v4.0.230, 144393 lines.
* 2022-01-13, Release [v4.0-b3](https://github.com/ossrs/srs/releases/tag/v4.0-b3), v4.0-b3, 4.0 beta3, v4.0.229, 144393 lines.
* 2022-01-03, Release [v4.0-b2](https://github.com/ossrs/srs/releases/tag/v4.0-b2), v4.0-b2, 4.0 beta2, v4.0.215, 144278 lines.
* 2021-12-19, Release [v4.0-b1](https://github.com/ossrs/srs/releases/tag/v4.0-b1), v4.0-b1, 4.0 beta1, v4.0.206, 144126 lines.
* 2021-12-01, Release [v4.0-b0](https://github.com/ossrs/srs/releases/tag/v4.0-b0), v4.0-b0, 4.0 beta0, v4.0.201, 144022 lines.
Expand Down
2 changes: 2 additions & 0 deletions trunk/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ FROM ossrs/srs:dev AS build
# Install depends tools.
RUN yum install -y gcc make gcc-c++ patch unzip perl git

ARG SRS_AUTO_PACKAGER

# Build and install SRS.
COPY . /srs
WORKDIR /srs/trunk
Expand Down
4 changes: 1 addition & 3 deletions trunk/Dockerfile.pkg
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@ FROM ossrs/srs:dev

# version=4.0.145
ARG version
ARG SRS_AUTO_PACKAGER

# Install depends tools.
RUN yum install -y zip

# Setup the packager env.
ENV SRS_AUTO_PACKAGER ossrs

# Build and install SRS.
ADD srs-server-${version}.tar.gz /srs
WORKDIR /srs/srs-server-${version}/trunk
Expand Down
1 change: 1 addition & 0 deletions trunk/auto/auto_headers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ fi
# prefix
echo "" >> $SRS_AUTO_HEADERS_H
echo "#define SRS_PREFIX \"${SRS_PREFIX}\"" >> $SRS_AUTO_HEADERS_H
echo "#define SRS_DEFAULT_CONFIG \"${SRS_DEFAULT_CONFIG}\"" >> $SRS_AUTO_HEADERS_H

echo "" >> $SRS_AUTO_HEADERS_H

Expand Down
4 changes: 4 additions & 0 deletions trunk/auto/options.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ SRS_FFMPEG_TOOL=NO
SRS_FFMPEG_FIT=RESERVED
# arguments
SRS_PREFIX=/usr/local/srs
SRS_DEFAULT_CONFIG=conf/srs.conf
SRS_JOBS=1
SRS_STATIC=NO
# If enabled, link shared libraries for libst.so which uses MPL license.
Expand Down Expand Up @@ -127,6 +128,7 @@ Features:
--ffmpeg-fit=on|off Whether enable the FFmpeg fit(source code). Default: $(value2switch $SRS_FFMPEG_FIT)
--prefix=<path> The absolute installation path. Default: $SRS_PREFIX
--config=<path> The default config file for SRS. Default: $SRS_DEFAULT_CONFIG
--gcov=on|off Whether enable the GCOV compiler options. Default: $(value2switch $SRS_GCOV)
--debug=on|off Whether enable the debug code, may hurt performance. Default: $(value2switch $SRS_DEBUG)
--debug-stats=on|off Whether enable the debug stats, may hurt performance. Default: $(value2switch $SRS_DEBUG_STATS)
Expand Down Expand Up @@ -220,6 +222,7 @@ function parse_user_option() {

--jobs) SRS_JOBS=${value} ;;
--prefix) SRS_PREFIX=${value} ;;
--config) SRS_DEFAULT_CONFIG=${value} ;;

--static) SRS_STATIC=$(switch2value $value) ;;
--cpu) SRS_CROSS_BUILD_CPU=${value} ;;
Expand Down Expand Up @@ -492,6 +495,7 @@ function regenerate_options() {
SRS_AUTO_USER_CONFIGURE=`echo $opt`
# regenerate the options for default values.
SRS_AUTO_CONFIGURE="--prefix=${SRS_PREFIX}"
SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --config=$SRS_DEFAULT_CONFIG"
SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --hls=$(value2switch $SRS_HLS)"
SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --hds=$(value2switch $SRS_HDS)"
SRS_AUTO_CONFIGURE="${SRS_AUTO_CONFIGURE} --dvr=$(value2switch $SRS_DVR)"
Expand Down
4 changes: 2 additions & 2 deletions trunk/conf/docker.conf
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ vhost __defaultVhost__ {
rtc {
enabled on;
# @see https://github.com/ossrs/srs/wiki/v4_CN_WebRTC#rtmp-to-rtc
rtmp_to_rtc off;
rtmp_to_rtc on;
# @see https://github.com/ossrs/srs/wiki/v4_CN_WebRTC#rtc-to-rtmp
rtc_to_rtmp off;
rtc_to_rtmp on;
}
}
Loading

0 comments on commit 57f2308

Please sign in to comment.