2022-06-25 11:25:07 +08:00
|
|
|
name: Linux
|
2019-11-14 14:45:12 +08:00
|
|
|
|
2022-04-19 19:30:14 +08:00
|
|
|
on: [push, pull_request]
|
2023-12-01 20:20:42 +08:00
|
|
|
|
2019-11-14 14:45:12 +08:00
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
|
2021-06-26 17:57:05 +08:00
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
|
2019-11-14 14:45:12 +08:00
|
|
|
steps:
|
2023-12-01 20:20:42 +08:00
|
|
|
- uses: actions/checkout@v1
|
2019-11-14 15:14:25 +08:00
|
|
|
|
|
|
|
- name: 下载submodule源码
|
2022-06-19 15:54:30 +08:00
|
|
|
run: mv -f .gitmodules_github .gitmodules && git submodule sync && git submodule update --init
|
2019-11-14 15:14:25 +08:00
|
|
|
|
2021-06-26 17:58:00 +08:00
|
|
|
- name: 下载 SRTP
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
repository: cisco/libsrtp
|
|
|
|
fetch-depth: 1
|
|
|
|
ref: v2.3.0
|
|
|
|
path: 3rdpart/libsrtp
|
|
|
|
|
2024-06-09 10:56:00 +08:00
|
|
|
- name: 启动 Docker 容器, 在Docker 容器中执行脚本
|
|
|
|
run: |
|
|
|
|
docker pull centos:7
|
|
|
|
docker run -v $(pwd):/root -w /root --rm centos:7 sh -c "
|
|
|
|
set -x
|
|
|
|
yum install -y git wget gcc gcc-c++ make unzip ffmpeg-devel libavutil-devel libswscale-devel libresample-devel usrsctp-devel
|
|
|
|
|
|
|
|
wget https://github.com/openssl/openssl/archive/refs/heads/OpenSSL_1_1_1-stable.zip
|
|
|
|
unzip OpenSSL_1_1_1-stable.zip
|
|
|
|
cd openssl-OpenSSL_1_1_1-stable
|
|
|
|
./config no-shared --prefix=/root/release
|
|
|
|
make -j $(nproc)
|
|
|
|
make install
|
|
|
|
cd ..
|
|
|
|
|
|
|
|
wget https://github.com/Kitware/CMake/releases/download/v3.29.5/cmake-3.29.5.tar.gz
|
|
|
|
tar -xvf cmake-3.29.5.tar.gz
|
|
|
|
cd cmake-3.29.5
|
|
|
|
OPENSSL_ROOT_DIR=/root/release ./configure
|
|
|
|
make -j $(nproc)
|
|
|
|
make install
|
|
|
|
cd ..
|
|
|
|
|
|
|
|
cd 3rdpart/libsrtp && ./configure --enable-openssl --with-openssl-dir=/root/release && make -j $(nproc) && make install
|
|
|
|
cd ../../
|
|
|
|
|
|
|
|
mkdir -p linux_build && cd linux_build && cmake .. -DOPENSSL_ROOT_DIR=/root/release -DCMAKE_BUILD_TYPE=Release -DENABLE_FFMPEG=true && make -j $(nproc)
|
|
|
|
"
|
2019-11-14 15:14:25 +08:00
|
|
|
|
2024-06-01 18:24:02 +08:00
|
|
|
- name: 设置环境变量
|
|
|
|
run: |
|
|
|
|
echo "BRANCH=$(echo ${GITHUB_REF#refs/heads/} | tr -s "/\?%*:|\"<>" "_")" >> $GITHUB_ENV
|
|
|
|
echo "BRANCH2=$(echo ${GITHUB_REF#refs/heads/} )" >> $GITHUB_ENV
|
|
|
|
echo "DATE=$(date +%Y-%m-%d)" >> $GITHUB_ENV
|
2019-11-14 15:22:15 +08:00
|
|
|
|
2024-06-01 18:24:02 +08:00
|
|
|
- name: 打包二进制
|
|
|
|
id: upload
|
|
|
|
uses: actions/upload-artifact@v4
|
|
|
|
with:
|
|
|
|
name: ${{ github.workflow }}_${{ env.BRANCH }}_${{ env.DATE }}
|
|
|
|
path: release/*
|
|
|
|
if-no-files-found: error
|
2024-06-09 10:56:00 +08:00
|
|
|
retention-days: 90
|
2024-06-01 18:24:02 +08:00
|
|
|
|
|
|
|
- name: issue评论
|
2024-06-09 10:56:00 +08:00
|
|
|
if: github.event_name != 'pull_request' && github.ref != 'refs/heads/feature/test'
|
2024-06-01 18:24:02 +08:00
|
|
|
uses: actions/github-script@v7
|
|
|
|
with:
|
|
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
script: |
|
|
|
|
github.rest.issues.createComment({
|
|
|
|
issue_number: 483,
|
|
|
|
owner: context.repo.owner,
|
|
|
|
repo: context.repo.repo,
|
|
|
|
body: '- 下载地址: [${{ github.workflow }}_${{ env.BRANCH }}_${{ env.DATE }}](${{ steps.upload.outputs.artifact-url }})\n'
|
|
|
|
+ '- 分支: ${{ env.BRANCH2 }}\n'
|
|
|
|
+ '- git hash: ${{ github.sha }} \n'
|
|
|
|
+ '- 编译日期: ${{ env.DATE }}\n'
|
|
|
|
+ '- 打包ci名: ${{ github.workflow }}\n'
|
2024-06-09 10:56:00 +08:00
|
|
|
+ '- 说明: 本二进制在centos7(x64)上编译,请确保您的机器系统不低于此版本,并提前`sudo yum check-update && sudo yum install -y openssl-devel ffmpeg-devel libavutil-devel libswscale-devel libresample-devel usrsctp-devel`安装依赖项\n'
|
2024-06-01 18:24:02 +08:00
|
|
|
})
|