Skip to content

Commit f05a3da

Browse files
committed
Merge branch 'master' into qt6
2 parents 81fd5e2 + 386e7ba commit f05a3da

148 files changed

Lines changed: 268811 additions & 6019 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.codex

Whitespace-only changes.

.github/workflows/main.yml

Lines changed: 48 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@ env:
44
DISPLAY: ':99'
55
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
66

7-
# Controls when the action will run. Triggers the workflow on push or pull request
8-
# events but only for the master branch
7+
# Controls when the action will run. Triggers the workflow on push, pull request,
8+
# scheduled nightly, or manual workflow dispatch events.
99
on:
1010
workflow_dispatch:
1111
push:
1212
branches: [ master, github-workflow-playground ]
1313
pull_request:
14-
branches: [ master ]
1514
schedule:
1615
- cron: "0 0 * * *"
1716

@@ -127,6 +126,7 @@ jobs:
127126
cd ..
128127
- name: Build
129128
run: |
129+
lrelease src/qdomyos-zwift.pri
130130
qmake
131131
make -j8
132132
cd src/debug
@@ -149,11 +149,12 @@ jobs:
149149
cp ../../adb/* adb/
150150
cd ..
151151
cd appx
152-
#../../MSIX-Toolkit/WindowsSDK/10/10.0.20348.0/x64/makeappx.exe pack /d ../output/ /p qz
152+
#../../MSIX-Toolkit/WindowsSDK/10/10.0.20348.0/x64/makeappx.exe pack /d ../output/ /p qz
153153
if: matrix.config.python
154-
154+
155155
- name: Build without python
156156
run: |
157+
lrelease src/qdomyos-zwift.pri
157158
qmake
158159
make -j8
159160
cd src/debug
@@ -249,7 +250,7 @@ jobs:
249250
# asset_content_type: application/zip
250251

251252
# window-steam-build:
252-
# runs-on: windows-latest
253+
# runs-on: windows-2022
253254
#
254255
# steps:
255256
# - uses: actions/checkout@v2
@@ -701,9 +702,33 @@ jobs:
701702
echo "#define LICENSE" >> secret.h
702703
703704
- name: Prepare Android signing key
705+
env:
706+
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
707+
SIGNING_ALIAS: ${{ secrets.ALIAS }}
708+
KEY_STORE_PASSWORD: ${{ secrets.KEY_STORE_PASSWORD }}
709+
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
704710
run: |
705-
printf '%s' "${{ secrets.SIGNING_KEY }}" | base64 --decode > ${{ github.workspace }}/src/android/ci-signing-key.jks
706-
echo "CI_ANDROID_SIGNING_KEYSTORE=${{ github.workspace }}/src/android/ci-signing-key.jks" >> $GITHUB_ENV
711+
if [ -z "$SIGNING_KEY" ] || [ -z "$SIGNING_ALIAS" ] || [ -z "$KEY_STORE_PASSWORD" ] || [ -z "$KEY_PASSWORD" ]; then
712+
echo "Android signing secrets are not available; APK re-signing will be skipped."
713+
echo "CI_ANDROID_RESIGN_APK=false" >> "$GITHUB_ENV"
714+
exit 0
715+
fi
716+
717+
KEYSTORE="${{ github.workspace }}/src/android/ci-signing-key.jks"
718+
if ! printf '%s' "$SIGNING_KEY" | base64 --decode > "$KEYSTORE"; then
719+
echo "Failed to decode Android signing key."
720+
rm -f "$KEYSTORE"
721+
exit 1
722+
fi
723+
724+
if [ ! -s "$KEYSTORE" ]; then
725+
echo "Decoded Android signing key is empty."
726+
rm -f "$KEYSTORE"
727+
exit 1
728+
fi
729+
730+
echo "CI_ANDROID_SIGNING_KEYSTORE=$KEYSTORE" >> "$GITHUB_ENV"
731+
echo "CI_ANDROID_RESIGN_APK=true" >> "$GITHUB_ENV"
707732
708733
- name: Build qthttpserver for Android
709734
run: |
@@ -714,6 +739,7 @@ jobs:
714739
715740
- name: Build QZ for Android (4 ABIs)
716741
run: |
742+
lrelease src/qdomyos-zwift.pri
717743
qmake -spec android-clang 'ANDROID_ABIS=armeabi-v7a arm64-v8a x86 x86_64' 'ANDROID_NDK_ROOT=/usr/local/lib/android/sdk/ndk/21.4.7075529' && make -j4 && make INSTALL_ROOT=${{ github.workspace }}/output/android/ install
718744
sed -i '1s|{|{\n "android-extra-libs": "${{ github.workspace }}/android_openssl/no-asm/latest/arm/libcrypto_1_1.so,${{ github.workspace }}/android_openssl/no-asm/latest/arm/libssl_1_1.so,${{ github.workspace }}/android_openssl/no-asm/latest/arm64/libcrypto_1_1.so,${{ github.workspace }}/android_openssl/no-asm/latest/arm64/libssl_1_1.so,${{ github.workspace }}/android_openssl/no-asm/latest/x86/libcrypto_1_1.so,${{ github.workspace }}/android_openssl/no-asm/latest/x86/libssl_1_1.so,${{ github.workspace }}/android_openssl/no-asm/latest/x86_64/libcrypto_1_1.so,${{ github.workspace }}/android_openssl/no-asm/latest/x86_64/libssl_1_1.so",|' src/android-qdomyos-zwift-deployment-settings.json
719745
cat src/android-qdomyos-zwift-deployment-settings.json
@@ -733,8 +759,14 @@ jobs:
733759

734760
- name: Re-sign APK for stable App Links fingerprint
735761
run: |
762+
if [ "$CI_ANDROID_RESIGN_APK" != "true" ]; then
763+
echo "Skipping APK re-signing because Android signing secrets are not available."
764+
exit 0
765+
fi
766+
736767
APK_PATH="${{ github.workspace }}/output/android/build/outputs/apk/debug/android-debug.apk"
737768
SIGNED_APK_PATH="${{ github.workspace }}/output/android/build/outputs/apk/debug/android-debug-signed.apk"
769+
trap 'rm -f "$CI_ANDROID_SIGNING_KEYSTORE" "$SIGNED_APK_PATH"' EXIT
738770
APKSIGNER=$(find /usr/local/lib/android/sdk/build-tools -name apksigner | sort | tail -n 1)
739771
if [ -z "$APKSIGNER" ]; then
740772
echo "apksigner not found"
@@ -1129,10 +1161,11 @@ jobs:
11291161

11301162
- name: Build
11311163
Copy-Item -Path ${{ runner.workspace }}\vcpkg\installed\x64-windows\lib\*.* -Destination . -Verbose
1132-
Copy-Item -Path ${{ runner.workspace }}\vcpkg\installed\x64-windows\lib\*.* -Destination src/ -Verbose
1164+
Copy-Item -Path ${{ runner.workspace }}\vcpkg\installed\x64-windows\lib\*.* -Destination src/ -Verbose
11331165
Copy-Item -Path ${{ runner.workspace }}\vcpkg\installed\x64-windows\include\* -Destination src/ -Recurse -Verbose
11341166
run: |
1135-
qmake
1167+
lrelease src/qdomyos-zwift.pri
1168+
qmake
11361169
nmake
11371170
cd src/debug
11381171
mkdir output
@@ -1158,10 +1191,11 @@ jobs:
11581191

11591192
- name: Build without python
11601193
# Copy-Item -Path ${{ runner.workspace }}\vcpkg\installed\x64-windows\lib\*.* -Destination . -Verbose
1161-
# Copy-Item -Path ${{ runner.workspace }}\vcpkg\installed\x64-windows\lib\*.* -Destination src/ -Verbose
1162-
# Copy-Item -Path ${{ runner.workspace }}\vcpkg\installed\x64-windows\include\* -Destination src/ -Recurse -Verbose
1163-
run: |
1164-
qmake
1194+
# Copy-Item -Path ${{ runner.workspace }}\vcpkg\installed\x64-windows\lib\*.* -Destination src/ -Verbose
1195+
# Copy-Item -Path ${{ runner.workspace }}\vcpkg\installed\x64-windows\include\* -Destination src/ -Recurse -Verbose
1196+
run: |
1197+
lrelease src/qdomyos-zwift.pri
1198+
qmake
11651199
nmake
11661200
cd src/debug
11671201
mkdir output
Lines changed: 196 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,196 @@
1+
name: Update Translations
2+
3+
on:
4+
workflow_dispatch: # Manual trigger
5+
schedule:
6+
- cron: '0 0 * * 0' # Weekly on Sunday at midnight
7+
pull_request: # Run on every PR commit for testing
8+
paths:
9+
- 'src/**/*.cpp'
10+
- 'src/**/*.h'
11+
- 'src/**/*.qml'
12+
- 'src/**/*.ui'
13+
- 'src/**/*.ts'
14+
push: # Run on push to PR branches
15+
branches:
16+
- 'claude/**' # All Claude Code branches
17+
- 'translations/**' # Translation-specific branches
18+
19+
jobs:
20+
update-translations:
21+
runs-on: ubuntu-latest
22+
23+
steps:
24+
- name: Checkout repository
25+
uses: actions/checkout@v4
26+
with:
27+
fetch-depth: 0
28+
token: ${{ secrets.GITHUB_TOKEN }}
29+
30+
- name: Install Qt Linguist Tools
31+
run: |
32+
sudo apt-get update
33+
sudo apt-get install -y qtbase5-dev qttools5-dev-tools
34+
35+
- name: Detect workflow context
36+
id: context
37+
run: |
38+
if [ "${{ github.event_name }}" = "pull_request" ] || [ "${{ github.event_name }}" = "push" ]; then
39+
echo "mode=testing" >> $GITHUB_OUTPUT
40+
echo "🧪 Running in TESTING mode (PR/push to branch)"
41+
else
42+
echo "mode=production" >> $GITHUB_OUTPUT
43+
echo "🚀 Running in PRODUCTION mode (scheduled/manual)"
44+
fi
45+
46+
- name: Update translation files
47+
run: |
48+
echo "Extracting translatable strings from source code..."
49+
echo "Updating 30 language files..."
50+
51+
# lupdate will create/update all .ts files defined in TRANSLATIONS
52+
lupdate src/qdomyos-zwift.pri
53+
54+
- name: Compile translation binaries (.qm)
55+
run: |
56+
echo "Compiling .ts files into .qm binaries..."
57+
lrelease src/qdomyos-zwift.pri
58+
59+
- name: Verify generated .qm files
60+
run: |
61+
echo "Checking compiled translation files..."
62+
ls -1 src/translations/*.qm
63+
64+
- name: Check for translation changes
65+
run: |
66+
echo ""
67+
echo "Checking for changes..."
68+
69+
# Check if there are changes in translations folder
70+
if git diff --quiet src/translations/; then
71+
echo "✅ No translation updates needed - files are up to date"
72+
echo "HAS_CHANGES=false" >> $GITHUB_ENV
73+
else
74+
echo "📝 Translation files have been updated with new/modified strings"
75+
echo "HAS_CHANGES=true" >> $GITHUB_ENV
76+
77+
# Show diff stats
78+
echo ""
79+
echo "Changes summary:"
80+
git diff --stat src/translations/
81+
82+
echo ""
83+
echo "Files modified:"
84+
git diff --name-only src/translations/
85+
fi
86+
87+
- name: Commit and push changes (Testing Mode)
88+
if: env.HAS_CHANGES == 'true' && steps.context.outputs.mode == 'testing' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository)
89+
env:
90+
TARGET_BRANCH: ${{ github.head_ref || github.ref_name }}
91+
run: |
92+
git config --local user.email "github-actions[bot]@users.noreply.github.com"
93+
git config --local user.name "github-actions[bot]"
94+
95+
# Commit updated translation source files only
96+
git add src/translations/*.ts
97+
git commit -m "chore: update translation strings [automated]
98+
99+
Automatic update of translatable strings extracted from source code.
100+
Updated 30 language files in src/translations/
101+
102+
- Updated by GitHub Actions (Testing Mode)
103+
- Triggered by: ${{ github.event_name }}
104+
- Date: $(date -u +"%Y-%m-%d %H:%M:%S UTC")"
105+
106+
# Push to remote branch explicitly (works also in detached HEAD on pull_request events)
107+
git push origin HEAD:refs/heads/${TARGET_BRANCH}
108+
109+
echo "✅ Changes committed and pushed to current branch"
110+
111+
- name: Commit and push changes (Production Mode)
112+
if: env.HAS_CHANGES == 'true' && steps.context.outputs.mode == 'production'
113+
run: |
114+
git config --local user.email "github-actions[bot]@users.noreply.github.com"
115+
git config --local user.name "github-actions[bot]"
116+
117+
# Create a new branch for production updates
118+
BRANCH_NAME="translations/auto-update-$(date +%Y%m%d-%H%M%S)"
119+
git checkout -b "$BRANCH_NAME"
120+
121+
# Add updated translation source files only
122+
git add src/translations/*.ts
123+
git commit -m "chore: update translation strings
124+
125+
Automatic update of translatable strings extracted from source code.
126+
Updated 30 language files in src/translations/
127+
128+
- Updated by GitHub Actions (Scheduled)
129+
- Date: $(date -u +"%Y-%m-%d %H:%M:%S UTC")"
130+
131+
# Push the branch
132+
git push origin "$BRANCH_NAME"
133+
134+
# Store branch name for PR creation
135+
echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV
136+
echo "✅ Changes pushed to new branch: $BRANCH_NAME"
137+
138+
- name: Create Pull Request (Production Mode Only)
139+
if: env.HAS_CHANGES == 'true' && steps.context.outputs.mode == 'production'
140+
uses: peter-evans/create-pull-request@v5
141+
with:
142+
token: ${{ secrets.GITHUB_TOKEN }}
143+
branch: ${{ env.BRANCH_NAME }}
144+
title: "🌍 Update translation strings"
145+
body: |
146+
## Translation Update
147+
148+
This PR updates the translation file with new strings extracted from the source code.
149+
150+
### Changes
151+
- Extracted new translatable strings using `lupdate`
152+
- Updated 30 language files in `src/translations/`
153+
- Languages: Italian, German, French, Spanish, Portuguese, Russian, Chinese, Japanese, Korean, Arabic, Hindi, and 19 more
154+
155+
### What to do next
156+
1. Review the new strings in `src/translations/qdomyos-zwift_*.ts`
157+
2. Contributors can now create PRs to add translations in their language
158+
3. Edit the `.ts` file for your language and add translations in `<translation>` tags
159+
4. Merge this PR to make new strings available
160+
161+
### Translation Files
162+
- Location: `src/translations/`
163+
- Format: `qdomyos-zwift_LOCALE.ts` (e.g., `qdomyos-zwift_it.ts` for Italian)
164+
- 30 languages supported
165+
166+
**Note:** Strings marked as `<translation type="unfinished">` need translation.
167+
168+
---
169+
*Generated automatically by GitHub Actions*
170+
labels: |
171+
translations
172+
automation
173+
174+
- name: Summary
175+
if: always()
176+
run: |
177+
echo ""
178+
echo "============================================"
179+
echo "Translation Workflow Summary"
180+
echo "============================================"
181+
echo "Mode: ${{ steps.context.outputs.mode }}"
182+
echo "Event: ${{ github.event_name }}"
183+
echo "Has changes: ${{ env.HAS_CHANGES }}"
184+
echo "============================================"
185+
186+
if [ "${{ env.HAS_CHANGES }}" = "true" ]; then
187+
if [ "${{ steps.context.outputs.mode }}" = "testing" ]; then
188+
echo "✅ Translation files updated in current branch"
189+
echo " Review changes in: src/translations/"
190+
else
191+
echo "✅ Translation files updated and PR created"
192+
echo " Branch: ${{ env.BRANCH_NAME }}"
193+
fi
194+
else
195+
echo "ℹ️ No updates needed - translation files are current"
196+
fi

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,5 @@ src/inner_templates/googlemaps/cesium-key.js
5454
src/inner_templates/googlemaps/cesium-key.js
5555
src/qdomyos-zwift.pro.user.49de507
5656
/.vs
57+
src/translations/*.qm
58+
/tools/__pycache__

0 commit comments

Comments
 (0)