Skip to content

Commit 9f866e7

Browse files
committed
feat: enhance RPM artifact workflow and localization support
- Update release.yml to use latest Fedora image for RPM builds - Add RPM Artifacts workflow for non-release builds - Improve localization in language and UI preference managers - Update Driver and Settings pages for better theme handling
1 parent 7de7e54 commit 9f866e7

10 files changed

Lines changed: 256 additions & 21 deletions

File tree

.github/workflows/release.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ jobs:
9999
- arch: aarch64
100100
runs_on: ubuntu-24.04-arm
101101
container:
102-
image: fedora:42
102+
image: fedora:latest
103103

104104
steps:
105105
- name: Checkout repository
@@ -139,11 +139,12 @@ jobs:
139139
mkdir -p ~/rpmbuild/SOURCES ~/rpmbuild/SPECS dist/rpm
140140
cp "dist/${ARCHIVE_PREFIX}.tar.gz" "${HOME}/rpmbuild/SOURCES/"
141141
cp packaging/rpm/ro-control.spec "${HOME}/rpmbuild/SPECS/ro-control.spec"
142+
FEDORA_VERSION="$(rpm -E %fedora)"
142143
143144
rpmbuild -ba "${HOME}/rpmbuild/SPECS/ro-control.spec" \
144145
--define "_topdir ${HOME}/rpmbuild" \
145146
--define "upstream_version ${VERSION}" \
146-
--define "dist .fc42"
147+
--define "dist .fc${FEDORA_VERSION}"
147148
148149
find ~/rpmbuild/RPMS -maxdepth 2 -type f -name "ro-control-[0-9]*.${RPM_ARCH}.rpm" -exec cp {} dist/rpm/ \;
149150
Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
name: RPM Artifacts
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
9+
permissions:
10+
contents: read
11+
12+
concurrency:
13+
group: rpm-artifacts-${{ github.ref }}
14+
cancel-in-progress: true
15+
16+
jobs:
17+
metadata:
18+
name: Resolve RPM Metadata
19+
runs-on: ubuntu-latest
20+
21+
outputs:
22+
version: ${{ steps.meta.outputs.version }}
23+
archive_prefix: ${{ steps.meta.outputs.archive_prefix }}
24+
25+
steps:
26+
- name: Checkout repository
27+
uses: actions/checkout@v4
28+
29+
- name: Resolve version
30+
id: meta
31+
run: |
32+
VERSION="$(sed -n 's/^[[:space:]]*VERSION[[:space:]]\([0-9.][0-9.]*\)$/\1/p' CMakeLists.txt | head -n1)"
33+
if [[ -z "${VERSION}" ]]; then
34+
echo "Failed to resolve project version from CMakeLists.txt." >&2
35+
exit 1
36+
fi
37+
38+
echo "version=${VERSION}" >> "${GITHUB_OUTPUT}"
39+
echo "archive_prefix=ro-control-${VERSION}" >> "${GITHUB_OUTPUT}"
40+
41+
source-archive:
42+
name: Build Source Archive
43+
runs-on: ubuntu-latest
44+
needs: metadata
45+
46+
steps:
47+
- name: Checkout repository
48+
uses: actions/checkout@v4
49+
50+
- name: Create source archive
51+
env:
52+
ARCHIVE_PREFIX: ${{ needs.metadata.outputs.archive_prefix }}
53+
run: |
54+
git archive --format=tar.gz --prefix="${ARCHIVE_PREFIX}/" --output="${ARCHIVE_PREFIX}.tar.gz" "${GITHUB_SHA}"
55+
56+
- name: Upload source archive
57+
uses: actions/upload-artifact@v4
58+
with:
59+
name: ro-control-source-${{ needs.metadata.outputs.version }}
60+
path: |
61+
${{ needs.metadata.outputs.archive_prefix }}.tar.gz
62+
63+
rpm:
64+
name: Build RPM (${{ matrix.arch }})
65+
runs-on: ${{ matrix.runs_on }}
66+
needs: [metadata, source-archive]
67+
timeout-minutes: 60
68+
strategy:
69+
fail-fast: false
70+
matrix:
71+
include:
72+
- arch: x86_64
73+
runs_on: ubuntu-24.04
74+
- arch: aarch64
75+
runs_on: ubuntu-24.04-arm
76+
container:
77+
image: fedora:latest
78+
79+
steps:
80+
- name: Checkout repository
81+
uses: actions/checkout@v4
82+
83+
- name: Download source archive
84+
uses: actions/download-artifact@v4
85+
with:
86+
name: ro-control-source-${{ needs.metadata.outputs.version }}
87+
path: dist
88+
89+
- name: Install RPM tooling and dependencies
90+
run: |
91+
dnf install -y \
92+
git \
93+
rpm-build \
94+
cmake \
95+
extra-cmake-modules \
96+
gcc-c++ \
97+
ninja-build \
98+
qt6-qtbase-devel \
99+
qt6-qtbase-private-devel \
100+
qt6-qtdeclarative-devel \
101+
qt6-qttools-devel \
102+
qt6-qtwayland-devel \
103+
kf6-qqc2-desktop-style \
104+
polkit-devel
105+
106+
- name: Build RPM artifacts
107+
env:
108+
VERSION: ${{ needs.metadata.outputs.version }}
109+
ARCHIVE_PREFIX: ${{ needs.metadata.outputs.archive_prefix }}
110+
RPM_ARCH: ${{ matrix.arch }}
111+
run: |
112+
mkdir -p ~/rpmbuild/SOURCES ~/rpmbuild/SPECS dist/rpm
113+
cp "dist/${ARCHIVE_PREFIX}.tar.gz" "${HOME}/rpmbuild/SOURCES/"
114+
cp packaging/rpm/ro-control.spec "${HOME}/rpmbuild/SPECS/ro-control.spec"
115+
FEDORA_VERSION="$(rpm -E %fedora)"
116+
117+
rpmbuild -ba "${HOME}/rpmbuild/SPECS/ro-control.spec" \
118+
--define "_topdir ${HOME}/rpmbuild" \
119+
--define "upstream_version ${VERSION}" \
120+
--define "dist .fc${FEDORA_VERSION}"
121+
122+
RPM_FILE="$(find ~/rpmbuild/RPMS -maxdepth 2 -type f -name "ro-control-[0-9]*.${RPM_ARCH}.rpm" | head -n1)"
123+
if [[ -z "${RPM_FILE}" ]]; then
124+
echo "Failed to find built ${RPM_ARCH} RPM." >&2
125+
exit 1
126+
fi
127+
cp "${RPM_FILE}" "dist/rpm/ro-control-${RPM_ARCH}.rpm"
128+
129+
- name: Upload RPM artifacts
130+
uses: actions/upload-artifact@v4
131+
with:
132+
name: ro-control-${{ matrix.arch }}-rpm
133+
path: |
134+
dist/rpm/ro-control-${{ matrix.arch }}.rpm

docs/BUILDING.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,14 @@ The GitHub release pipeline publishes only:
9292
- `noarch` RPM
9393
- `src` RPM
9494

95+
### GitHub Actions RPM artifact build
96+
97+
For branch builds (without creating a GitHub Release), run the **RPM Artifacts**
98+
workflow. It uploads `.rpm` artifacts for:
99+
100+
- `x86_64`
101+
- `aarch64`
102+
95103
### Refresh translations (recommended before release)
96104

97105
```bash

i18n/ro-control_tr.ts

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,11 @@ Yedek Acik Surucu: %6</translation>
548548
<source>Failed to apply the Wayland kernel parameter: </source>
549549
<translation>Wayland kernel parametresi uygulanamadı: </translation>
550550
</message>
551+
<message>
552+
<location filename="../src/backend/nvidia/installer.cpp" line="543" />
553+
<source>Wayland detected: applying nvidia-drm.modeset=1...</source>
554+
<translation>Wayland algılandı: nvidia-drm.modeset=1 uygulanıyor...</translation>
555+
</message>
551556
<message>
552557
<location filename="../src/backend/nvidia/installer.cpp" line="531" />
553558
<source>X11 detected: checking NVIDIA userspace packages...</source>
@@ -559,6 +564,34 @@ Yedek Acik Surucu: %6</translation>
559564
<translation>X11 NVIDIA paketi kurulamadı: </translation>
560565
</message>
561566
</context>
567+
<context>
568+
<name>LanguageManager</name>
569+
<message>
570+
<location filename="../src/backend/system/languagemanager.cpp" line="28" />
571+
<source>System Default</source>
572+
<translation>Sistem Varsayilani</translation>
573+
</message>
574+
<message>
575+
<location filename="../src/backend/system/languagemanager.cpp" line="31" />
576+
<source>English</source>
577+
<translation>Ingilizce</translation>
578+
</message>
579+
<message>
580+
<location filename="../src/backend/system/languagemanager.cpp" line="34" />
581+
<source>German</source>
582+
<translation>Almanca</translation>
583+
</message>
584+
<message>
585+
<location filename="../src/backend/system/languagemanager.cpp" line="37" />
586+
<source>Spanish</source>
587+
<translation>Ispanyolca</translation>
588+
</message>
589+
<message>
590+
<location filename="../src/backend/system/languagemanager.cpp" line="40" />
591+
<source>Turkish</source>
592+
<translation>Turkce</translation>
593+
</message>
594+
</context>
562595
<context>
563596
<name>NvidiaUpdater</name>
564597
<message>
@@ -705,6 +738,24 @@ Yedek Acik Surucu: %6</translation>
705738
<translation>Seçili sürüm başarıyla uygulandı. Lütfen sistemi yeniden başlatın.</translation>
706739
</message>
707740
</context>
741+
<context>
742+
<name>UiPreferencesManager</name>
743+
<message>
744+
<location filename="../src/backend/system/uipreferencesmanager.cpp" line="20" />
745+
<source>Follow System</source>
746+
<translation>Sistemi Takip Et</translation>
747+
</message>
748+
<message>
749+
<location filename="../src/backend/system/uipreferencesmanager.cpp" line="23" />
750+
<source>Light</source>
751+
<translation>Acik</translation>
752+
</message>
753+
<message>
754+
<location filename="../src/backend/system/uipreferencesmanager.cpp" line="26" />
755+
<source>Dark</source>
756+
<translation>Koyu</translation>
757+
</message>
758+
</context>
708759
<context>
709760
<name>SettingsPage</name>
710761
<message>
@@ -842,4 +893,4 @@ Yedek Acik Surucu: %6</translation>
842893
<translation>ro-Control</translation>
843894
</message>
844895
</context>
845-
</TS>
896+
</TS>

packaging/rpm/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,7 @@ The GitHub release workflow publishes only:
6565
Each architecture job also performs a smoke install with `dnf install` and
6666
verifies that `ro-control --version` matches the tagged release version before
6767
publishing assets.
68+
69+
For non-release artifact builds, use the **RPM Artifacts** GitHub Actions
70+
workflow (`.github/workflows/rpm-artifacts.yml`). It builds `.rpm` outputs for
71+
both `x86_64` and `aarch64` and uploads them as workflow artifacts.

src/backend/nvidia/installer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ bool NvidiaInstaller::applySessionSpecificSetup(CommandRunner &runner,
540540
QString *errorMessage) {
541541
if (sessionType == QStringLiteral("wayland")) {
542542
emit progressMessage(
543-
QStringLiteral("Wayland detected: applying nvidia-drm.modeset=1..."));
543+
tr("Wayland detected: applying nvidia-drm.modeset=1..."));
544544

545545
const auto result =
546546
runner.runAsRoot(QStringLiteral("grubby"),

src/backend/system/languagemanager.cpp

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,37 @@ namespace {
1111

1212
struct LanguageEntry {
1313
const char *code;
14-
const char *label;
1514
const char *nativeLabel;
1615
bool shipped;
1716
};
1817

1918
constexpr LanguageEntry kSupportedLanguages[] = {
20-
{"system", "System Default", "System Default", true},
21-
{"en", "English", "English", true},
22-
{"de", "German", "Deutsch", false},
23-
{"es", "Spanish", "Espanol", false},
24-
{"tr", "Turkish", "Turkce", true},
19+
{"system", "System Default", true},
20+
{"en", "English", true},
21+
{"de", "Deutsch", false},
22+
{"es", "Espanol", false},
23+
{"tr", "Turkce", true},
2524
};
2625

26+
QString localizedLanguageLabel(const QString &code) {
27+
if (code == QStringLiteral("system")) {
28+
return QCoreApplication::translate("LanguageManager", "System Default");
29+
}
30+
if (code == QStringLiteral("en")) {
31+
return QCoreApplication::translate("LanguageManager", "English");
32+
}
33+
if (code == QStringLiteral("de")) {
34+
return QCoreApplication::translate("LanguageManager", "German");
35+
}
36+
if (code == QStringLiteral("es")) {
37+
return QCoreApplication::translate("LanguageManager", "Spanish");
38+
}
39+
if (code == QStringLiteral("tr")) {
40+
return QCoreApplication::translate("LanguageManager", "Turkish");
41+
}
42+
return code;
43+
}
44+
2745
bool isShippedLanguage(const QString &languageCode) {
2846
for (const auto &entry : kSupportedLanguages) {
2947
if (QString::fromLatin1(entry.code) == languageCode) {
@@ -71,9 +89,10 @@ QVariantList LanguageManager::availableLanguages() const {
7189
continue;
7290
}
7391

92+
const QString code = QString::fromLatin1(entry.code);
7493
QVariantMap language;
75-
language.insert(QStringLiteral("code"), QString::fromLatin1(entry.code));
76-
language.insert(QStringLiteral("label"), QString::fromLatin1(entry.label));
94+
language.insert(QStringLiteral("code"), code);
95+
language.insert(QStringLiteral("label"), localizedLanguageLabel(code));
7796
language.insert(QStringLiteral("nativeLabel"),
7897
QString::fromLatin1(entry.nativeLabel));
7998
language.insert(QStringLiteral("shipped"), entry.shipped);

src/backend/system/uipreferencesmanager.cpp

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,27 @@ namespace {
77

88
struct ThemeModeEntry {
99
const char *code;
10-
const char *label;
1110
};
1211

1312
constexpr ThemeModeEntry kThemeModes[] = {
14-
{"system", "Follow System"},
15-
{"light", "Light"},
16-
{"dark", "Dark"},
13+
{"system"},
14+
{"light"},
15+
{"dark"},
1716
};
1817

18+
QString themeModeLabel(const QString &code) {
19+
if (code == QStringLiteral("system")) {
20+
return QCoreApplication::translate("UiPreferencesManager", "Follow System");
21+
}
22+
if (code == QStringLiteral("light")) {
23+
return QCoreApplication::translate("UiPreferencesManager", "Light");
24+
}
25+
if (code == QStringLiteral("dark")) {
26+
return QCoreApplication::translate("UiPreferencesManager", "Dark");
27+
}
28+
return code;
29+
}
30+
1931
} // namespace
2032

2133
UiPreferencesManager::UiPreferencesManager(QObject *parent) : QObject(parent) {
@@ -34,11 +46,10 @@ QString UiPreferencesManager::themeMode() const { return m_themeMode; }
3446
QVariantList UiPreferencesManager::availableThemeModes() const {
3547
QVariantList modes;
3648
for (const auto &entry : kThemeModes) {
49+
const QString code = QString::fromLatin1(entry.code);
3750
QVariantMap mode;
38-
mode.insert(QStringLiteral("code"), QString::fromLatin1(entry.code));
39-
mode.insert(
40-
QStringLiteral("label"),
41-
QCoreApplication::translate("UiPreferencesManager", entry.label));
51+
mode.insert(QStringLiteral("code"), code);
52+
mode.insert(QStringLiteral("label"), themeModeLabel(code));
4253
modes.append(mode);
4354
}
4455
return modes;

src/qml/pages/DriverPage.qml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ Item {
190190
id: eulaAccept
191191
visible: nvidiaInstaller.proprietaryAgreementRequired
192192
text: qsTr("I reviewed the NVIDIA license terms")
193+
palette.text: page.textColor
193194
}
194195

195196
GridLayout {
@@ -307,6 +308,8 @@ Item {
307308
Layout.fillWidth: true
308309
model: nvidiaUpdater.availableVersions
309310
enabled: model.length > 0
311+
palette.text: page.textColor
312+
palette.buttonText: page.textColor
310313
}
311314

312315
Button {

0 commit comments

Comments
 (0)