feat: linux arm support
This commit is contained in:
+141
-18
@@ -402,11 +402,9 @@ jobs:
|
||||
name: windows-installer
|
||||
path: plezy-windows-installer.exe
|
||||
|
||||
build-linux:
|
||||
build-linux-x64:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
id-token: write
|
||||
attestations: write
|
||||
contents: read
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
@@ -429,45 +427,169 @@ jobs:
|
||||
- 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 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
|
||||
|
||||
- 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 ruby ruby-dev rubygems build-essential rpm libarchive-tools imagemagick
|
||||
|
||||
- name: Install fpm
|
||||
run: sudo gem install fpm
|
||||
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
|
||||
- name: Build Linux x64
|
||||
run: flutter build linux --release --dart-define=ENABLE_UPDATE_CHECK=true
|
||||
|
||||
- name: Create Archive
|
||||
- name: Create tarball
|
||||
run: |
|
||||
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
|
||||
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
|
||||
uses: actions/attest-build-provenance@v2
|
||||
with:
|
||||
subject-path: |
|
||||
plezy-linux.tar.gz
|
||||
plezy-linux-x64.tar.gz
|
||||
plezy-linux-arm64.tar.gz
|
||||
plezy-linux.deb
|
||||
plezy-linux.rpm
|
||||
plezy-linux.pkg.tar.zst
|
||||
|
||||
- name: Upload Linux App
|
||||
- name: Upload Linux tarballs
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: linux-app
|
||||
path: plezy-linux.tar.gz
|
||||
name: linux-tarballs
|
||||
path: |
|
||||
plezy-linux-x64.tar.gz
|
||||
plezy-linux-arm64.tar.gz
|
||||
|
||||
- name: Upload Linux Packages
|
||||
uses: actions/upload-artifact@v4
|
||||
@@ -479,7 +601,7 @@ jobs:
|
||||
plezy-linux.pkg.tar.zst
|
||||
|
||||
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
|
||||
permissions:
|
||||
contents: write
|
||||
@@ -504,7 +626,8 @@ jobs:
|
||||
artifacts/windows-x64-portable/plezy-windows-x64-portable.7z
|
||||
artifacts/windows-arm64-portable/plezy-windows-arm64-portable.7z
|
||||
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/*
|
||||
draft: true
|
||||
prerelease: false
|
||||
|
||||
@@ -8,9 +8,12 @@ from pathlib import Path
|
||||
# Paths
|
||||
SCRIPT_DIR = Path(__file__).parent.resolve()
|
||||
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))
|
||||
|
||||
# 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
|
||||
METADATA = {
|
||||
"name": "plezy",
|
||||
@@ -28,7 +31,7 @@ ICON_SIZES = [16, 32, 48, 64, 128, 256, 512]
|
||||
DISTROS = {
|
||||
"deb": {
|
||||
"type": "deb",
|
||||
"arch": "amd64",
|
||||
"arch": "all",
|
||||
"category": "video",
|
||||
"ext": "deb",
|
||||
"compression": ["--deb-compression", "xz", "--deb-priority", "optional"],
|
||||
@@ -43,7 +46,7 @@ DISTROS = {
|
||||
},
|
||||
"rpm": {
|
||||
"type": "rpm",
|
||||
"arch": "x86_64",
|
||||
"arch": "noarch",
|
||||
"category": "Multimedia",
|
||||
"ext": "rpm",
|
||||
"compression": ["--rpm-compression", "xzmt"],
|
||||
@@ -58,7 +61,7 @@ DISTROS = {
|
||||
},
|
||||
"pacman": {
|
||||
"type": "pacman",
|
||||
"arch": "x86_64",
|
||||
"arch": "any",
|
||||
"category": None,
|
||||
"ext": "pkg.tar.zst",
|
||||
"compression": ["--pacman-compression", "zstd"],
|
||||
@@ -106,11 +109,18 @@ def generate_icons():
|
||||
|
||||
def get_file_mappings() -> list[str]:
|
||||
"""Get file mappings for fpm."""
|
||||
mappings = [
|
||||
f"{BUILD_DIR}/=/opt/plezy/",
|
||||
mappings = []
|
||||
|
||||
# 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}/plezy.sh=/usr/bin/plezy",
|
||||
]
|
||||
])
|
||||
|
||||
for size in ICON_SIZES:
|
||||
mappings.append(
|
||||
@@ -163,12 +173,22 @@ def build_package(distro: str, version: str):
|
||||
|
||||
|
||||
def main():
|
||||
# Verify build exists
|
||||
if not BUILD_DIR.exists():
|
||||
print(f"Error: Build directory not found at {BUILD_DIR}")
|
||||
print("Please run 'flutter build linux --release' first")
|
||||
# Verify at least one build exists
|
||||
has_x64 = X64_BUILD_DIR.exists()
|
||||
has_arm64 = ARM64_BUILD_DIR.exists()
|
||||
|
||||
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)
|
||||
|
||||
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()
|
||||
print(f"Building packages for {METADATA['name']} version {version}")
|
||||
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
#!/bin/bash
|
||||
cd /opt/plezy
|
||||
exec ./plezy "$@"
|
||||
ARCH=$(uname -m)
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user