mirror of
https://github.com/Cuteminded/jellyframe.git
synced 2026-10-27 08:07:19 +01:00
134 lines
4.7 KiB
YAML
134 lines
4.7 KiB
YAML
name: Build Linux
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
workflow_call:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
concurrency:
|
|
group: linux-${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
env:
|
|
GODOT_VERSION: 4.7.2
|
|
|
|
jobs:
|
|
build:
|
|
name: Linux ${{ matrix.arch }} build
|
|
runs-on: ${{ matrix.runner }}
|
|
timeout-minutes: 30
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- arch: x86_64
|
|
runner: ubuntu-24.04
|
|
preset: Linux x64
|
|
- arch: arm64
|
|
runner: ubuntu-24.04-arm
|
|
preset: Linux ARM64
|
|
env:
|
|
ARCH: ${{ matrix.arch }}
|
|
EXPORT_PRESET: ${{ matrix.preset }}
|
|
defaults:
|
|
run:
|
|
shell: bash
|
|
steps:
|
|
- name: Check out source code
|
|
uses: actions/checkout@v7
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Install build dependencies
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install --no-install-recommends -y build-essential cmake pkg-config python3 curl unzip libmpv-dev patchelf libavcodec-dev libavformat-dev libavutil-dev libswscale-dev
|
|
|
|
- name: Build PC video plugin
|
|
run: |
|
|
bash tools/build-pc-video.sh
|
|
|
|
- name: Install Godot and export templates
|
|
run: |
|
|
release="${GODOT_VERSION}-stable"
|
|
base_url="https://github.com/godotengine/godot-builds/releases/download/${release}"
|
|
curl --fail --location --retry 3 "${base_url}/Godot_v${release}_linux.${ARCH}.zip" -o "$RUNNER_TEMP/godot.zip"
|
|
curl --fail --location --retry 3 "${base_url}/Godot_v${release}_export_templates.tpz" -o "$RUNNER_TEMP/templates.tpz"
|
|
mkdir -p "$RUNNER_TEMP/godot"
|
|
unzip -q "$RUNNER_TEMP/godot.zip" -d "$RUNNER_TEMP/godot"
|
|
mv "$RUNNER_TEMP/godot/Godot_v${release}_linux.${ARCH}" "$RUNNER_TEMP/godot/godot"
|
|
chmod +x "$RUNNER_TEMP/godot/godot"
|
|
echo "$RUNNER_TEMP/godot" >> "$GITHUB_PATH"
|
|
template_dir="$HOME/.local/share/godot/export_templates/${GODOT_VERSION}.stable"
|
|
mkdir -p "$template_dir"
|
|
unzip -j -q "$RUNNER_TEMP/templates.tpz" \
|
|
"templates/linux_debug.${ARCH}" "templates/linux_release.${ARCH}" \
|
|
-d "$template_dir"
|
|
|
|
- name: Import Godot project
|
|
run: |
|
|
godot --headless --xr-mode off --path . --editor --import --quit
|
|
|
|
- name: Export Linux build
|
|
run: |
|
|
output="dist/linux-${ARCH}"
|
|
mkdir -p "$output"
|
|
godot --headless --xr-mode off --path . --export-release "$EXPORT_PRESET" "$output/jellyframe.${ARCH}"
|
|
|
|
- name: Verify Linux export files
|
|
run: |
|
|
output="dist/linux-${ARCH}"
|
|
test -s "$output/jellyframe.${ARCH}"
|
|
test -s "$output/jellyframe_mpv.linux.${ARCH}.so"
|
|
chmod +x "$output/jellyframe.${ARCH}"
|
|
|
|
- name: Verify exported renderer settings
|
|
run: timeout 30 godot --headless --xr-mode off --main-pack "dist/linux-${ARCH}/jellyframe.${ARCH}" --script tests/test_export_renderer.gd
|
|
|
|
- name: Copy Linux licenses and installation guide
|
|
run: |
|
|
output="dist/linux-${ARCH}"
|
|
cp -r "build/linux/${ARCH}/licenses" "$output/"
|
|
cp LICENSE "$output/licenses/jellyframe.txt"
|
|
cp LICENSING.md "$output/licenses/"
|
|
|
|
- name: Check Linux decoder dependencies
|
|
run: |
|
|
output="dist/linux-${ARCH}"
|
|
ldd "$output/jellyframe_mpv.linux.${ARCH}.so" | tee "$RUNNER_TEMP/dependencies.log"
|
|
if grep -q 'not found' "$RUNNER_TEMP/dependencies.log"; then
|
|
echo 'The exported decoder has missing shared libraries.' >&2
|
|
exit 1
|
|
fi
|
|
|
|
- name: Package Linux AppImage
|
|
run: bash tools/package-linux-appimages.sh "$ARCH"
|
|
|
|
- name: Package Linux build with system libraries
|
|
run: |
|
|
tar -czf "dist/jellyframe-linux-${ARCH}.tar.gz" -C "dist/linux-${ARCH}" .
|
|
|
|
- name: Set artifact date
|
|
id: date
|
|
run: echo "date=$(date -u '+%d-%m-%Y')" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Upload Linux build with system libraries
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: ${{ steps.date.outputs.date }}-jellyframe-linux-${{ matrix.arch }}-system-libs
|
|
path: dist/jellyframe-linux-${{ matrix.arch }}.tar.gz
|
|
if-no-files-found: error
|
|
retention-days: 14
|
|
archive: false
|
|
|
|
- name: Upload Linux AppImage
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: ${{ steps.date.outputs.date }}-jellyframe-linux-${{ matrix.arch }}-appimage
|
|
path: dist/jellyframe-linux-${{ matrix.arch }}.AppImage
|
|
if-no-files-found: error
|
|
retention-days: 14
|
|
archive: false
|