Repository navigation
113 lines (100 loc) · 4.28 KB
/
Copy pathffmpeg-runtime.yml
File metadata and controls
113 lines (100 loc) · 4.28 KB
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
name: FFmpeg Runtime
on:
push:
branches:
- main
tags:
- "ffmpeg-runtime-v*"
paths:
- ".github/workflows/ffmpeg-runtime.yml"
- "thirdparty/ffmpeg/**"
- "tools/build-windows-ffmpeg-runtime.sh"
- "tools/test-windows-ffmpeg-runtime.ps1"
pull_request:
paths:
- ".github/workflows/ffmpeg-runtime.yml"
- "thirdparty/ffmpeg/**"
- "tools/build-windows-ffmpeg-runtime.sh"
- "tools/test-windows-ffmpeg-runtime.ps1"
workflow_dispatch:
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5
- name: Install deterministic build prerequisites
run: |
sudo apt-get update
sudo apt-get install --yes --no-install-recommends \
build-essential curl pkg-config python3 tar xz-utils zip
- name: Build runtime and complete corresponding source
run: bash ./tools/build-windows-ffmpeg-runtime.sh
- name: Rebuild from the complete corresponding-source archive
run: |
rm -rf "$RUNNER_TEMP/openstudio-ffmpeg-source-rebuild"
mkdir -p "$RUNNER_TEMP/openstudio-ffmpeg-source-rebuild/source"
unzip -q \
dist/ffmpeg-runtime/OpenStudio-FFmpeg-8.0.1-complete-corresponding-source.zip \
-d "$RUNNER_TEMP/openstudio-ffmpeg-source-rebuild/source"
OPENSTUDIO_FFMPEG_WORK_ROOT="$RUNNER_TEMP/openstudio-ffmpeg-source-rebuild/work" \
OPENSTUDIO_FFMPEG_OUTPUT_ROOT="$RUNNER_TEMP/openstudio-ffmpeg-source-rebuild/output" \
bash "$RUNNER_TEMP/openstudio-ffmpeg-source-rebuild/source/build/build-windows-ffmpeg-runtime.sh"
python3 - \
build-ffmpeg-runtime/runtime/runtime-manifest.json \
"$RUNNER_TEMP/openstudio-ffmpeg-source-rebuild/work/runtime/runtime-manifest.json" <<'PY'
import json
import sys
manifests = []
for path in sys.argv[1:]:
with open(path, "r", encoding="utf-8") as handle:
manifests.append(json.load(handle))
for key in ("runtimeVersion", "target", "license", "gplComponentsEnabled", "nonFreeComponentsEnabled"):
if manifests[0][key] != manifests[1][key]:
raise SystemExit(f"Rebuilt manifest differs for {key}")
paths = [{item["path"] for item in manifest["files"]} for manifest in manifests]
if paths[0] != paths[1]:
raise SystemExit("Rebuilt runtime file set differs")
PY
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: ffmpeg-runtime-build
path: dist/ffmpeg-runtime/
if-no-files-found: error
test-windows:
needs: build
runs-on: windows-latest
steps:
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
name: ffmpeg-runtime-build
path: dist/ffmpeg-runtime
- name: Run Windows capability and conversion regression
shell: pwsh
run: |
./tools/test-windows-ffmpeg-runtime.ps1 `
-RuntimeArchive dist/ffmpeg-runtime/OpenStudio-FFmpeg-8.0.1-windows-x64.zip
publish:
if: startsWith(github.ref, 'refs/tags/ffmpeg-runtime-v')
needs: test-windows
runs-on: ubuntu-22.04
permissions:
contents: write
steps:
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
name: ffmpeg-runtime-build
path: dist/ffmpeg-runtime
- name: Publish immutable FFmpeg runtime release
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release create "${GITHUB_REF_NAME}" \
--repo "${GITHUB_REPOSITORY}" \
--title "OpenStudio FFmpeg Runtime ${GITHUB_REF_NAME#ffmpeg-runtime-v}" \
--notes "Checksum-pinned Windows FFmpeg runtime and its complete corresponding source. Built and tested by .github/workflows/ffmpeg-runtime.yml." \
dist/ffmpeg-runtime/OpenStudio-FFmpeg-8.0.1-windows-x64.zip \
dist/ffmpeg-runtime/OpenStudio-FFmpeg-8.0.1-complete-corresponding-source.zip \
dist/ffmpeg-runtime/SHA256SUMS.txt