ci: refactor workflows to use reusable workflow calls

Updated build workflows to use workflow_call triggers and accept ci_version as input, removing inline CI version generation. Upgraded all actions to v5 and added a new build.yml workflow to orchestrate builds for AppImage, Steam Link, and Windows/macOS using reusable workflows. This improves maintainability and consistency across CI jobs.
This commit is contained in:
ReenigneArcher
2025-10-27 17:25:03 -04:00
committed by Cameron Gutman
parent 5244313b30
commit 7d829ac0c4
5 changed files with 100 additions and 50 deletions

View File

@@ -1,17 +1,24 @@
name: Build Linux AppImage
---
name: Build - Linux AppImage
permissions:
contents: read
on:
push:
pull_request:
branches: [ "master" ]
workflow_call:
inputs:
ci_version:
required: true
type: string
jobs:
build:
env:
CI_VERSION: ${{ inputs.ci_version }}
runs-on: ubuntu-22.04
steps:
- name: Checkout Repository
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
submodules: 'recursive'
fetch-depth: 1
@@ -28,16 +35,11 @@ jobs:
wayland-protocols libopus-dev libvdpau-dev libgl-dev libpipewire-0.3-dev vulkan-sdk
sudo pip3 install meson
mkdir -p dep_root/{bin,include,lib}
echo "DEP_ROOT=$PWD/dep_root" >> $GITHUB_ENV
echo "$PWD/dep_root/bin" >> $GITHUB_PATH
- name: Set CI version
run: |
CI_VERSION=`echo $GITHUB_SHA | cut -c1-6`
echo "CI_VERSION=$CI_VERSION" >> $GITHUB_ENV
echo "DEP_ROOT=$PWD/dep_root" >> "${GITHUB_ENV}"
echo "$PWD/dep_root/bin" >> "${GITHUB_PATH}"
- name: Checkout SDL
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
repository: libsdl-org/SDL
ref: 235e4870af091ea7e3814ee2dbdb8e2ec627aaf0
@@ -52,7 +54,7 @@ jobs:
sudo make install
- name: Checkout SDL_ttf
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
repository: libsdl-org/SDL_ttf
ref: release-2.22.0
@@ -68,7 +70,7 @@ jobs:
sudo make install
- name: Checkout libva
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
repository: intel/libva
ref: 2.22.0
@@ -83,7 +85,7 @@ jobs:
sudo make install
- name: Checkout libplacebo
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
repository: haasn/libplacebo
ref: 63a3d64ac32eaaa56aa60b5000d43c02544c6508
@@ -111,7 +113,7 @@ jobs:
popd
- name: Checkout FFmpeg
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
repository: FFmpeg/FFmpeg
ref: dd00a614e16a15db0b230dfe45790e913e593695
@@ -141,9 +143,9 @@ jobs:
scripts/build-appimage.sh
- name: Upload Binaries
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v5
with:
name: Moonlight-LinuxAppImage-${{ env.CI_VERSION }}
path: build/installer-release/Moonlight-${{ env.CI_VERSION }}-x86_64.AppImage
compression-level: 0
if-no-files-found: error
if-no-files-found: error

View File

@@ -1,38 +1,40 @@
name: Build Steam Link
---
name: Build - Steam Link
permissions:
contents: read
on:
push:
pull_request:
branches: [ "master" ]
workflow_call:
inputs:
ci_version:
required: true
type: string
jobs:
build:
env:
CI_VERSION: ${{ inputs.ci_version }}
runs-on: ubuntu-22.04
steps:
- name: Checkout Repository
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
submodules: 'recursive'
fetch-depth: 1
- name: Checkout Steam Link SDK
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
repository: ValveSoftware/steamlink-sdk
path: steamlink-sdk
fetch-depth: 1
- name: Set CI version
run: |
CI_VERSION=`echo $GITHUB_SHA | cut -c1-6`
echo "CI_VERSION=$CI_VERSION" >> $GITHUB_ENV
- name: Build binaries
run: STEAMLINK_SDK_PATH=$PWD/steamlink-sdk scripts/build-steamlink-app.sh
- name: Upload Binaries
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v5
with:
name: Moonlight-SteamLink-${{ env.CI_VERSION }}
path: build/deploy-release/*

View File

@@ -1,12 +1,19 @@
name: Build Windows and macOS
---
name: Build - Windows and macOS
permissions:
contents: read
on:
push:
pull_request:
branches: [ "master" ]
workflow_call:
inputs:
ci_version:
required: true
type: string
jobs:
build:
env:
CI_VERSION: ${{ inputs.ci_version }}
strategy:
fail-fast: false
matrix:
@@ -22,17 +29,11 @@ jobs:
steps:
- name: Checkout Repository
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
submodules: 'recursive'
fetch-depth: 1
- name: Set CI version
shell: bash
run: |
CI_VERSION=`echo $GITHUB_SHA | cut -c1-6`
echo "CI_VERSION=$CI_VERSION" >> $GITHUB_ENV
- name: Install create-dmg (macOS)
if: runner.os == 'macOS'
run: |
@@ -85,7 +86,7 @@ jobs:
}
- name: Upload Binaries (Windows x64)
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v5
if: runner.os == 'Windows'
with:
name: Moonlight-${{ runner.os }}-x64-${{ env.CI_VERSION }}
@@ -93,7 +94,7 @@ jobs:
if-no-files-found: error
- name: Upload Binaries (Windows arm64)
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v5
if: runner.os == 'Windows'
with:
name: Moonlight-${{ runner.os }}-arm64-${{ env.CI_VERSION }}
@@ -101,7 +102,7 @@ jobs:
if-no-files-found: error
- name: Upload Binaries (macOS)
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v5
if: runner.os == 'macOS'
with:
name: Moonlight-${{ runner.os }}-${{ env.CI_VERSION }}
@@ -110,7 +111,7 @@ jobs:
if-no-files-found: error
- name: Upload Symbols
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v5
with:
name: zDevDbgSyms-${{ runner.os }}-${{ env.CI_VERSION }}
path: |

45
.github/workflows/build.yml vendored Normal file
View File

@@ -0,0 +1,45 @@
---
name: Build
permissions:
contents: read
on:
push:
pull_request:
branches:
- master
concurrency:
group: build-${{ github.ref }}
cancel-in-progress: true
jobs:
setup:
runs-on: ubuntu-latest
outputs:
ci_version: ${{ steps.set-ci-version.outputs.ci_version }}
steps:
- name: Set CI version
id: set-ci-version
shell: bash
run: |
CI_VERSION=`echo ${GITHUB_SHA} | cut -c1-6`
echo "ci_version=${CI_VERSION}" >> "${GITHUB_OUTPUT}"
build-appimage:
needs: setup
uses: ./.github/workflows/build-appimage.yml
with:
ci_version: ${{ needs.setup.outputs.ci_version }}
build-steamlink:
needs: setup
uses: ./.github/workflows/build-steamlink.yml
with:
ci_version: ${{ needs.setup.outputs.ci_version }}
build-windows-macos:
needs: setup
uses: ./.github/workflows/build-win-mac.yml
with:
ci_version: ${{ needs.setup.outputs.ci_version }}