Upload ffmpeg to Release #17
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Upload ffmpeg to Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' # 只在打 tag 时触发 | |
| workflow_dispatch: | |
| jobs: | |
| upload-ffmpeg: | |
| runs-on: ['ubuntu-latest', 'ubuntu-22.04'] | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.FFMPEGMAKER_TARGET_REPO_TOKEN }} | |
| REPO_TOKEN: ${{ secrets.FFMPEGMAKER_TARGET_REPO_TOKEN }} | |
| FFMPEGMAKER_TARGET_REPO: linjonh/ffmpegMaker | |
| SHELL_SCRIPT_REPO: linjonh/shellscript-install | |
| SHELL_SCRIPT_REPO_URL: https://gh-proxy.com/github.com/linjonh/shellscript-install.git | |
| PKG_NAME: ffmpeg-n7.1-with-gltransition | |
| PKG_VERSION: 1.0.1 | |
| PKG_RELEASE: 2 | |
| PKG_ARCH: amd64 | |
| TAG_NAME: ${{ github.ref_name }} | |
| FILE_TO_UPLOAD: "" | |
| steps: | |
| - name: Checkout code | |
| run: | | |
| echo "➡️ 当前目录:$(pwd)" | |
| if [[ -e "create_deb_pkg.sh" ]]; then | |
| echo "➡️ shellscript-install 目录已存在:" | |
| echo "➡️ 拉取最新代码 git pull..." | |
| git remote set-url origin https://github.com/linjonh/shellscript-install.git | |
| git pull | |
| else | |
| echo "➡️ shellscript-install 目录不存在,开始克隆代码仓库" | |
| git clone ${{ env.SHELL_SCRIPT_REPO_URL }} . | |
| echo "➡️ 当前目录1:$(pwd)" | |
| cd shellscript-install || exit | |
| echo "➡️ 当前目录2:$(pwd)" | |
| echo "➡️ 拉取最新代码完成" | |
| fi | |
| - name: Get the tag name | |
| id: vars | |
| run: | | |
| echo "TAG_NAME=${GITHUB_REF##*/}" | |
| echo "TAG_NAME=${GITHUB_REF##*/}" >> $GITHUB_ENV | |
| echo "FILE_TO_UPLOAD=./ffmpegMaker/ffmpeg-source/${{ env.PKG_NAME }}_${{ env.PKG_VERSION }}-${{ env.PKG_RELEASE }}_${{ env.PKG_ARCH }}.deb">> $GITHUB_ENV | |
| echo "查看路径FILE_TO_UPLOAD=${{ env.FILE_TO_UPLOAD }}" | |
| - name: 编译ffmpeg | |
| run: | | |
| echo "➡️ 编译ffmpeg" | |
| echo "➡️ 当前目录:$(pwd)" | |
| ./install_ffmpeg.sh /usr | |
| echo "➡️ 编译完成" | |
| echo "➡️ ls -lh ffmpegMaker/ffmpeg-source/ :" | |
| ls -lh ffmpegMaker/ffmpeg-source/ | |
| - name: 创建deb包 | |
| run: | | |
| echo "➡️ 当前目录:$(pwd)" | |
| ./create_deb_pkg.sh ${{ env.PKG_NAME }} ${{ env.PKG_VERSION }} ${{ env.PKG_RELEASE }} ${{ env.PKG_ARCH }} | |
| echo "➡️ ls -lh ./ffmpegMaker/ffmpeg-source/ :" | |
| ls -lh ./ffmpegMaker/ffmpeg-source/ | |
| echo "➡️ 查看deb包:" | |
| ls -lh ${{ env.FILE_TO_UPLOAD }} | |
| - name: Create GitHub Release (if not exists) | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ env.TAG_NAME }} | |
| name: Release ${{ env.TAG_NAME }} | |
| draft: false | |
| prerelease: false | |
| files: ${{ env.FILE_TO_UPLOAD }} | |
| token: ${{ env.REPO_TOKEN }} | |
| - name: Upload ffmpeg binary to Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ env.TAG_NAME }} | |
| name: Release ${{ env.TAG_NAME }} | |
| draft: false | |
| prerelease: false | |
| files: ${{ env.FILE_TO_UPLOAD }} | |
| repository: ${{env.FFMPEGMAKER_TARGET_REPO }} | |
| token: ${{ env.REPO_TOKEN }} |