forked from fecf/ffmpeg-build
-
Notifications
You must be signed in to change notification settings - Fork 0
170 lines (164 loc) · 5.36 KB
/
ffmpeg.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
name: ffmpeg
on:
push:
env:
FFMPEG_TAG: n4.3.1
defaults:
run:
shell: bash
jobs:
build-windows:
name: Build Windows (${{ matrix.arch }})
runs-on: windows-latest
strategy:
fail-fast: true
matrix:
arch: [x86, x64, arm64]
include:
- arch: x86
platform: Win32
- arch: x64
platform: x64
- arch: arm64
platform: ARM64
steps:
- uses: actions/checkout@v1
with:
submodules: recursive
lfs: true
- name: Checkout FFmpeg
run: git clone https://github.com/FFmpeg/FFmpeg --branch ${FFMPEG_TAG} --depth 1
- name: Build FFmpeg
run: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=%ARCH% -host_arch=amd64
set MSYS2_PATH_TYPE=inherit
C:\msys64\usr\bin\bash -lc "./build.sh %ARCH%"
shell: cmd
env:
# This needs to be set so that the msys bash finds "./build.sh" (since it'll otherwise not start in CWD)
HOME: ${{ runner.workspace }}/${{ github.event.repository.name }}
ARCH: ${{ matrix.arch }}
- name: Build
run: |
cmake -B build -A $PLATFORM -DRUNTIME_ID=win-$ARCH -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install .
# Ignore the exit-code of this command since building ffmpeg-bink is a shitshow due to ffmpeg and LTCG
cmake --build build --config Release --target ffmpeg-bink || true
cmake --build build --config Release -t install
shell: bash
env:
ARCH: ${{ matrix.arch }}
PLATFORM: ${{ matrix.platform }}
- uses: actions/upload-artifact@v2
with:
name: native_lib_windows_${{ matrix.arch }}
path: install
#
# build-linux:
# name: Build Linux (${{ matrix.arch }})
# runs-on: ubuntu-20.04
# strategy:
# fail-fast: true
# matrix:
# arch: [x64, arm64]
# steps:
# - name: Install Dependencies
# run: |
# sudo apt-get update -qq && sudo apt-get -y install \
# autoconf \
# automake \
# build-essential \
# cmake \
# git-core \
# libass-dev \
# libfreetype6-dev \
# libgnutls28-dev \
# libtool \
# libvorbis-dev \
# meson \
# ninja-build \
# pkg-config \
# texinfo \
# wget \
# yasm \
# zlib1g-dev
# - uses: actions/checkout@v1
# with:
# submodules: recursive
# lfs: true
# - name: Checkout FFmpeg
# run: git clone https://github.com/FFmpeg/FFmpeg --branch ${FFMPEG_TAG} --depth 1
# - name: Build FFmpeg
# run: chmod u+x build.sh && ./build.sh linux-$ARCH
# shell: bash
# env:
# ARCH: ${{ matrix.arch }}
# - name: Build
# run: |
# cmake -B build -DCMAKE_TOOLCHAIN_FILE=linux-$ARCH.cmake -DRUNTIME_ID=linux-$ARCH -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=install .
# cmake --build build --config Release --target ffmpeg-bink
# cmake --build build --config Release -t install
# shell: bash
# env:
# ARCH: ${{ matrix.arch }}
# - uses: actions/upload-artifact@v2
# with:
# name: native_lib_windows_${{ matrix.arch }}
# path: install
build-nuget-package:
name: Build Managed NuGet Package
needs: [build-windows]
runs-on: windows-latest
steps:
- uses: actions/checkout@v1
- uses: actions/download-artifact@v2
with:
name: native_lib_windows_x86
path: nuget_files
- uses: actions/download-artifact@v2
with:
name: native_lib_windows_x64
path: nuget_files
- uses: actions/download-artifact@v2
with:
name: native_lib_windows_arm64
path: nuget_files
- name: Restore
run: |
cd Interop
dotnet restore
- name: Build and Pack
run: |
cd Interop
dotnet msbuild -t:Clean,Build,Pack \
-p:Configuration=Release \
-p:Platform="Any CPU" \
-p:NuGetFiles=../nuget_files \
-p:RepositoryUrl=${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git \
-p:RepositoryType=git \
-p:RepositoryBranch=${GITHUB_REF} \
-p:RepositoryCommit=${GITHUB_SHA} \
-p:VersionSuffix=pre.${{ github.run_number }}
shell: bash
- uses: actions/upload-artifact@v2
with:
name: nuget_package
path: Interop\bin\Any CPU\Release\*.nupkg
push-package:
name: Push NuGet Package
needs: [build-nuget-package]
# Only push on master branch
if: github.ref == 'refs/heads/master'
runs-on: windows-latest
steps:
- uses: actions/checkout@v1
- uses: actions/download-artifact@v2
with:
name: nuget_package
path: packages
- name: Install sleet
run: dotnet tool install -g sleet
- name: Upload Package
run: sleet push packages
env:
AWS_ACCESS_KEY_ID: ${{ secrets.OPENTEMPLE_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.OPENTEMPLE_AWS_SECRET_ACCESS_KEY }}