Skip to content

Commit 7d829ac

Browse files
ReenigneArchercgutman
authored andcommitted
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.
1 parent 5244313 commit 7d829ac

5 files changed

Lines changed: 100 additions & 50 deletions

File tree

.github/workflows/build-appimage.yml

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,24 @@
1-
name: Build Linux AppImage
1+
---
2+
name: Build - Linux AppImage
3+
permissions:
4+
contents: read
25

36
on:
4-
push:
5-
pull_request:
6-
branches: [ "master" ]
7+
workflow_call:
8+
inputs:
9+
ci_version:
10+
required: true
11+
type: string
712

813
jobs:
914
build:
15+
env:
16+
CI_VERSION: ${{ inputs.ci_version }}
1017
runs-on: ubuntu-22.04
1118

1219
steps:
1320
- name: Checkout Repository
14-
uses: actions/checkout@v4
21+
uses: actions/checkout@v5
1522
with:
1623
submodules: 'recursive'
1724
fetch-depth: 1
@@ -28,16 +35,11 @@ jobs:
2835
wayland-protocols libopus-dev libvdpau-dev libgl-dev libpipewire-0.3-dev vulkan-sdk
2936
sudo pip3 install meson
3037
mkdir -p dep_root/{bin,include,lib}
31-
echo "DEP_ROOT=$PWD/dep_root" >> $GITHUB_ENV
32-
echo "$PWD/dep_root/bin" >> $GITHUB_PATH
33-
34-
- name: Set CI version
35-
run: |
36-
CI_VERSION=`echo $GITHUB_SHA | cut -c1-6`
37-
echo "CI_VERSION=$CI_VERSION" >> $GITHUB_ENV
38+
echo "DEP_ROOT=$PWD/dep_root" >> "${GITHUB_ENV}"
39+
echo "$PWD/dep_root/bin" >> "${GITHUB_PATH}"
3840
3941
- name: Checkout SDL
40-
uses: actions/checkout@v4
42+
uses: actions/checkout@v5
4143
with:
4244
repository: libsdl-org/SDL
4345
ref: 235e4870af091ea7e3814ee2dbdb8e2ec627aaf0
@@ -52,7 +54,7 @@ jobs:
5254
sudo make install
5355
5456
- name: Checkout SDL_ttf
55-
uses: actions/checkout@v4
57+
uses: actions/checkout@v5
5658
with:
5759
repository: libsdl-org/SDL_ttf
5860
ref: release-2.22.0
@@ -68,7 +70,7 @@ jobs:
6870
sudo make install
6971
7072
- name: Checkout libva
71-
uses: actions/checkout@v4
73+
uses: actions/checkout@v5
7274
with:
7375
repository: intel/libva
7476
ref: 2.22.0
@@ -83,7 +85,7 @@ jobs:
8385
sudo make install
8486
8587
- name: Checkout libplacebo
86-
uses: actions/checkout@v4
88+
uses: actions/checkout@v5
8789
with:
8890
repository: haasn/libplacebo
8991
ref: 63a3d64ac32eaaa56aa60b5000d43c02544c6508
@@ -111,7 +113,7 @@ jobs:
111113
popd
112114
113115
- name: Checkout FFmpeg
114-
uses: actions/checkout@v4
116+
uses: actions/checkout@v5
115117
with:
116118
repository: FFmpeg/FFmpeg
117119
ref: dd00a614e16a15db0b230dfe45790e913e593695
@@ -141,9 +143,9 @@ jobs:
141143
scripts/build-appimage.sh
142144
143145
- name: Upload Binaries
144-
uses: actions/upload-artifact@v4
146+
uses: actions/upload-artifact@v5
145147
with:
146148
name: Moonlight-LinuxAppImage-${{ env.CI_VERSION }}
147149
path: build/installer-release/Moonlight-${{ env.CI_VERSION }}-x86_64.AppImage
148150
compression-level: 0
149-
if-no-files-found: error
151+
if-no-files-found: error

.github/workflows/build-steamlink.yml

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,40 @@
1-
name: Build Steam Link
1+
---
2+
name: Build - Steam Link
3+
permissions:
4+
contents: read
25

36
on:
4-
push:
5-
pull_request:
6-
branches: [ "master" ]
7+
workflow_call:
8+
inputs:
9+
ci_version:
10+
required: true
11+
type: string
712

813
jobs:
914
build:
15+
env:
16+
CI_VERSION: ${{ inputs.ci_version }}
1017
runs-on: ubuntu-22.04
1118

1219
steps:
1320
- name: Checkout Repository
14-
uses: actions/checkout@v4
21+
uses: actions/checkout@v5
1522
with:
1623
submodules: 'recursive'
1724
fetch-depth: 1
1825

1926
- name: Checkout Steam Link SDK
20-
uses: actions/checkout@v4
27+
uses: actions/checkout@v5
2128
with:
2229
repository: ValveSoftware/steamlink-sdk
2330
path: steamlink-sdk
2431
fetch-depth: 1
2532

26-
- name: Set CI version
27-
run: |
28-
CI_VERSION=`echo $GITHUB_SHA | cut -c1-6`
29-
echo "CI_VERSION=$CI_VERSION" >> $GITHUB_ENV
30-
3133
- name: Build binaries
3234
run: STEAMLINK_SDK_PATH=$PWD/steamlink-sdk scripts/build-steamlink-app.sh
3335

3436
- name: Upload Binaries
35-
uses: actions/upload-artifact@v4
37+
uses: actions/upload-artifact@v5
3638
with:
3739
name: Moonlight-SteamLink-${{ env.CI_VERSION }}
3840
path: build/deploy-release/*

.github/workflows/build-win-mac.yml

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
1-
name: Build Windows and macOS
1+
---
2+
name: Build - Windows and macOS
3+
permissions:
4+
contents: read
25

36
on:
4-
push:
5-
pull_request:
6-
branches: [ "master" ]
7+
workflow_call:
8+
inputs:
9+
ci_version:
10+
required: true
11+
type: string
712

813
jobs:
914
build:
15+
env:
16+
CI_VERSION: ${{ inputs.ci_version }}
1017
strategy:
1118
fail-fast: false
1219
matrix:
@@ -22,17 +29,11 @@ jobs:
2229

2330
steps:
2431
- name: Checkout Repository
25-
uses: actions/checkout@v4
32+
uses: actions/checkout@v5
2633
with:
2734
submodules: 'recursive'
2835
fetch-depth: 1
2936

30-
- name: Set CI version
31-
shell: bash
32-
run: |
33-
CI_VERSION=`echo $GITHUB_SHA | cut -c1-6`
34-
echo "CI_VERSION=$CI_VERSION" >> $GITHUB_ENV
35-
3637
- name: Install create-dmg (macOS)
3738
if: runner.os == 'macOS'
3839
run: |
@@ -85,23 +86,23 @@ jobs:
8586
}
8687
8788
- name: Upload Binaries (Windows x64)
88-
uses: actions/upload-artifact@v4
89+
uses: actions/upload-artifact@v5
8990
if: runner.os == 'Windows'
9091
with:
9192
name: Moonlight-${{ runner.os }}-x64-${{ env.CI_VERSION }}
9293
path: build/deploy-x64-release/*
9394
if-no-files-found: error
9495

9596
- name: Upload Binaries (Windows arm64)
96-
uses: actions/upload-artifact@v4
97+
uses: actions/upload-artifact@v5
9798
if: runner.os == 'Windows'
9899
with:
99100
name: Moonlight-${{ runner.os }}-arm64-${{ env.CI_VERSION }}
100101
path: build/deploy-arm64-release/*
101102
if-no-files-found: error
102103

103104
- name: Upload Binaries (macOS)
104-
uses: actions/upload-artifact@v4
105+
uses: actions/upload-artifact@v5
105106
if: runner.os == 'macOS'
106107
with:
107108
name: Moonlight-${{ runner.os }}-${{ env.CI_VERSION }}
@@ -110,7 +111,7 @@ jobs:
110111
if-no-files-found: error
111112

112113
- name: Upload Symbols
113-
uses: actions/upload-artifact@v4
114+
uses: actions/upload-artifact@v5
114115
with:
115116
name: zDevDbgSyms-${{ runner.os }}-${{ env.CI_VERSION }}
116117
path: |

.github/workflows/build.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
name: Build
3+
permissions:
4+
contents: read
5+
6+
on:
7+
push:
8+
pull_request:
9+
branches:
10+
- master
11+
12+
concurrency:
13+
group: build-${{ github.ref }}
14+
cancel-in-progress: true
15+
16+
jobs:
17+
setup:
18+
runs-on: ubuntu-latest
19+
outputs:
20+
ci_version: ${{ steps.set-ci-version.outputs.ci_version }}
21+
steps:
22+
- name: Set CI version
23+
id: set-ci-version
24+
shell: bash
25+
run: |
26+
CI_VERSION=`echo ${GITHUB_SHA} | cut -c1-6`
27+
echo "ci_version=${CI_VERSION}" >> "${GITHUB_OUTPUT}"
28+
29+
build-appimage:
30+
needs: setup
31+
uses: ./.github/workflows/build-appimage.yml
32+
with:
33+
ci_version: ${{ needs.setup.outputs.ci_version }}
34+
35+
build-steamlink:
36+
needs: setup
37+
uses: ./.github/workflows/build-steamlink.yml
38+
with:
39+
ci_version: ${{ needs.setup.outputs.ci_version }}
40+
41+
build-windows-macos:
42+
needs: setup
43+
uses: ./.github/workflows/build-win-mac.yml
44+
with:
45+
ci_version: ${{ needs.setup.outputs.ci_version }}

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,7 @@ Moonlight also has mobile versions for [Android](https://github.com/moonlight-st
66

77
You can follow development on our [Discord server](https://moonlight-stream.org/discord) and help translate Moonlight into your language on [Weblate](https://hosted.weblate.org/projects/moonlight/moonlight-qt/).
88

9-
[![Windows and macOS CI Builds](https://github.com/moonlight-stream/moonlight-qt/actions/workflows/build-win-mac.yml/badge.svg?branch=master)](https://github.com/moonlight-stream/moonlight-qt/actions/workflows/build-win-mac.yml?query=branch%3Amaster)
10-
[![Linux AppImage CI Builds](https://github.com/moonlight-stream/moonlight-qt/actions/workflows/build-appimage.yml/badge.svg?branch=master)](https://github.com/moonlight-stream/moonlight-qt/actions/workflows/build-appimage.yml?query=branch%3Amaster)
11-
[![Steam Link CI Builds](https://github.com/moonlight-stream/moonlight-qt/actions/workflows/build-steamlink.yml/badge.svg?branch=master)](https://github.com/moonlight-stream/moonlight-qt/actions/workflows/build-steamlink.yml?query=branch%3Amaster)
12-
9+
[![Build](https://img.shields.io/github/actions/workflow/status/moonlight-stream/moonlight-qt/build.yml?branch=master)](https://github.com/moonlight-stream/moonlight-qt/actions/workflows/build.yml?query=branch%3Amaster)
1310
[![Downloads](https://img.shields.io/github/downloads/moonlight-stream/moonlight-qt/total)](https://github.com/moonlight-stream/moonlight-qt/releases)
1411
[![Translation Status](https://hosted.weblate.org/widgets/moonlight/-/moonlight-qt/svg-badge.svg)](https://hosted.weblate.org/projects/moonlight/moonlight-qt/)
1512

@@ -34,6 +31,9 @@ You can follow development on our [Discord server](https://moonlight-stream.org/
3431
- [Experimental RISC-V Debian packages](https://github.com/moonlight-stream/moonlight-docs/wiki/Installing-Moonlight-Qt-on-RISC%E2%80%90V-Single-Board-Computers)
3532
- [NVIDIA Jetson and Nintendo Switch (Ubuntu L4T)](https://github.com/moonlight-stream/moonlight-docs/wiki/Installing-Moonlight-Qt-on-Linux4Tegra-(L4T)-Ubuntu)
3633

34+
### Nightly Builds
35+
- [Downloads](https://nightly.link/moonlight-stream/moonlight-qt/workflows/build/master)
36+
3737
#### Special Thanks
3838

3939
[![Hosted By: Cloudsmith](https://img.shields.io/badge/OSS%20hosting%20by-cloudsmith-blue?logo=cloudsmith&style=flat-square)](https://cloudsmith.com)

0 commit comments

Comments
 (0)