mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
Auto create package by github actions. v4.0.191
This commit is contained in:
parent
ab5079909d
commit
eb20458d23
4 changed files with 47 additions and 6 deletions
34
.github/workflows/release.yml
vendored
34
.github/workflows/release.yml
vendored
|
@ -18,14 +18,17 @@ jobs:
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
# The github.ref is, for example, refs/tags/v4.0.145 or refs/tags/v4.0-r8
|
# The github.ref is, for example, refs/tags/v4.0.145 or refs/tags/v4.0-r8
|
||||||
# Generate variables like:
|
# Generate variables like:
|
||||||
# SRS_TAG=v4.0.145
|
|
||||||
# SRS_TAG=v4.0-r8
|
# SRS_TAG=v4.0-r8
|
||||||
|
# SRS_TAG=v4.0.145
|
||||||
|
# SRS_VERSION=4.0.145
|
||||||
# SRS_MAJOR=4
|
# SRS_MAJOR=4
|
||||||
# @see https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable
|
# @see https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable
|
||||||
- name: Generate varaiables
|
- name: Generate varaiables
|
||||||
run: |
|
run: |
|
||||||
SRS_TAG=$(echo ${{ github.ref }}| awk -F '/' '{print $3}')
|
SRS_TAG=$(echo ${{ github.ref }}| awk -F '/' '{print $3}')
|
||||||
echo "SRS_TAG=$SRS_TAG" >> $GITHUB_ENV
|
echo "SRS_TAG=$SRS_TAG" >> $GITHUB_ENV
|
||||||
|
SRS_VERSION=$(echo ${SRS_TAG}| sed 's/^v//g')
|
||||||
|
echo "SRS_VERSION=$SRS_VERSION" >> $GITHUB_ENV
|
||||||
SRS_MAJOR=$(echo $SRS_TAG| cut -c 2)
|
SRS_MAJOR=$(echo $SRS_TAG| cut -c 2)
|
||||||
echo "SRS_MAJOR=$SRS_MAJOR" >> $GITHUB_ENV
|
echo "SRS_MAJOR=$SRS_MAJOR" >> $GITHUB_ENV
|
||||||
# Create source tar for release
|
# Create source tar for release
|
||||||
|
@ -34,12 +37,23 @@ jobs:
|
||||||
# SRS_SOURCE_MD5=83e38700a80a26e30b2df054e69956e5
|
# SRS_SOURCE_MD5=83e38700a80a26e30b2df054e69956e5
|
||||||
- name: Create source tar.gz
|
- name: Create source tar.gz
|
||||||
run: |
|
run: |
|
||||||
DEST_DIR=srs-server-$(echo ${SRS_TAG}| sed 's/^v//g') && mkdir -p $DEST_DIR &&
|
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 &&
|
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) &&
|
(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} &&
|
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_TAR=${DEST_DIR}.tar.gz" >> $GITHUB_ENV &&
|
||||||
echo "SRS_SOURCE_MD5=$(md5sum ${DEST_DIR}.tar.gz| awk '{print $1}')" >> $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/ &&
|
||||||
|
echo "SRS_PACKAGE_ZIP=$SRS_PACKAGE_ZIP" >> $GITHUB_ENV &&
|
||||||
|
echo "SRS_PACKAGE_MD5=$(md5sum $SRS_PACKAGE_ZIP| awk '{print $1}')" >> $GITHUB_ENV
|
||||||
|
|
||||||
################################################################
|
################################################################
|
||||||
# Tests
|
# Tests
|
||||||
|
@ -115,15 +129,25 @@ jobs:
|
||||||
body: |
|
body: |
|
||||||
${{ github.event.head_commit.message }}
|
${{ github.event.head_commit.message }}
|
||||||
${{ env.SRS_SOURCE_MD5 }} [${{ env.SRS_SOURCE_TAR }}](https://github.com/ossrs/srs/releases/download/${{ env.SRS_TAG }}/${{ env.SRS_SOURCE_TAR }})
|
${{ env.SRS_SOURCE_MD5 }} [${{ env.SRS_SOURCE_TAR }}](https://github.com/ossrs/srs/releases/download/${{ env.SRS_TAG }}/${{ env.SRS_SOURCE_TAR }})
|
||||||
|
${{ env.SRS_PACKAGE_MD5 }} [${{ env.SRS_PACKAGE_ZIP }}](https://github.com/ossrs/srs/releases/download/${{ env.SRS_TAG }}/${{ env.SRS_PACKAGE_ZIP }})
|
||||||
draft: false
|
draft: false
|
||||||
prerelease: true
|
prerelease: true
|
||||||
# Upload release files
|
# Upload release source files
|
||||||
- name: Upload Release Assets
|
- name: Upload Release Assets Source
|
||||||
id: upload-release-assets
|
id: upload-release-assets-source
|
||||||
uses: dwenegar/upload-release-assets@v1
|
uses: dwenegar/upload-release-assets@v1
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
with:
|
||||||
release_id: ${{ steps.create_release.outputs.id }}
|
release_id: ${{ steps.create_release.outputs.id }}
|
||||||
assets_path: ${{ env.SRS_SOURCE_TAR }}
|
assets_path: ${{ env.SRS_SOURCE_TAR }}
|
||||||
|
# Upload release package files
|
||||||
|
- name: Upload Release Assets Package
|
||||||
|
id: upload-release-assets-package
|
||||||
|
uses: dwenegar/upload-release-assets@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
release_id: ${{ steps.create_release.outputs.id }}
|
||||||
|
assets_path: ${{ env.SRS_PACKAGE_ZIP }}
|
||||||
|
|
||||||
|
|
16
trunk/Dockerfile.pkg
Normal file
16
trunk/Dockerfile.pkg
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
FROM ossrs/srs:dev
|
||||||
|
|
||||||
|
# version=4.0.145
|
||||||
|
ARG version
|
||||||
|
|
||||||
|
# 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
|
||||||
|
RUN ./scripts/package.sh --x86-x64 --jobs=2
|
||||||
|
|
|
@ -8,6 +8,7 @@ The changelog for SRS.
|
||||||
|
|
||||||
## SRS 4.0 Changelog
|
## SRS 4.0 Changelog
|
||||||
|
|
||||||
|
* v4.0, 2021-11-02, Auto create package by github actions. v4.0.191
|
||||||
* v4.0, 2021-10-30, Merge [#2552](https://github.com/ossrs/srs/pull/2552): Script: Refine CentOS7 service script to restart SRS. v4.0.190
|
* v4.0, 2021-10-30, Merge [#2552](https://github.com/ossrs/srs/pull/2552): Script: Refine CentOS7 service script to restart SRS. v4.0.190
|
||||||
* v4.0, 2021-10-30, Merge [#2397](https://github.com/ossrs/srs/pull/2397): SRTP: Patch libsrtp2 to fix GCC10 build fail. v4.0.189
|
* v4.0, 2021-10-30, Merge [#2397](https://github.com/ossrs/srs/pull/2397): SRTP: Patch libsrtp2 to fix GCC10 build fail. v4.0.189
|
||||||
* v4.0, 2021-10-30, Merge [#2284](https://github.com/ossrs/srs/pull/2284): Forward: Fast quit when cycle fail. v4.0.188
|
* v4.0, 2021-10-30, Merge [#2284](https://github.com/ossrs/srs/pull/2284): Forward: Fast quit when cycle fail. v4.0.188
|
||||||
|
|
|
@ -9,6 +9,6 @@
|
||||||
|
|
||||||
#define VERSION_MAJOR 4
|
#define VERSION_MAJOR 4
|
||||||
#define VERSION_MINOR 0
|
#define VERSION_MINOR 0
|
||||||
#define VERSION_REVISION 190
|
#define VERSION_REVISION 191
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue