diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9e0185715..7736a7388 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 @@ -32,6 +35,73 @@ jobs: echo "SRS_VERSION=$SRS_VERSION" >> $GITHUB_ENV SRS_MAJOR=$(echo $SRS_TAG| cut -c 2) echo "SRS_MAJOR=$SRS_MAJOR" >> $GITHUB_ENV + + # Tests + - name: Build test image + run: docker build --tag srs:test -f trunk/Dockerfile.test . + # For utest + - name: Run SRS utest + run: docker run --rm srs:test bash -c 'make utest && ./objs/srs_utest' + # For regression-test + - 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 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 --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 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 tag ossrs/srs:$SRS_TAG ossrs/srs:$SRS_MAJOR + docker tag ossrs/srs:$SRS_TAG ossrs/srs:latest + 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: + login-server: https://registry.cn-hangzhou.aliyuncs.com + username: "${{ secrets.ACR_USERNAME }}" + password: "${{ secrets.ACR_PASSWORD }}" + - name: Push to Aliyun docker hub + run: | + docker tag ossrs/srs:$SRS_TAG 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 tag ossrs/srs:$SRS_TAG 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 tag ossrs/srs:$SRS_TAG 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 + + ################################################################################################################## + ################################################################################################################## + ################################################################################################################## # Create source tar for release # Generate variables like: # SRS_SOURCE_TAR=srs-server-4.0.145.tar.gz @@ -44,6 +114,7 @@ jobs: 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 @@ -59,76 +130,6 @@ jobs: 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 . - # For utest - - name: Run SRS utest - run: docker run --rm srs:test bash -c 'make utest && ./objs/srs_utest' - # For regression-test - - 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 - - name: Build SRS docker image - env: - PACKAGER: ${{ secrets.SRS_PACKAGER_DOCKER }} - run: | - echo "Release ossrs/srs:$SRS_TAG" - docker build --tag ossrs/srs:$SRS_TAG --build-arg SRS_AUTO_PACKAGER=$PACKAGER -f trunk/Dockerfile . - - ################################################################ - # Docker - - 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 - - name: Login Aliyun docker hub - uses: aliyun/acr-login@v1 - with: - login-server: https://registry.cn-hangzhou.aliyuncs.com - username: "${{ secrets.ACR_USERNAME }}" - password: "${{ secrets.ACR_PASSWORD }}" - - 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 - - ################################################################ - # 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 release. - name: Create release id: create_release @@ -156,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 @@ -165,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 @@ -175,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 + diff --git a/trunk/doc/CHANGELOG.md b/trunk/doc/CHANGELOG.md index 24ee26ca0..6f2008801 100644 --- a/trunk/doc/CHANGELOG.md +++ b/trunk/doc/CHANGELOG.md @@ -8,6 +8,7 @@ The changelog for SRS. ## SRS 4.0 Changelog +* v4.0, 2022-01-17, Support docker image for [droplet](https://hub.docker.com/r/ossrs/droplet). v4.0.230 * v4.0, 2022-01-16, Update README for **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))** * v4.0, 2022-01-13, Merge [#2872](https://github.com/ossrs/srs/pull/2872): RTC: fix play rtc judge for config rtc2rtmp on. (#2872). v4.0.229 * v4.0, 2022-01-13, Support configure with --config as default config file. v4.0.227 diff --git a/trunk/src/core/srs_core_version4.hpp b/trunk/src/core/srs_core_version4.hpp index 32d01f087..1dbdd5f86 100644 --- a/trunk/src/core/srs_core_version4.hpp +++ b/trunk/src/core/srs_core_version4.hpp @@ -9,6 +9,6 @@ #define VERSION_MAJOR 4 #define VERSION_MINOR 0 -#define VERSION_REVISION 229 +#define VERSION_REVISION 230 #endif