3
3
schedule :
4
4
- cron : ' 7 11 * * 0'
5
5
workflow_dispatch :
6
+ inputs :
7
+ force_build :
8
+ description : Disable checking for newer commit
9
+ type : boolean
10
+ no_release :
11
+ description : Don't create release
12
+ type : boolean
13
+ use_own_fork :
14
+ description : Use own ffmpeg-windows-build-helpers fork
15
+ type : boolean
6
16
watch :
7
17
types : [started]
8
18
@@ -19,10 +29,12 @@ jobs:
19
29
version=$(curl -s https://endoflife.date/api/ffmpeg.json | jq -r .[0].latest)
20
30
echo version=${version%.0} >> $GITHUB_OUTPUT
21
31
22
- - name : Get ffmpeg-windows-build-helpers latest commit
32
+ - name : Get ${{ inputs.use_own_fork && github.repository_owner || 'rdp' }}/ ffmpeg-windows-build-helpers latest commit
23
33
id : ffmpeg-helper-info
24
34
run : |
25
- git_sha=$(gh api repos/rdp/ffmpeg-windows-build-helpers/commits/master -q .sha)
35
+ git_owner=${{ inputs.use_own_fork && github.repository_owner || 'rdp' }}
36
+ git_sha=$(gh api repos/$git_owner/ffmpeg-windows-build-helpers/commits/master -q .sha)
37
+ echo git-owner=$git_owner >> $GITHUB_OUTPUT
26
38
echo git-sha=$git_sha >> $GITHUB_OUTPUT
27
39
echo git-sha-short=${git_sha::7} >> $GITHUB_OUTPUT
28
40
env :
@@ -38,12 +50,14 @@ jobs:
38
50
GITHUB_TOKEN : ${{ github.token }}
39
51
40
52
- name : Check if there is newer version or commit
53
+ if : ' ! inputs.force_build'
41
54
run : >
42
55
[[ "${{ steps.ffmpeg-info.outputs.version }}" != "${{ steps.ffmpeg-autobuild-info.outputs.version }}" ]] ||
43
56
[[ "${{ steps.ffmpeg-helper-info.outputs.git-sha-short }}" != "${{ steps.ffmpeg-autobuild-info.outputs.helper-git-sha }}" ]]
44
57
45
58
outputs :
46
59
version : ${{ steps.ffmpeg-info.outputs.version }}
60
+ helper-git-owner : ${{ steps.ffmpeg-helper-info.outputs.git-owner }}
47
61
helper-git-sha : ${{ steps.ffmpeg-helper-info.outputs.git-sha }}
48
62
helper-git-sha-short : ${{ steps.ffmpeg-helper-info.outputs.git-sha-short }}
49
63
@@ -55,10 +69,10 @@ jobs:
55
69
os : [win64, win32]
56
70
57
71
steps :
58
- - name : Checkout ffmpeg-windows-build-helpers
72
+ - name : Checkout ${{ needs.check.outputs.helper-git-owner }}/ ffmpeg-windows-build-helpers
59
73
uses : actions/checkout@v4
60
74
with :
61
- repository : rdp /ffmpeg-windows-build-helpers
75
+ repository : ${{ needs.check.outputs.helper-git-owner }} /ffmpeg-windows-build-helpers
62
76
ref : ${{ needs.check.outputs.helper-git-sha }}
63
77
persist-credentials : false
64
78
74
88
id : date-time-before
75
89
run : echo date-time=$(date +'%Y-%m-%d %H:%M') >> $GITHUB_OUTPUT
76
90
77
- - name : Compile FFmpeg using ffmpeg-windows-build-helpers
91
+ - name : Compile FFmpeg ${{ needs.check.outputs.version }} using ffmpeg-windows-build-helpers ${{ needs.check.outputs.helper-git-sha-short }}
78
92
run : ./cross_compile_ffmpeg.sh --ffmpeg-git-checkout-version=n${{ needs.check.outputs.version }} --gcc-cpu-count=$(nproc) --disable-nonfree=n --sandbox-ok=y --compiler-flavors=${{ matrix.os }}
79
93
80
94
- name : Get current date & time after build
92
106
sandbox/${{ matrix.os }}/ffmpeg_git_with_fdk_aac_n${{ needs.check.outputs.version }}/ffprobe.exe
93
107
sandbox/${{ matrix.os }}/ffmpeg_git_with_fdk_aac_n${{ needs.check.outputs.version }}/ffplay.exe
94
108
if-no-files-found : error
95
- retention-days : 1
109
+ retention-days : ${{ inputs.no_release && '0' || '1' }}
96
110
97
111
outputs :
98
112
date-time-before : ${{ steps.date-time-before.outputs.date-time }}
@@ -117,19 +131,32 @@ jobs:
117
131
echo "This version of ffmpeg has nonfree parts compiled in." >> LICENSE
118
132
echo "Therefore it is not legally redistributable." >> LICENSE
119
133
134
+ - name : Generate artifact attestation for FFmpeg binaries
135
+ if : ' ! inputs.no_release'
136
+ uses : actions/attest-build-provenance@v1
137
+ with :
138
+ subject-path : ff*.exe
139
+
120
140
- name : 7-Zip FFmpeg binaries
121
141
run : 7z a -mx9 ffmpeg-${{ needs.check.outputs.version }}-${{ needs.check.outputs.helper-git-sha-short }}-${{ matrix.os }}-nonfree.7z ff{mpeg,probe,play}.exe LICENSE
122
142
143
+ - name : Generate artifact attestation for FFmpeg archive
144
+ if : ' ! inputs.no_release'
145
+ uses : actions/attest-build-provenance@v1
146
+ with :
147
+ subject-path : ffmpeg-${{ needs.check.outputs.version }}-${{ needs.check.outputs.helper-git-sha-short }}-${{ matrix.os }}-nonfree.7z
148
+
123
149
- name : Upload FFmpeg archive
124
150
uses : actions/upload-artifact@v4
125
151
with :
126
152
name : ffmpeg-archive-${{ matrix.os }}
127
153
path : ffmpeg-${{ needs.check.outputs.version }}-${{ needs.check.outputs.helper-git-sha-short }}-${{ matrix.os }}-nonfree.7z
128
- retention-days : 1
154
+ retention-days : ${{ inputs.no_release && '0' || '1' }}
129
155
compression-level : 0
130
156
131
157
release :
132
158
needs : [check, build, archive]
159
+ if : ' ! inputs.no_release'
133
160
runs-on : ubuntu-latest
134
161
steps :
135
162
- name : Download FFmpeg archives
@@ -143,7 +170,7 @@ jobs:
143
170
gh release create "${{ needs.build.outputs.date-time-after-tag }}-${{ needs.check.outputs.helper-git-sha-short }}-${{ needs.check.outputs.version }}" \
144
171
ffmpeg-${{ needs.check.outputs.version }}-${{ needs.check.outputs.helper-git-sha-short }}-{win64,win32}-nonfree.7z \
145
172
-n "FFmpeg nonfree ${{ needs.check.outputs.version }} built on ${{ needs.build.outputs.date-time-after }} started at ${{ needs.build.outputs.date-time-before }}
146
- Using ffmpeg-windows-build-helpers git-${{ needs.check.outputs.helper-git-sha }}" \
173
+ Using ${{ needs.check.outputs.helper-git-owner }}/ ffmpeg-windows-build-helpers git-${{ needs.check.outputs.helper-git-sha }}" \
147
174
-t "${{ needs.check.outputs.version }} ${{ needs.build.outputs.date-time-after }} ${{ needs.build.outputs.helper-git-sha }}"
148
175
env :
149
176
GITHUB_TOKEN : ${{ github.token }}
0 commit comments