|
| 1 | +env: |
| 2 | + MSYS2_PATH_TYPE: inherit |
| 3 | + SDK_VER: 10.0.22621.0 |
| 4 | + TAG_NAME: ${{ inputs.tag_name||github.ref_name }} |
| 5 | + |
| 6 | +name: Test |
| 7 | +run-name: Test ${{inputs.tag_name||github.ref_name}} |
| 8 | + |
| 9 | +on: |
| 10 | + push: |
| 11 | + tags: "*" |
| 12 | + workflow_dispatch: |
| 13 | + inputs: |
| 14 | + tag_name: |
| 15 | + description: "Tag" |
| 16 | + required: true |
| 17 | + |
| 18 | +jobs: |
| 19 | + build: |
| 20 | + strategy: |
| 21 | + matrix: |
| 22 | + arch: [x86, amd64, arm, arm64] |
| 23 | + type: [static, shared] |
| 24 | + license: [gpl, lgpl] |
| 25 | + fail-fast: false |
| 26 | + runs-on: windows-2022 |
| 27 | + env: |
| 28 | + # amd64_arm,amd64_arm64,x86,amd64 |
| 29 | + name: ffmpeg-${{ inputs.tag_name||github.ref_name }}-${{matrix.license}}-${{matrix.arch}}-${{matrix.type}} |
| 30 | + target: ${{contains(matrix.arch,'arm')&&format('amd64_{0}',matrix.arch)||matrix.arch}} |
| 31 | + steps: |
| 32 | + - name: Find MSVC |
| 33 | + shell: bash |
| 34 | + id: msvc |
| 35 | + run: | |
| 36 | + echo "installationPath=$(vswhere -all -legacy -property installationPath)">>$GITHUB_OUTPUT |
| 37 | + - uses: actions/checkout@v4 |
| 38 | + with: |
| 39 | + ref: ${{env.TAG_NAME}} |
| 40 | + submodules: recursive |
| 41 | + |
| 42 | + - uses: msys2/setup-msys2@v2 |
| 43 | + with: |
| 44 | + install: >- |
| 45 | + diffutils |
| 46 | + make |
| 47 | + zip |
| 48 | + pkgconf |
| 49 | + yasm |
| 50 | + nasm |
| 51 | +
|
| 52 | + - name: Remove MSYS2 link |
| 53 | + shell: msys2 {0} |
| 54 | + run: | |
| 55 | + rm $(which link) |
| 56 | + rm -rf /usr/local |
| 57 | +
|
| 58 | + - name: Build |
| 59 | + shell: cmd |
| 60 | + run: | |
| 61 | + CALL "${{steps.msvc.outputs.installationPath}}\VC\Auxiliary\Build\vcvarsall.bat" ${{env.target}} ${{env.SDK_VER}} |
| 62 | + msys2 -c "./build.sh ${{matrix.arch}} ${{matrix.type}} ${{matrix.license}}" |
| 63 | +
|
| 64 | + - name: Debug log |
| 65 | + if: ${{ failure() }} |
| 66 | + shell: bash |
| 67 | + run: | |
| 68 | + echo [Debug] |
| 69 | + cat FFmpeg/ffbuild/config.log |
| 70 | + cat FFmpeg/ffbuild/config.mak |
| 71 | + cat FFmpeg/config.h |
| 72 | +
|
| 73 | + - name: Pack |
| 74 | + shell: msys2 {0} |
| 75 | + run: | |
| 76 | + CWD=$(pwd) |
| 77 | + cd /usr/local |
| 78 | + zip -9 ${CWD}/${{env.name}}.zip -r . |
| 79 | + cd ${CWD} |
| 80 | + sha1sum ${{env.name}}.zip >${{env.name}}.sha1 |
| 81 | + ./build-changelog.sh > changelog |
| 82 | + - name: Release |
| 83 | + if: ${{startsWith(github.ref, 'refs/tags/')}} |
| 84 | + uses: softprops/action-gh-release@v2 |
| 85 | + with: |
| 86 | + tag_name: ${{env.TAG_NAME}} |
| 87 | + body_path: changelog |
| 88 | + prerelease: ${{contains(env.TAG_NAME,'dev')}} |
| 89 | + files: | |
| 90 | + ${{env.name}}.zip |
| 91 | + ${{env.name}}.sha1 |
0 commit comments