-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1138 from Gatsik/linux
Provide frozen executable for linux
- Loading branch information
Showing
232 changed files
with
1,188 additions
and
1,001 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,16 +6,17 @@ on: | |
version: | ||
description: 'Release Version' | ||
required: true | ||
env: | ||
UID_VERSION: v4.0.6 | ||
ICE_ADAPTER_VERSION: 3.3.9 | ||
BUILD_VERSION: ${{ github.event.inputs.version }} | ||
|
||
jobs: | ||
release: | ||
build-windows: | ||
environment: deploy | ||
runs-on: windows-latest | ||
env: | ||
UID_VERSION: v4.0.6 | ||
ICE_ADAPTER_VERSION: 3.3.9 | ||
BUILD_VERSION: ${{ github.event.inputs.version }} | ||
|
||
outputs: | ||
MSI_SUM: ${{ steps.checksum.outputs.MSI_SUM }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
|
@@ -28,20 +29,28 @@ jobs: | |
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install -r requirements.txt | ||
python -m pip install -r win_requirements.txt | ||
- name: Test with pytest | ||
run: | | ||
python runtests.py -vv --full-trace | ||
- name: Download ICE adapter and UID calculator | ||
run: | | ||
mkdir build_setup\ice-adapter | ||
Invoke-WebRequest -Uri "https://github.com/FAForever/uid/releases/download/$($env:UID_VERSION)/faf-uid.exe" -OutFile ".\\build_setup\\faf-uid.exe" | ||
Invoke-WebRequest -Uri "https://content.faforever.com/build/jre/windows-amd64-21.0.1.tar.gz" -OutFile ".\\windows-amd64-15.0.1.tar.gz" | ||
7z x windows-amd64-15.0.1.tar.gz | ||
7z x windows-amd64-15.0.1.tar -obuild_setup/ice-adapter/jre | ||
Invoke-WebRequest -Uri "https://github.com/FAForever/java-ice-adapter/releases/download/$($env:ICE_ADAPTER_VERSION)/faf-ice-adapter-$($env:ICE_ADAPTER_VERSION)-win.jar" -OutFile ".\\build_setup\\ice-adapter\\faf-ice-adapter.jar" | ||
- name: Test with pytest | ||
- name: Download JDK and create JRE | ||
run: | | ||
python runtests.py -vv --full-trace | ||
Invoke-WebRequest -Uri "https://download.oracle.com/java/21/latest/jdk-21_windows-x64_bin.zip" -OutFile ".\\windows-jdk.zip" | ||
7z x windows-jdk.zip -ojdk | ||
pushd jdk | ||
mv $(ls) jdk | ||
popd | ||
$ICE_ADAPTER_JAVA_MODULES=((jdk/jdk/bin/jdeps.exe -s "build_setup/ice-adapter/faf-ice-adapter.jar" | findstr "java" | ForEach-Object { $_.split(" ")[2] }) -join ",") | ||
jdk/jdk/bin/jlink.exe --add-modules "$ICE_ADAPTER_JAVA_MODULES,jdk.crypto.ec,jdk.unsupported" --strip-debug --no-man-pages --no-header-files --compress "zip-6" --output "build_setup/ice-adapter/jre" | ||
- name: Build application | ||
run: | | ||
|
@@ -52,15 +61,117 @@ jobs: | |
run: | | ||
$MSI_SUM = $(Get-FileHash dist/*).hash | ||
Write-Host $MSI_SUM | ||
echo "MSI_SUM=$MSI_SUM" >> "$env:GITHUB_ENV" | ||
echo "MSI_SUM=$MSI_SUM" >> "$env:GITHUB_OUTPUT" | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: client-windows | ||
path: dist/* | ||
|
||
build-linux: | ||
runs-on: ubuntu-latest | ||
environment: release | ||
outputs: | ||
TAR_SUM: ${{ steps.checksum.outputs.TAR_SUM }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.12 | ||
cache: pip | ||
|
||
- name: Install dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install --no-install-recommends -y \ | ||
libxkbcommon-x11-0 \ | ||
x11-utils \ | ||
libyaml-dev \ | ||
libegl1-mesa \ | ||
libxcb-icccm4 \ | ||
libxcb-image0 \ | ||
libxcb-keysyms1 \ | ||
libxcb-randr0 \ | ||
libxcb-render-util0 \ | ||
libxcb-xinerama0 \ | ||
libopengl0 \ | ||
libxcb-cursor0 \ | ||
pulseaudio | ||
python -m pip install --upgrade pip | ||
python -m pip install -r requirements.txt | ||
python -m pip install pytest-xvfb | ||
- name: Test with pytest | ||
run: | | ||
python runtests.py -vv --full-trace | ||
- name: Download ICE adapter and UID calculator | ||
run: | | ||
mkdir -p build_setup/ice-adapter | ||
wget -O build_setup/faf-uid "https://github.com/FAForever/uid/releases/download/$UID_VERSION/faf-uid" | ||
chmod +x build_setup/faf-uid | ||
wget "https://github.com//FAForever/java-ice-adapter/releases/download/$ICE_ADAPTER_VERSION/faf-ice-adapter-$ICE_ADAPTER_VERSION-win.jar" -O "build_setup/ice-adapter/faf-ice-adapter.jar" | ||
- name: Download JDK and create JRE | ||
run: | | ||
wget -O "jdk.tar.gz" "https://download.oracle.com/java/21/latest/jdk-21_linux-x64_bin.tar.gz" | ||
mkdir jdk | ||
tar -xzvf jdk.tar.gz -C jdk --strip-components=1 | ||
ICE_ADAPTER_JAVA_MODULES=$(jdk/bin/jdeps -s build_setup/ice-adapter/faf-ice-adapter.jar | cut -d' ' -f 3 | grep java | xargs echo | tr ' ' ',') | ||
jdk/bin/jlink --add-modules "$ICE_ADAPTER_JAVA_MODULES,jdk.crypto.ec,jdk.unsupported" --strip-debug --no-man-pages --no-header-files --compress "zip-6" --output "build_setup/ice-adapter/jre" | ||
- name: Build application | ||
run: | | ||
python3 setup.py build | ||
python3 post_setup.py | ||
tar -C "build" -cvzf "faforever.tar.gz" "faf_python_client" | ||
- name: Calculate checksum | ||
id: checksum | ||
run: | | ||
TAR_SUM=$(echo faforever.tar.gz -n | sha256sum) | ||
echo $TAR_SUM | ||
echo "TAR_SUM=$TAR_SUM" >> "$GITHUB_OUTPUT" | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: client-linux | ||
path: faforever.tar.gz | ||
|
||
create-release: | ||
needs: [build-windows, build-linux] | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Download Windows artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: client-windows | ||
path: release-artifacts/ | ||
|
||
- name: Download Linux artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: client-linux | ||
path: release-artifacts/ | ||
|
||
- name: Create draft release | ||
id: create_release | ||
uses: ncipollo/[email protected] | ||
with: | ||
commit: ${{ github.sha }} | ||
tag: ${{ github.event.inputs.version }} | ||
body: "SHA256: ${{ env.MSI_SUM }}" | ||
body: "SHA256 (Windows): ${{ needs.build-windows.outputs.MSI_SUM }}\nSHA256 (Linux): ${{ needs.build-linux.outputs.TAR_SUM }}" | ||
draft: true | ||
prerelease: true | ||
artifacts: dist/* | ||
artifacts: "release-artifacts/*" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import pathlib | ||
import sys | ||
|
||
|
||
def remove_some_redundant_qt_files() -> None: | ||
current_dir = pathlib.Path(__file__).parent | ||
build_dir = current_dir / "build" | ||
app_dir, = build_dir.iterdir() | ||
app_qt6 = app_dir / "lib" / "PyQt6" / "Qt6" | ||
|
||
# cx_Freeze copies these into lib directory itself | ||
# and into every plugin directory for some reason | ||
libfiles = [file.name for file in (app_qt6 / "lib").iterdir()] | ||
|
||
# not all of them, but the most obvious and largest ones | ||
redundant_plugins_files = [ | ||
"libffmpegmediaplugin.so", | ||
"libQt6Pdf.so.6", | ||
"libQt6Qml.so.6", | ||
"libQt6QmlModels.so.6", | ||
"libQt6Quick.so.6", | ||
] | ||
|
||
plugins_dir = app_qt6 / "plugins" | ||
for plugin in plugins_dir.iterdir(): | ||
for file in plugin.iterdir(): | ||
if file.name in libfiles + redundant_plugins_files: | ||
print(f"Removing {file}...") | ||
file.unlink() | ||
|
||
|
||
def main() -> None: | ||
if sys.platform == "win32": | ||
return | ||
remove_some_redundant_qt_files() | ||
|
||
|
||
if __name__ == "__main__": | ||
raise SystemExit(main()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,5 @@ pytest | |
pytest-cov | ||
pytest-mock | ||
pytest-qt | ||
pywin32 | ||
semantic_version | ||
zstandard |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.