-
-
Notifications
You must be signed in to change notification settings - Fork 89
134 lines (115 loc) · 5.32 KB
/
build.linux.workflow.yml
File metadata and controls
134 lines (115 loc) · 5.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
name: Build Linux
permissions:
actions: write
contents: write
packages: write
on:
push:
branches: [ master, test-ci ]
pull_request:
branches: [ master ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: "Build: ${{ matrix.os }} - ${{ matrix.archvariant }}"
runs-on: ${{ matrix.os }}
env:
VCPKG_FEATURE_FLAGS: manifests,binarycaching
VCPKG_BINARY_SOURCES: ${{ format('clear;nuget,https://nuget.pkg.github.com/{0}/index.json,{1}', github.repository_owner, github.event_name == 'pull_request' && 'read' || 'readwrite') }}
VCPKG_NUGET_REPOSITORY: https://github.com/${{ github.repository }}.git
VCPKG_DOWNLOADS: ${{ github.workspace }}/.vcpkg-downloads
SCCACHE_GHA_ENABLED: "true"
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04]
arch: [x64]
config: [Release]
statictype: [ON, OFF]
include:
- statictype: ON
archvariant: "x64"
host_triplet: release
release_suffix: static
- statictype: OFF
archvariant: "x64-Dynamic"
host_triplet: dynamic-apng-release
release_suffix: shared
steps:
- name: Checkout Git Repo
uses: actions/checkout@v5
with:
submodules: 'recursive'
- name: workaround for default apt mirror connectivity issues
run: |
sudo sed -i 's/azure\.//' /etc/apt/sources.list
- name: Install dependencies
run: |
set -e
sudo apt-get update
sudo apt-get install -y --no-install-recommends autoconf automake autoconf-archive mono-runtime '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev libegl1-mesa-dev libudev-dev libusb-1.0-0-dev
- name: Install latest CMake
uses: lukka/get-cmake@628dd514bed37cb0a609e84a6186cbbaa2fc0140 # latest as of 2025-10-04
- name: Ensure vcpkg downloads directory exists
run: |
mkdir -p "$VCPKG_DOWNLOADS"
- name: Cache vcpkg downloads
uses: actions/cache@v4
with:
path: ${{ env.VCPKG_DOWNLOADS }}
key: ${{ runner.os }}-vcpkg-downloads-${{ hashFiles('gui/qt/vcpkg.json', 'gui/qt/vcpkg-configuration.json') }}
restore-keys: |
${{ runner.os }}-vcpkg-downloads-
- name: Restore artifacts, or setup vcpkg (do not install any package)
uses: lukka/run-vcpkg@b3dd708d38df5c856fe1c18dc0d59ab771f93921 # latest as of 2025-10-04
with:
vcpkgJsonGlob: '**/gui/qt/vcpkg.json'
- name: Configure vcpkg NuGet source
shell: bash
run: |
set -euo pipefail
NUGET_PATH="$(${VCPKG_ROOT}/vcpkg fetch nuget | tail -n 1 | tr -d '\r')"
echo "Resolved NuGet at: $NUGET_PATH"
if [[ "$NUGET_PATH" == *.exe ]]; then
NUGET_CMD=(mono "$NUGET_PATH")
else
NUGET_CMD=("$NUGET_PATH")
fi
"${NUGET_CMD[@]}" sources remove -Name GitHub -Source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" || true
"${NUGET_CMD[@]}" sources add -Name GitHub -Source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" \
-Username "${{ github.repository_owner }}" \
-Password "${{ secrets.GITHUB_TOKEN }}" \
-StorePasswordInClearText
if [[ "${{ github.event_name }}" != "pull_request" ]]; then
"${NUGET_CMD[@]}" setapikey "${{ secrets.GITHUB_TOKEN }}" -Source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json"
fi
- name: Start sccache
uses: mozilla-actions/sccache-action@v0.0.9
- name: Build CEmu ${{ matrix.archvariant }} ${{ matrix.config }} on Linux ${{ matrix.arch }}
uses: lukka/run-cmake@67c73a83a46f86c4e0b96b741ac37ff495478c38 # latest as of 2025-10-04
with:
cmakeListsTxtPath: '${{ github.workspace }}/gui/qt/CMakeLists.txt'
configurePreset: 'Linux-${{ matrix.archvariant }}'
configurePresetAdditionalArgs: "['-DDEPS_RELEASE_ONLY=ON', '-DSHORT_VERSION=v3.0', '-DCMAKE_C_COMPILER_LAUNCHER=sccache', '-DCMAKE_CXX_COMPILER_LAUNCHER=sccache']"
buildPreset: 'Linux-${{ matrix.archvariant }}-${{ matrix.config }}'
env:
VCPKG_DEFAULT_HOST_TRIPLET: ${{ matrix.arch }}-linux-${{ matrix.host_triplet }}
- name: Upload binary as artifact
uses: actions/upload-artifact@v4
with:
name: CEmu_linux_${{ matrix.archvariant }}_master
path: ${{ github.workspace }}/gui/qt/CEmu.build/Linux-${{ matrix.archvariant }}/${{ matrix.config }}/CEmu
- name: Prepare binary for release upload
run: |
mv ${{ github.workspace }}/gui/qt/CEmu.build/Linux-${{ matrix.archvariant }}/${{ matrix.config }}/CEmu ${{ github.workspace }}/CEmu-nightly_linux64_${{ matrix.release_suffix }}
- name: Update nightly release
if: ${{ github.ref == 'refs/heads/master' && github.event_name != 'pull_request' }}
uses: softprops/action-gh-release@62c96d0c4e8a889135c1f3a25910db8dbe0e85f7 # latest as of 2025-10-04
with:
tag_name: nightly
prerelease: true
token: ${{secrets.GITHUB_TOKEN}}
files: |
${{ github.workspace }}/CEmu-nightly_linux64_${{ matrix.release_suffix }}