-
Notifications
You must be signed in to change notification settings - Fork 5
69 lines (59 loc) · 2.04 KB
/
ffmpeg-release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: ffmpeg-release
on:
push:
tags:
- v*
branches: [main]
jobs:
export:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
strategy:
matrix:
ffmpeg: ["7.0.2", "6.1.2", "5.1.6", "4.4.5"]
flavor: [linux, windows]
env:
target_os:
build_tag:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Set build target (linux)
if: matrix.flavor == 'linux'
run: |
echo "build_tag=ffmpeg-linux-export" >> $GITHUB_ENV
echo "target_os=linux-amd64" >> $GITHUB_ENV
- name: Set build target (windows)
if: matrix.flavor == 'windows'
run: |
echo "build_tag=ffmpeg-windows-export" >> $GITHUB_ENV
echo "target_os=windows-x64" >> $GITHUB_ENV
- name: Export - ffmpeg
run: |
docker buildx build --platform linux/amd64 --target ${{ env.build_tag }} --output type=local,dest=/tmp/build \
-t ${{ env.build_tag }} --build-arg FFMPEG_VERSION=${{ matrix.ffmpeg }} -f ./Dockerfile .
- name: Archive artifact
run: |
mkdir /tmp/ffmpeg-${{ matrix.ffmpeg }}-${{ env.target_os }}
mv /tmp/build/* /tmp/ffmpeg-${{ matrix.ffmpeg }}-${{ env.target_os }}/
tar acvf /tmp/ffmpeg-${{ matrix.ffmpeg }}-${{ env.target_os }}.tar.xz -C /tmp ffmpeg-${{ matrix.ffmpeg }}-${{ env.target_os }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ffmpeg-${{ matrix.ffmpeg }}-${{ env.target_os }}
path: /tmp/ffmpeg-${{ matrix.ffmpeg }}-${{ env.target_os }}.tar.xz
release:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
needs: [export]
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
path: /tmp/artifact
- name: Release
uses: softprops/action-gh-release@v2
with:
files: /tmp/artifact/**/*.tar.xz