feat: linux arm support

This commit is contained in:
edde746
2026-02-08 16:39:56 +01:00
parent 3459c9f59d
commit 7ffd0e53ce
3 changed files with 178 additions and 31 deletions
+141 -18
View File
@@ -402,11 +402,9 @@ jobs:
name: windows-installer name: windows-installer
path: plezy-windows-installer.exe path: plezy-windows-installer.exe
build-linux: build-linux-x64:
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions: permissions:
id-token: write
attestations: write
contents: read contents: read
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
@@ -429,45 +427,169 @@ jobs:
- name: Cache APT packages - name: Cache APT packages
uses: awalsh128/cache-apt-pkgs-action@latest uses: awalsh128/cache-apt-pkgs-action@latest
with: with:
packages: clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev libstdc++-12-dev libasound2-dev libmpv-dev mpv ruby ruby-dev rubygems build-essential rpm libarchive-tools imagemagick packages: clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev libstdc++-12-dev libasound2-dev libmpv-dev mpv
version: 1.1 version: 1.1
- name: Install Linux dependencies - name: Install Linux dependencies
run: | run: |
sudo apt-get update sudo apt-get update
sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev libstdc++-12-dev libasound2-dev libmpv-dev mpv ruby ruby-dev rubygems build-essential rpm libarchive-tools imagemagick sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev libstdc++-12-dev libasound2-dev libmpv-dev mpv
- name: Install fpm
run: sudo gem install fpm
- name: Install dependencies - name: Install dependencies
run: flutter pub get run: flutter pub get
- name: Build Linux - name: Build Linux x64
run: flutter build linux --release --dart-define=ENABLE_UPDATE_CHECK=true run: flutter build linux --release --dart-define=ENABLE_UPDATE_CHECK=true
- name: Create Archive - name: Create tarball
run: | run: |
cd build/linux/x64/release/bundle cd build/linux/x64/release/bundle
tar -czf $GITHUB_WORKSPACE/plezy-linux.tar.gz * tar -czf $GITHUB_WORKSPACE/plezy-linux-x64.tar.gz *
- name: Upload x64 build
uses: actions/upload-artifact@v4
with:
name: linux-x64-build
path: build/linux/x64/release/bundle/
- name: Upload x64 tarball
uses: actions/upload-artifact@v4
with:
name: linux-x64-tarball
path: plezy-linux-x64.tar.gz
build-linux-arm64:
runs-on: ubuntu-24.04-arm
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: "master"
cache: true
- name: Cache Pub dependencies
uses: actions/cache@v4
with:
path: |
~/.pub-cache
key: ${{ runner.os }}-arm64-pub-${{ hashFiles('**/pubspec.lock') }}
restore-keys: |
${{ runner.os }}-arm64-pub-
- name: Cache APT packages
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev libstdc++-12-dev libasound2-dev libmpv-dev mpv
version: 1.1
- name: Install Linux dependencies
run: |
sudo apt-get update
sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev libstdc++-12-dev libasound2-dev libmpv-dev mpv
- name: Install dependencies
run: flutter pub get
- name: Build Linux arm64
run: flutter build linux --release --dart-define=ENABLE_UPDATE_CHECK=true
- name: Find bundle directory
id: find-bundle
run: |
BUNDLE_DIR=$(find build/linux -path "*/release/bundle" -type d | head -1)
echo "bundle_dir=$BUNDLE_DIR" >> $GITHUB_OUTPUT
- name: Create tarball
run: |
cd ${{ steps.find-bundle.outputs.bundle_dir }}
tar -czf $GITHUB_WORKSPACE/plezy-linux-arm64.tar.gz *
- name: Upload arm64 build
uses: actions/upload-artifact@v4
with:
name: linux-arm64-build
path: ${{ steps.find-bundle.outputs.bundle_dir }}/
- name: Upload arm64 tarball
uses: actions/upload-artifact@v4
with:
name: linux-arm64-tarball
path: plezy-linux-arm64.tar.gz
package-linux:
needs: [build-linux-x64, build-linux-arm64]
runs-on: ubuntu-latest
permissions:
id-token: write
attestations: write
contents: read
steps:
- uses: actions/checkout@v4
- name: Download x64 build
uses: actions/download-artifact@v4
with:
name: linux-x64-build
path: build-x64
- name: Download arm64 build
uses: actions/download-artifact@v4
with:
name: linux-arm64-build
path: build-arm64
- name: Download x64 tarball
uses: actions/download-artifact@v4
with:
name: linux-x64-tarball
- name: Download arm64 tarball
uses: actions/download-artifact@v4
with:
name: linux-arm64-tarball
- name: Cache APT packages
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: ruby ruby-dev rubygems build-essential rpm libarchive-tools imagemagick
version: 1.1
- name: Install packaging dependencies
run: |
sudo apt-get update
sudo apt-get install -y ruby ruby-dev rubygems build-essential rpm libarchive-tools imagemagick
- name: Install fpm
run: sudo gem install fpm
- name: Build Linux Packages - name: Build Linux Packages
run: OUTPUT_DIR=$GITHUB_WORKSPACE python3 linux/packaging/build-packages.py run: |
X64_BUILD_DIR=$GITHUB_WORKSPACE/build-x64 \
ARM64_BUILD_DIR=$GITHUB_WORKSPACE/build-arm64 \
OUTPUT_DIR=$GITHUB_WORKSPACE \
python3 linux/packaging/build-packages.py
- name: Attest Linux artifacts - name: Attest Linux artifacts
uses: actions/attest-build-provenance@v2 uses: actions/attest-build-provenance@v2
with: with:
subject-path: | subject-path: |
plezy-linux.tar.gz plezy-linux-x64.tar.gz
plezy-linux-arm64.tar.gz
plezy-linux.deb plezy-linux.deb
plezy-linux.rpm plezy-linux.rpm
plezy-linux.pkg.tar.zst plezy-linux.pkg.tar.zst
- name: Upload Linux App - name: Upload Linux tarballs
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: linux-app name: linux-tarballs
path: plezy-linux.tar.gz path: |
plezy-linux-x64.tar.gz
plezy-linux-arm64.tar.gz
- name: Upload Linux Packages - name: Upload Linux Packages
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
@@ -479,7 +601,7 @@ jobs:
plezy-linux.pkg.tar.zst plezy-linux.pkg.tar.zst
create-release: create-release:
needs: [build-android, build-ios, build-macos, package-windows, build-linux] needs: [build-android, build-ios, build-macos, package-windows, package-linux]
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions: permissions:
contents: write contents: write
@@ -504,7 +626,8 @@ jobs:
artifacts/windows-x64-portable/plezy-windows-x64-portable.7z artifacts/windows-x64-portable/plezy-windows-x64-portable.7z
artifacts/windows-arm64-portable/plezy-windows-arm64-portable.7z artifacts/windows-arm64-portable/plezy-windows-arm64-portable.7z
artifacts/windows-installer/plezy-windows-installer.exe artifacts/windows-installer/plezy-windows-installer.exe
artifacts/linux-app/plezy-linux.tar.gz artifacts/linux-tarballs/plezy-linux-x64.tar.gz
artifacts/linux-tarballs/plezy-linux-arm64.tar.gz
artifacts/linux-packages/* artifacts/linux-packages/*
draft: true draft: true
prerelease: false prerelease: false
+31 -11
View File
@@ -8,9 +8,12 @@ from pathlib import Path
# Paths # Paths
SCRIPT_DIR = Path(__file__).parent.resolve() SCRIPT_DIR = Path(__file__).parent.resolve()
PROJECT_ROOT = SCRIPT_DIR.parent.parent PROJECT_ROOT = SCRIPT_DIR.parent.parent
BUILD_DIR = PROJECT_ROOT / "build/linux/x64/release/bundle"
OUTPUT_DIR = Path(os.environ.get("OUTPUT_DIR", PROJECT_ROOT)) OUTPUT_DIR = Path(os.environ.get("OUTPUT_DIR", PROJECT_ROOT))
# Build directories: use env vars if set, otherwise fall back to default Flutter paths
X64_BUILD_DIR = Path(os.environ["X64_BUILD_DIR"]) if "X64_BUILD_DIR" in os.environ else PROJECT_ROOT / "build/linux/x64/release/bundle"
ARM64_BUILD_DIR = Path(os.environ["ARM64_BUILD_DIR"]) if "ARM64_BUILD_DIR" in os.environ else PROJECT_ROOT / "build/linux/arm64/release/bundle"
# Package metadata # Package metadata
METADATA = { METADATA = {
"name": "plezy", "name": "plezy",
@@ -28,7 +31,7 @@ ICON_SIZES = [16, 32, 48, 64, 128, 256, 512]
DISTROS = { DISTROS = {
"deb": { "deb": {
"type": "deb", "type": "deb",
"arch": "amd64", "arch": "all",
"category": "video", "category": "video",
"ext": "deb", "ext": "deb",
"compression": ["--deb-compression", "xz", "--deb-priority", "optional"], "compression": ["--deb-compression", "xz", "--deb-priority", "optional"],
@@ -43,7 +46,7 @@ DISTROS = {
}, },
"rpm": { "rpm": {
"type": "rpm", "type": "rpm",
"arch": "x86_64", "arch": "noarch",
"category": "Multimedia", "category": "Multimedia",
"ext": "rpm", "ext": "rpm",
"compression": ["--rpm-compression", "xzmt"], "compression": ["--rpm-compression", "xzmt"],
@@ -58,7 +61,7 @@ DISTROS = {
}, },
"pacman": { "pacman": {
"type": "pacman", "type": "pacman",
"arch": "x86_64", "arch": "any",
"category": None, "category": None,
"ext": "pkg.tar.zst", "ext": "pkg.tar.zst",
"compression": ["--pacman-compression", "zstd"], "compression": ["--pacman-compression", "zstd"],
@@ -106,11 +109,18 @@ def generate_icons():
def get_file_mappings() -> list[str]: def get_file_mappings() -> list[str]:
"""Get file mappings for fpm.""" """Get file mappings for fpm."""
mappings = [ mappings = []
f"{BUILD_DIR}/=/opt/plezy/",
# Map each available architecture bundle
if X64_BUILD_DIR.exists():
mappings.append(f"{X64_BUILD_DIR}/=/opt/plezy/x64/")
if ARM64_BUILD_DIR.exists():
mappings.append(f"{ARM64_BUILD_DIR}/=/opt/plezy/arm64/")
mappings.extend([
f"{SCRIPT_DIR}/com.edde746.plezy.desktop=/usr/share/applications/com.edde746.plezy.desktop", f"{SCRIPT_DIR}/com.edde746.plezy.desktop=/usr/share/applications/com.edde746.plezy.desktop",
f"{SCRIPT_DIR}/plezy.sh=/usr/bin/plezy", f"{SCRIPT_DIR}/plezy.sh=/usr/bin/plezy",
] ])
for size in ICON_SIZES: for size in ICON_SIZES:
mappings.append( mappings.append(
@@ -163,12 +173,22 @@ def build_package(distro: str, version: str):
def main(): def main():
# Verify build exists # Verify at least one build exists
if not BUILD_DIR.exists(): has_x64 = X64_BUILD_DIR.exists()
print(f"Error: Build directory not found at {BUILD_DIR}") has_arm64 = ARM64_BUILD_DIR.exists()
print("Please run 'flutter build linux --release' first")
if not has_x64 and not has_arm64:
print(f"Error: No build directories found")
print(f" x64: {X64_BUILD_DIR}")
print(f" arm64: {ARM64_BUILD_DIR}")
print("Please run 'flutter build linux --release' first or set X64_BUILD_DIR/ARM64_BUILD_DIR")
exit(1) exit(1)
if has_x64:
print(f"Found x64 build: {X64_BUILD_DIR}")
if has_arm64:
print(f"Found arm64 build: {ARM64_BUILD_DIR}")
version = get_version() version = get_version()
print(f"Building packages for {METADATA['name']} version {version}") print(f"Building packages for {METADATA['name']} version {version}")
+6 -2
View File
@@ -1,3 +1,7 @@
#!/bin/bash #!/bin/bash
cd /opt/plezy ARCH=$(uname -m)
exec ./plezy "$@" case "$ARCH" in
x86_64) cd /opt/plezy/x64 && exec ./plezy "$@" ;;
aarch64) cd /opt/plezy/arm64 && exec ./plezy "$@" ;;
*) echo "Unsupported architecture: $ARCH" >&2; exit 1 ;;
esac