From 135492f93538492911978070896c948109b1d388 Mon Sep 17 00:00:00 2001 From: lincube Date: Fri, 26 Jun 2026 21:45:43 +0800 Subject: [PATCH] =?UTF-8?q?fix.=E6=B7=B1=E5=BA=A6=E8=BF=99=E4=B8=AA?= =?UTF-8?q?=E7=8E=B2=E7=8F=91=E6=80=8E=E4=B9=88=E8=BF=99=E4=B9=88=E9=BA=BB?= =?UTF-8?q?=E7=83=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 33 ++++++++++++++++++++------------ packaging/linglong/linglong.yaml | 26 +++++++++++-------------- 2 files changed, 32 insertions(+), 27 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5fe5c4d..fa3f05f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -630,17 +630,24 @@ jobs: - name: Install Linglong build tools run: | - # Install Linglong builder tools - curl -fsSL https://deepin-community.github.io/linglong-tools/install.sh | bash || { - echo "Warning: Failed to install Linglong tools, skipping Linglong build" + # Add Linglong repository for Ubuntu 24.04 + echo "deb [trusted=yes] https://ci.deepin.com/repo/obs/linglong:/CI:/release/xUbuntu_24.04/ ./" | sudo tee /etc/apt/sources.list.d/linglong.list + sudo apt-get update + + # Install Linglong builder and CLI + sudo apt-get install -y linglong-bin linglong-builder || { + echo "::warning::Failed to install Linglong tools, skipping Linglong build" echo "LINGLONG_AVAILABLE=false" >> $GITHUB_ENV + exit 0 } # Verify installation if command -v ll-builder &> /dev/null; then ll-builder --version + ll-cli --version echo "LINGLONG_AVAILABLE=true" >> $GITHUB_ENV else + echo "::warning::ll-builder not found after installation" echo "LINGLONG_AVAILABLE=false" >> $GITHUB_ENV fi @@ -655,32 +662,32 @@ jobs: mkdir -p "$linglongDir" "$release_dir" # Copy linglong.yaml and update version - cp packaging/linglong/linglong.yaml "$linglongDir/" + cp packaging/linglong/linglong.yaml "$linglongDir/linglong.yaml" sed -i "s/version: .*/version: ${version}/" "$linglongDir/linglong.yaml" # Create project structure for Linglong build - # ll-builder expects the project files in /project inside the container + # ll-builder mounts the project directory to /project inside the container mkdir -p "$linglongDir/publish" cp -r "$publishDir"/* "$linglongDir/publish/" cp -r LanMountainDesktop "$linglongDir/LanMountainDesktop" - # Copy linglong.yaml to the build directory - cp "$linglongDir/linglong.yaml" "$linglongDir/" - # Build using ll-builder cd "$linglongDir" - ll-builder build || { + echo "=== Starting ll-builder build ===" + ll-builder build --skip-output-check || { echo "::warning::Linglong build failed" exit 0 } - # List available refs - ll-builder list + echo "=== Listing available refs ===" + ll-builder list || true # Export the layer + echo "=== Exporting layer ===" # Get the first available ref - REF=$(ll-builder list | head -1 | awk '{print $1}') + REF=$(ll-builder list 2>/dev/null | grep -E "^com\." | head -1 | awk '{print $1}') if [ -n "$REF" ]; then + echo "Exporting ref: $REF" ll-builder export --ref "$REF" || { echo "::warning::Linglong export failed" exit 0 @@ -693,6 +700,8 @@ jobs: echo "✓ Linglong package created: LanMountainDesktop-${version}-linux-x64.layer" else echo "::warning::Linglong layer file not found after export" + # List files for debugging + find . -type f -name "*.layer" -o -name "*.uab" 2>/dev/null || true fi else echo "::warning::No refs available for export" diff --git a/packaging/linglong/linglong.yaml b/packaging/linglong/linglong.yaml index 3a3abbf..4a6d6b4 100644 --- a/packaging/linglong/linglong.yaml +++ b/packaging/linglong/linglong.yaml @@ -25,7 +25,6 @@ build: | mkdir -p $PREFIX/share/applications mkdir -p $PREFIX/share/icons/hicolor/128x128/apps mkdir -p $PREFIX/share/icons/hicolor/256x256/apps - mkdir -p $PREFIX/share/icons/hicolor/scalable/apps # Copy the pre-built application files # The build artifacts should be in /project/publish/linux-x64 @@ -51,19 +50,17 @@ build: | exit 1 fi - # Create desktop file - cat > $PREFIX/share/applications/com.lanmountain.desktop.desktop << EOF - [Desktop Entry] - Type=Application - Version=1.0 - Name=LanMountainDesktop - Comment=LanMountainDesktop desktop shell - Exec=/opt/apps/com.lanmountain.desktop/files/bin/LanMountainDesktop.Launcher %U - Icon=lanmountaindesktop - Terminal=false - Categories=Utility;Education; - StartupWMClass=LanMountainDesktop - EOF + # Create desktop file using printf to avoid heredoc issues in YAML + printf '%s\n' '[Desktop Entry]' > $PREFIX/share/applications/com.lanmountain.desktop.desktop + printf '%s\n' 'Type=Application' >> $PREFIX/share/applications/com.lanmountain.desktop.desktop + printf '%s\n' 'Version=1.0' >> $PREFIX/share/applications/com.lanmountain.desktop.desktop + printf '%s\n' 'Name=LanMountainDesktop' >> $PREFIX/share/applications/com.lanmountain.desktop.desktop + printf '%s\n' 'Comment=LanMountainDesktop desktop shell' >> $PREFIX/share/applications/com.lanmountain.desktop.desktop + printf '%s\n' 'Exec=/opt/apps/com.lanmountain.desktop/files/bin/LanMountainDesktop.Launcher %U' >> $PREFIX/share/applications/com.lanmountain.desktop.desktop + printf '%s\n' 'Icon=lanmountaindesktop' >> $PREFIX/share/applications/com.lanmountain.desktop.desktop + printf '%s\n' 'Terminal=false' >> $PREFIX/share/applications/com.lanmountain.desktop.desktop + printf '%s\n' 'Categories=Utility;Education;' >> $PREFIX/share/applications/com.lanmountain.desktop.desktop + printf '%s\n' 'StartupWMClass=LanMountainDesktop' >> $PREFIX/share/applications/com.lanmountain.desktop.desktop # Copy icon files if [ -f "/project/LanMountainDesktop/packaging/linux/lanmountaindesktop.png" ]; then @@ -75,6 +72,5 @@ build: | # Set executable permissions chmod +x $PREFIX/bin/* - chmod +x $PREFIX/lib/LanMountainDesktop.AirAppRuntime 2>/dev/null || true echo "Linglong build completed successfully"