Skip to content

Commit

Permalink
Fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
rsubtil committed Jul 21, 2023
1 parent d2c7a47 commit 1a87208
Show file tree
Hide file tree
Showing 9 changed files with 197 additions and 328 deletions.
85 changes: 26 additions & 59 deletions .github/workflows/linux_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,15 @@ jobs:
matrix:
include:
- name: 32 Bits
bits: 32
bin: godot.x11.opt.32
arch: x86_32
bin: godot.linuxbsd.template_release.x86_32
template: godot_32
videodecoder: x11_32
godot-tts: target/release/32
videodecoder: linux_32
- name: 64 Bits
bits: 64
bin: godot.x11.opt.64
arch: x86_64
bin: godot.linuxbsd.template_release.x86_64
template: godot_64
videodecoder: x11
godot-tts: target/release
videodecoder: linux_64

steps:
- name: "Checkout RetroHub"
Expand All @@ -43,32 +41,24 @@ jobs:
uses: actions/cache@v3
id: "cache_template"
with:
path: cached_builds/template/godot_${{ matrix.bits }}
key: Linux-${{ matrix.bits }}-template-build
path: cached_builds/template/godot_${{ matrix.arch }}
key: Linux-${{ matrix.arch }}-template-build
continue-on-error: true

- name: "Load cached objects (Videodecoder)"
uses: actions/cache@v3
id: "cache_videodecoder"
with:
path: cached_builds/videodecoder/${{ matrix.videodecoder }}
key: Linux-${{ matrix.bits }}-videodecoder-build
continue-on-error: true

- name: "load cached objects (godot-tts)"
uses: actions/cache@v3
id: "cache_tts"
with:
path: cached_builds/tts/${{ matrix.bits }}
key: Linux-${{ matrix.bits }}-tts-build
key: Linux-${{ matrix.arch }}-videodecoder-build
continue-on-error: true

- name: "Checkout Custom Godot"
if: steps.cache_template.outputs.cache-hit != 'true'
uses: actions/checkout@v3
with:
repository: retrohub-org/godot
ref: retrohub_patches
ref: retrohub_patches_4x
path: "godot"

- name: "Checkout godot-videodecoder"
Expand All @@ -79,31 +69,13 @@ jobs:
submodules: recursive
path: "videodecoder"

- name: "Download godot-tts"
if: steps.cache_tts.outputs.cache-hit != 'true'
uses: robinraju/[email protected]
with:
repository: retrohub-org/godot-tts
tag: v1.0.0
fileName: godot-tts.zip
tarBall: false
zipBall: false
out-file-path: ""

- name: "Cache godot-tts"
if: steps.cache_tts.outputs.cache-hit != 'true'
run: |
unzip godot-tts.zip -d $RUNNER_TEMP
mkdir -p -v cached_builds/tts/${{ matrix.bits }}
mv -v $RUNNER_TEMP/godot-tts/${{ matrix.godot-tts }}/*.so cached_builds/tts/${{ matrix.bits }}
- name: "[Videodecoder] Compilation"
if: steps.cache_videodecoder.outputs.cache-hit != 'true'
working-directory: ./videodecoder
env:
PLATFORMS: ${{ matrix.videodecoder }}
run: |
./build_gdnative.sh
./build_gdextension.sh
mkdir -p -v ../cached_builds/videodecoder
cp -r -v target/* ../cached_builds/videodecoder
Expand All @@ -112,9 +84,9 @@ jobs:
working-directory: ./godot
shell: bash
run: |
# Azure repositories are not reliable, we need to prevent azure giving us packages.
sudo rm -f /etc/apt/sources.list.d/*
sudo cp -f misc/ci/sources.list /etc/apt/sources.list
sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
sudo add-apt-repository ppa:kisak/kisak-mesa
sudo apt-get install -qq mesa-vulkan-drivers
sudo dpkg --add-architecture i386
sudo apt-get update
# The actual dependencies
Expand All @@ -139,9 +111,9 @@ jobs:
uses: ./godot/.github/actions/godot-build
with:
root: ./godot
sconsflags: verbose=yes warnings=all werror=yes use_lto=yes optimize=size bits=${{ matrix.bits }}
sconsflags: verbose=yes warnings=all werror=yes use_lto=yes optimize=size arch=${{ matrix.arch }}
platform: linuxbsd
target: release
target: template_release
tools: false

- name: "[Godot] Clean and cache template build"
Expand All @@ -154,40 +126,35 @@ jobs:
- name: "[Godot] Download editor"
if: steps.cache_editor.outputs.cache-hit != 'true'
run: |
wget https://downloads.tuxfamily.org/godotengine/3.5/Godot_v3.5-stable_linux_headless.64.zip
unzip Godot_v3.5-stable_linux_headless.64.zip
wget https://downloads.tuxfamily.org/godotengine/4.1/Godot_v4.1-stable_linux.x86_64.zip
unzip Godot_v4.1-stable_linux.x86_64.zip
mkdir -p -v cached_builds/editor
mv Godot_v3.5-stable_linux_headless.64 cached_builds/editor/godot
mv Godot_v4.1-stable_linux.x86_64 cached_builds/editor/godot
- name: "Setup templates and libraries"
env:
TEMPLATE_PATH: /home/runner/.local/share/godot/templates/3.5.stable
TEMPLATE_PATH: /home/runner/.local/share/godot/export_templates/4.1.stable
run: |
mkdir -p -v $TEMPLATE_PATH
cp cached_builds/template/${{ matrix.template }} $TEMPLATE_PATH/linux_x11_${{ matrix.bits }}_release
cp cached_builds/template/${{ matrix.template }} $TEMPLATE_PATH/linux_release.${{ matrix.arch }}
ln -s ../../../cached_builds/videodecoder/${{ matrix.videodecoder }} retrohub/addons/godot-videodecoder/${{ matrix.videodecoder }}
ls -la cached_builds/videodecoder
ls -la cached_builds/videodecoder/${{ matrix.videodecoder }}
ls -la retrohub/addons/godot-videodecoder
ls retrohub/addons/godot-videodecoder/${{ matrix.videodecoder }}
mkdir -p -v export/linux_${{ matrix.bits }}
mkdir -p -v export/linux_${{ matrix.arch }}
- name: "Package default themes"
uses: ./retrohub/.github/actions/get-default-themes

- name: "Package godot-tts"
run: |
mkdir -p -v retrohub/addons/godot-tts/${{ matrix.godot-tts }}
cp -r -v cached_builds/tts/${{ matrix.bits }}/* retrohub/addons/godot-tts/${{ matrix.godot-tts }}
- name: "Exporting RetroHub"
working-directory: retrohub
run: |
../cached_builds/editor/godot --export "Linux (${{ matrix.bits }})" ../export/linux_${{ matrix.bits }}/RetroHub
chmod +x ../export/linux_${{ matrix.bits }}/RetroHub
../cached_builds/editor/godot --headless --export-release "Linux (${{ matrix.arch }})" ../export/linux_${{ matrix.arch }}/RetroHub
chmod +x ../export/linux_${{ matrix.arch }}/RetroHub
- name: "Upload Artifacts"
uses: actions/upload-artifact@v3
with:
name: linux-${{ matrix.bits }}
path: export/linux_${{ matrix.bits }}
name: linux-${{ matrix.arch }}
path: export/linux_${{ matrix.arch }}
83 changes: 27 additions & 56 deletions .github/workflows/mac_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
uses: actions/cache@v3
id: "cache-videodecoder"
with:
path: cached_builds/videodecoder/osx
path: cached_builds/videodecoder/macos
key: MacOS-videodecoder-build
continue-on-error: true

Expand All @@ -67,10 +67,10 @@ jobs:
- name: "Compile"
if: steps.cache-videodecoder.outputs.cache-hit != 'true'
env:
PLATFORMS: osx
PLATFORMS: macos
run: |
mv ~/cached_builds/sdk/MacOSX12.3.sdk.tar.xz darwin_sdk
./build_gdnative.sh
./build_gdextension.sh
mkdir -p -v cached_builds/videodecoder
cp -r -v target/* cached_builds/videodecoder
Expand All @@ -97,53 +97,26 @@ jobs:
uses: actions/cache@v3
id: "cache_template"
with:
path: cached_builds/template/osx.zip
path: cached_builds/template/macos.zip
key: MacOS-template-build
continue-on-error: true

- name: "Load cached objects (Videodecoder)"
uses: actions/cache@v3
id: "cache_videodecoder"
with:
path: cached_builds/videodecoder/osx
path: cached_builds/videodecoder/macos
key: MacOS-videodecoder-build
continue-on-error: false

- name: "load cached objects (godot-tts)"
uses: actions/cache@v3
id: "cache_tts"
with:
path: cached_builds/tts/${{ matrix.bits }}
key: MacOS-${{ matrix.bits }}-tts-build
continue-on-error: true

- name: "Checkout Custom Godot"
if: steps.cache_template.outputs.cache-hit != 'true'
uses: actions/checkout@v3
with:
repository: retrohub-org/godot
ref: retrohub_patches
ref: retrohub_patches_4x
path: "godot"

- name: "Download godot-tts"
if: steps.cache_tts.outputs.cache-hit != 'true'
uses: robinraju/[email protected]
with:
repository: retrohub-org/godot-tts
tag: v1.0.0
fileName: godot-tts.zip
tarBall: false
zipBall: false
out-file-path: ""

- name: "Cache godot-tts"
if: steps.cache_tts.outputs.cache-hit != 'true'
run: |
unzip godot-tts.zip -d $RUNNER_TEMP
mkdir -p -v cached_builds/tts
mv -v $RUNNER_TEMP/godot-tts/target/release/*.dylib cached_builds/tts
- name: "[Godot] Dependencies"
if: steps.cache_template.outputs.cache-hit != 'true'
working-directory: ./godot
Expand All @@ -162,14 +135,18 @@ jobs:
if: steps.cache_template.outputs.cache-hit != 'true'
uses: ./godot/.github/actions/godot-deps

- name: "[Godot] Setup Vulkan SDK"
run: |
sh misc/scripts/install_vulkan_sdk_macos.sh
- name: "[Godot] Compilation [template] (x86_64)"
if: steps.cache_template.outputs.cache-hit != 'true'
uses: ./godot/.github/actions/godot-build
with:
root: ./godot
sconsflags: verbose=yes warnings=all werror=yes use_lto=yes optimize=size arch=x86_64
platform: osx
target: release
platform: macos
target: template_release
tools: false

- name: "[Godot] Compilation [template] (arm64)"
Expand All @@ -178,53 +155,47 @@ jobs:
with:
root: ./godot
sconsflags: verbose=yes warnings=all werror=yes use_lto=yes optimize=size arch=arm64
platform: osx
target: release
platform: macos
target: template_release
tools: false

- name: "[Godot] Clean and cache template build"
if: steps.cache_template.outputs.cache-hit != 'true'
working-directory: godot
run: |
lipo -create bin/godot.osx.opt.x86_64 bin/godot.osx.opt.arm64 -output bin/godot.osx.opt.universal
cp -r misc/dist/osx_template.app .
mkdir -p -v osx_template.app/Contents/MacOS
cp bin/godot.osx.opt.universal osx_template.app/Contents/MacOS/godot_osx_release.64
chmod +x osx_template.app/Contents/MacOS/godot_osx_release.64
zip -q -9 -r osx.zip osx_template.app
lipo -create bin/godot.macos.template_release.x86_64 bin/godot.macos.template_release.arm64 -output bin/godot.macos.template_release.universal
cp -r misc/dist/macos_template.app .
mkdir -p -v macos_template.app/Contents/MacOS
cp bin/godot.macos.template_release.universal macos_template.app/Contents/MacOS/godot_macos_release.64
chmod +x macos_template.app/Contents/MacOS/godot_macos_release.64
zip -q -9 -r macos.zip macos_template.app
mkdir -p -v ../cached_builds/template
mv osx.zip ../cached_builds/template
mv macos.zip ../cached_builds/template
- name: "[Godot] Download editor"
if: steps.cache_editor.outputs.cache-hit != 'true'
run: |
wget https://downloads.tuxfamily.org/godotengine/3.5/Godot_v3.5-stable_osx.universal.zip
unzip Godot_v3.5-stable_osx.universal.zip
wget https://downloads.tuxfamily.org/godotengine/4.1/Godot_v4.1-stable_macos.universal.zip
unzip Godot_v4.1-stable_macos.universal.zip
mkdir -p -v cached_builds/editor
mv Godot.app cached_builds/editor/
- name: "Setup templates and libraries"
env:
TEMPLATE_PATH: /Users/runner/Library/Application Support/Godot/templates/3.5.stable
TEMPLATE_PATH: /Users/runner/Library/Application Support/Godot/export_templates/4.1.stable
run: |
mkdir -p -v "$TEMPLATE_PATH"
cp cached_builds/template/osx.zip "$TEMPLATE_PATH"
ln -s ../../../cached_builds/videodecoder/osx retrohub/addons/godot-videodecoder/osx
cp cached_builds/template/macos.zip "$TEMPLATE_PATH"
ln -s ../../../cached_builds/videodecoder/macos retrohub/addons/godot-videodecoder/macos
mkdir -p -v export/macos
- name: "Package default themes"
uses: ./retrohub/.github/actions/get-default-themes

- name: "Package godot-tts"
run: |
mkdir -p -v retrohub/addons/godot-tts/target/release
cp -r -v cached_builds/tts/* retrohub/addons/godot-tts/target/release
- name: "Exporting RetroHub"
working-directory: retrohub
run: |
../cached_builds/editor/Godot.app/Contents/MacOS/Godot --export "Mac" ../export/macos/RetroHub.app
../cached_builds/editor/Godot.app/Contents/MacOS/Godot --headless --export-release "macOS" ../export/macos/RetroHub.app
- name: "Sign executable"
working-directory: export/macos
Expand Down
Loading

0 comments on commit 1a87208

Please sign in to comment.