From a372b67edb496e9e55b5407188d56206a3b5efd9 Mon Sep 17 00:00:00 2001 From: Levi Date: Thu, 23 Jan 2025 12:45:44 +0800 Subject: [PATCH] ci: fix linux package (#882) --- .github/workflows/build.yml | 37 ++++++++++++++++--- .github/workflows/test.yml | 8 ++-- ui/flutter/linux/CMakeLists.txt | 2 +- .../linux/assets/com.gopeed.Gopeed.desktop | 4 +- 4 files changed, 38 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 29623f42..6ac9c69b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -215,7 +215,7 @@ jobs: overwrite: true build-linux: if: ${{ github.event.inputs.platform == 'all' || github.event.inputs.platform == 'linux' }} - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 needs: [get-release] steps: - uses: actions/checkout@v3 @@ -282,11 +282,12 @@ jobs: description: High speed downloader that supports all platforms. confinement: strict - base: core22 + base: core24 grade: stable - architectures: - - build-on: amd64 + platforms: + amd64: + build-on: amd64 build-for: amd64 slots: @@ -297,13 +298,14 @@ jobs: apps: gopeed: + command-chain: + - bin/gpu-2404-wrapper command: bin/gopeed extensions: [gnome] + common-id: com.gopeed.Gopeed plugs: - network - home - slots: - - dbus-gopeed parts: flutter-git: source: https://github.com/flutter/flutter.git @@ -346,6 +348,29 @@ jobs: flutter build linux --release -v mkdir -p \$CRAFT_PART_INSTALL/bin/ cp -r build/linux/*/release/bundle/* \$CRAFT_PART_INSTALL/bin/ + gpu-2404: + after: [gopeed] + source: https://github.com/canonical/gpu-snap.git + plugin: dump + override-prime: | + craftctl default + \${CRAFT_PART_SRC}/bin/gpu-2404-cleanup mesa-2404 + prime: + - bin/gpu-2404-wrapper + + plugs: + gpu-2404: + interface: content + target: \$SNAP/gpu-2404 + default-provider: mesa-2404 + + layout: + /usr/share/libdrm: + bind: \$SNAP/gpu-2404/libdrm + /usr/share/drirc.d: + symlink: \$SNAP/gpu-2404/drirc.d + /usr/share/X11/XErrorDB: + symlink: \$SNAP/gpu-2404/X11/XErrorDB EOF cp linux/assets/com.gopeed.Gopeed.desktop snap/gui/gopeed.desktop diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 24698fe7..2cf4410d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -63,7 +63,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ windows-latest, macos-latest, ubuntu-latest ] + os: [ windows-latest, macos-latest, ubuntu-22.04 ] needs: [ test ] steps: - uses: actions/checkout@v3 @@ -73,17 +73,17 @@ jobs: - uses: subosito/flutter-action@v2 with: flutter-version: ${{ env.FLUTTER_VERSION }} - - if: runner.os == 'windows-latest' + - if: runner.os == 'Windows' run: | go build -tags nosqlite -ldflags="-w -s" -buildmode=c-shared -o ui/flutter/windows/libgopeed.dll github.com/GopeedLab/gopeed/bind/desktop cd ui/flutter flutter build windows - - if: runner.os == 'macos-latest' + - if: runner.os == 'macOS' run: | go build -tags nosqlite -ldflags="-w -s" -buildmode=c-shared -o ui/flutter/macos/Frameworks/libgopeed.dylib github.com/GopeedLab/gopeed/bind/desktop cd ui/flutter flutter build macos - - if: runner.os == 'ubuntu-latest' + - if: runner.os == 'Linux' run: | sudo apt-get update -y sudo apt-get install -y ninja-build libgtk-3-dev libayatana-appindicator3-dev diff --git a/ui/flutter/linux/CMakeLists.txt b/ui/flutter/linux/CMakeLists.txt index cf3fcbd1..46b08dd0 100644 --- a/ui/flutter/linux/CMakeLists.txt +++ b/ui/flutter/linux/CMakeLists.txt @@ -7,7 +7,7 @@ project(runner LANGUAGES CXX) set(BINARY_NAME "gopeed") # The unique GTK application identifier for this application. See: # https://wiki.gnome.org/HowDoI/ChooseApplicationID -set(APPLICATION_ID "com.gopeed") +set(APPLICATION_ID "com.gopeed.gopeed") # Explicitly opt in to modern CMake behaviors to avoid warnings with recent # versions of CMake. diff --git a/ui/flutter/linux/assets/com.gopeed.Gopeed.desktop b/ui/flutter/linux/assets/com.gopeed.Gopeed.desktop index b11187a2..42545922 100644 --- a/ui/flutter/linux/assets/com.gopeed.Gopeed.desktop +++ b/ui/flutter/linux/assets/com.gopeed.Gopeed.desktop @@ -3,11 +3,11 @@ Name=Gopeed GenericName=Download Manager GenericName[zh_CN]=下载器 GenericName[zh_TW]=下載器 -Comment=High speed downloader that supports all platforms. +Comment=A modern download manager for all platforms Comment[zh_CN]=支持全平台的高速下载器 Comment[zh_TW]=支持全平臺的高速下載器 Terminal=false -Exec=gopeed +Exec=gopeed %U Icon=com.gopeed.Gopeed Type=Application Categories=Utility;Internet