Skip to content

Commit

Permalink
ci: fix linux package (#882)
Browse files Browse the repository at this point in the history
  • Loading branch information
monkeyWie authored Jan 23, 2025
1 parent 2d86b5c commit a372b67
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 13 deletions.
37 changes: 31 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion ui/flutter/linux/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions ui/flutter/linux/assets/com.gopeed.Gopeed.desktop
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a372b67

Please sign in to comment.