Replace godot-videodecoder
with EIRTeam.FFmpeg
#819
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 🏁 Windows Builds | |
on: | |
push: | |
branches: | |
- 'main' | |
pull_request: | |
env: | |
GODOT_VERSION: "4.2.1" | |
jobs: | |
build-ffmpeg: | |
runs-on: "ubuntu-20.04" | |
name: Build FFmpeg | |
strategy: | |
matrix: | |
include: | |
- name: 32 Bits | |
cache_key: x86_32 | |
arch: win32 | |
- name: 64 Bits | |
cache_key: x86_64 | |
arch: win64 | |
steps: | |
- name: "Load cached build" | |
id: "cache_ffmpeg" | |
uses: actions/cache@v4 | |
with: | |
path: cached_builds/ffmpeg | |
key: Windows-${{ matrix.cache_key }}-ffmpeg-build | |
restore-keys: Windows-${{ matrix.cache_key }}-ffmpeg-build | |
lookup-only: true | |
save-always: true | |
continue-on-error: true | |
- name: "Checkout FFmpeg" | |
if: steps.cache_ffmpeg.outputs.cache-hit != 'true' | |
uses: actions/checkout@v4 | |
with: | |
repository: retrohub-org/FFmpeg-Builds | |
path: "ffmpeg" | |
- name: "Free space" | |
if: steps.cache_ffmpeg.outputs.cache-hit != 'true' | |
run: | | |
df -h | |
sudo apt-get clean | |
docker system prune -a -f | |
sudo rm -rf /usr/local/lib/android /usr/share/dotnet /opt/ghc | |
df -h | |
- name: "Compilation" | |
if: steps.cache_ffmpeg.outputs.cache-hit != 'true' | |
working-directory: ./ffmpeg | |
run: | | |
./makeimage.sh ${{ matrix.arch }} lgpl-godot 6.0 | |
./build.sh ${{ matrix.arch }} lgpl-godot 6.0 | |
mkdir -p -v ../cached_builds/ffmpeg | |
tar -xvf artifacts/ffmpeg*${{ matrix.arch }}-lgpl-godot-6.0.tar.xz --directory=../cached_builds/ffmpeg --strip-components=1 | |
ls -la ../cached_builds/ffmpeg | |
build-eirteam_ffmpeg: | |
runs-on: "windows-latest" | |
name: Build EIRTeam.FFmpeg | |
needs: [build-ffmpeg] | |
strategy: | |
matrix: | |
include: | |
- name: 32 Bits | |
cache_key: x86_32 | |
arch: x86_32 | |
eirteam_arch: win32 | |
- name: 64 Bits | |
cache_key: x86_64 | |
arch: x86_64 | |
eirteam_arch: win64 | |
steps: | |
- name: "Load cached build" | |
uses: actions/cache@v4 | |
id: "cache_eirteam_ffmpeg" | |
with: | |
path: cached_builds/eirteam_ffmpeg/${{ matrix.eirteam_arch }} | |
key: Windows-${{ matrix.cache_key }}-eirteam_ffmpeg-build | |
restore-keys: Windows-${{ matrix.cache_key }}-eirteam_ffmpeg-build | |
lookup-only: true | |
save-always: true | |
enableCrossOsArchive: true | |
continue-on-error: true | |
- name: "Load FFmpeg build" | |
id: "cache_ffmpeg" | |
if: steps.cache_eirteam_ffmpeg.outputs.cache-hit != 'true' | |
uses: actions/cache@v4 | |
with: | |
path: cached_builds/ffmpeg | |
key: Windows-${{ matrix.cache_key }}-ffmpeg-build | |
restore-keys: Windows-${{ matrix.cache_key }}-ffmpeg-build | |
fail-on-cache-miss: true | |
enableCrossOsArchive: true | |
continue-on-error: false | |
- name: "Checkout EIRTeam.FFmpeg" | |
if: steps.cache_eirteam_ffmpeg.outputs.cache-hit != 'true' | |
uses: actions/checkout@v4 | |
with: | |
repository: retrohub-org/EIRTeam.FFmpeg | |
submodules: recursive | |
path: "eirteam_ffmpeg" | |
- name: "Install dependencies" | |
if: steps.cache_eirteam_ffmpeg.outputs.cache-hit != 'true' | |
run: | | |
python -m pip install scons==4.4.0 | |
- name: "Compilation" | |
if: steps.cache_eirteam_ffmpeg.outputs.cache-hit != 'true' | |
working-directory: ./eirteam_ffmpeg | |
run: | | |
New-Item thirdparty -ItemType Directory -Force -ea 0 | |
Move-Item -Path ../cached_builds/ffmpeg -Destination thirdparty | |
cd gdextension_build | |
scons arch=${{ matrix.arch }} verbose=yes target=template_release | |
New-Item ../../cached_builds/eirteam_ffmpeg -ItemType Directory -Force -ea 0 | |
Copy-Item -Path build/addons/ffmpeg/${{ matrix.eirteam_arch }} -Destination ../../cached_builds/eirteam_ffmpeg -Recurse | |
build-godot-templates: | |
runs-on: "windows-latest" | |
name: Build Godot Templates | |
strategy: | |
matrix: | |
include: | |
- name: 32 Bits | |
cache_key: x86_32 | |
arch: x86_32 | |
bin: godot.windows.template_release.x86_32.exe | |
template: godot_32.exe | |
- name: 64 Bits | |
cache_key: x86_64 | |
arch: x86_64 | |
bin: godot.windows.template_release.x86_64.exe | |
template: godot_64.exe | |
steps: | |
- name: "Load cached build" | |
uses: actions/cache@v4 | |
id: "cache_template" | |
with: | |
path: cached_builds/template/${{ matrix.template }} | |
key: Windows-${{ matrix.cache_key }}-template-build | |
restore-keys: Windows-${{ matrix.cache_key }}-template-build | |
lookup-only: true | |
save-always: true | |
enableCrossOsArchive: true | |
continue-on-error: true | |
- name: "Checkout Custom Godot" | |
if: steps.cache_template.outputs.cache-hit != 'true' | |
uses: actions/checkout@v4 | |
with: | |
repository: retrohub-org/godot | |
ref: retrohub_patches_4x | |
path: "godot" | |
- name: "Setup Godot build cache" | |
if: steps.cache_template.outputs.cache-hit != 'true' | |
uses: ./godot/.github/actions/godot-cache | |
with: | |
cache-name: windows-template | |
continue-on-error: true | |
- name: "Setup python and scons" | |
if: steps.cache_template.outputs.cache-hit != 'true' | |
uses: ./godot/.github/actions/godot-deps | |
- name: "Compilation" | |
if: steps.cache_template.outputs.cache-hit != 'true' | |
uses: ./godot/.github/actions/godot-build | |
with: | |
root: ./godot | |
sconsflags: verbose=yes warnings=all werror=no use_lto=yes optimize=size arch=${{ matrix.arch }} | |
platform: windows | |
target: template_release | |
- name: "Clean and cache template build" | |
if: steps.cache_template.outputs.cache-hit != 'true' | |
run: | | |
New-Item cached_builds/template -ItemType Directory -Force -ea 0 | |
Move-Item -Path godot/bin/${{ matrix.bin }} -Destination cached_builds/template/${{ matrix.template }} | |
download-godot: | |
runs-on: "ubuntu-20.04" | |
name: Download Godot editor | |
steps: | |
- name: "Load cached build" | |
uses: actions/cache@v4 | |
id: "cache_editor" | |
with: | |
path: cached_builds/editor/godot | |
key: editor-build | |
restore-keys: editor-build | |
lookup-only: true | |
save-always: true | |
continue-on-error: true | |
- name: "Download editor" | |
if: steps.cache_editor.outputs.cache-hit != 'true' | |
run: | | |
wget https://downloads.tuxfamily.org/godotengine/${{ env.GODOT_VERSION }}/Godot_v${{ env.GODOT_VERSION }}-stable_linux.x86_64.zip | |
unzip Godot_v${{ env.GODOT_VERSION }}-stable_linux.x86_64.zip | |
mkdir -p -v cached_builds/editor | |
mv Godot_v${{ env.GODOT_VERSION }}-stable_linux.x86_64 cached_builds/editor/godot | |
build-retrohub: | |
runs-on: "ubuntu-20.04" | |
name: Build RetroHub | |
needs: [build-godot-templates, build-eirteam_ffmpeg, download-godot] | |
strategy: | |
matrix: | |
include: | |
- name: 32 Bits | |
cache_key: x86_32 | |
arch: x86_32 | |
template: godot_32.exe | |
eirteam_ffmpeg: win32 | |
- name: 64 Bits | |
cache_key: x86_64 | |
arch: x86_64 | |
template: godot_64.exe | |
eirteam_ffmpeg: win64 | |
steps: | |
- name: "Load EIRTeam.FFmpeg build" | |
uses: actions/cache@v4 | |
id: "cache_eirteam_ffmpeg" | |
with: | |
path: cached_builds/eirteam_ffmpeg/${{ matrix.eirteam_ffmpeg }} | |
key: Windows-${{ matrix.cache_key }}-eirteam_ffmpeg-build | |
restore-keys: Windows-${{ matrix.cache_key }}-eirteam_ffmpeg-build | |
fail-on-cache-miss: true | |
enableCrossOsArchive: true | |
continue-on-error: false | |
- name: "Load Godot templates" | |
uses: actions/cache@v4 | |
id: "cache_template" | |
with: | |
path: cached_builds/template/${{ matrix.template }} | |
key: Windows-${{ matrix.cache_key }}-template-build | |
restore-keys: Windows-${{ matrix.cache_key }}-template-build | |
fail-on-cache-miss: true | |
continue-on-error: false | |
- name: "Load Godot editor" | |
uses: actions/cache@v4 | |
id: "cache_editor" | |
with: | |
path: cached_builds/editor/godot | |
key: editor-build | |
restore-keys: editor-build | |
fail-on-cache-miss: true | |
continue-on-error: false | |
- name: "Checkout RetroHub" | |
uses: actions/checkout@v4 | |
with: | |
path: "retrohub" | |
- name: "Setup templates and libraries" | |
env: | |
TEMPLATE_PATH: /home/runner/.local/share/godot/export_templates/${{ env.GODOT_VERSION }}.stable | |
run: | | |
mkdir -p -v $TEMPLATE_PATH | |
cp cached_builds/template/${{ matrix.template }} $TEMPLATE_PATH/windows_release_${{ matrix.arch }}.exe | |
ln -s ${{ github.workspace }}/cached_builds/eirteam_ffmpeg/${{ matrix.eirteam_ffmpeg }} retrohub/addons/ffmpeg/${{ matrix.eirteam_ffmpeg }} | |
mkdir -p -v export/windows_${{ matrix.arch }} | |
tree -l retrohub/addons/ffmpeg | |
- name: "Package default themes" | |
uses: ./retrohub/.github/actions/get-default-themes | |
- name: "Setup rcedit" | |
run: | | |
sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list | |
sudo apt-get update | |
sudo apt-get install wine-stable | |
wget https://github.com/electron/rcedit/releases/download/v1.1.1/rcedit-x64.exe | |
cached_builds/editor/godot --headless --quit | |
echo "export/windows/wine = \"/usr/bin/wine\"" >> ~/.config/godot/editor_settings-4.tres | |
echo "export/windows/rcedit = \"$(pwd)/rcedit-x64.exe\"" >> ~/.config/godot/editor_settings-4.tres | |
tail -n2 ~/.config/godot/editor_settings-4.tres | |
- name: "Exporting RetroHub" | |
working-directory: retrohub | |
env: | |
GODOT_PATH: ${{ github.workspace }}/cached_builds/editor/godot | |
run: | | |
timeout 1m $GODOT_PATH --headless --editor || true | |
$GODOT_PATH --headless --export-release "Windows (${{ matrix.arch }})" ../export/windows_${{ matrix.arch }}/RetroHub.exe | |
- name: "Upload Artifacts" | |
uses: actions/upload-artifact@v4 | |
with: | |
name: windows-${{ matrix.arch }} | |
path: export/windows_${{ matrix.arch }} |