Add Linux desktop Vulkan packages (#9323)
Signed-off-by: jh-block <jhugo@block.xyz>
This commit is contained in:
@@ -4,6 +4,12 @@
|
|||||||
# - canary.yml (when added)
|
# - canary.yml (when added)
|
||||||
# - pr-comment-bundle-desktop.yml (when added)
|
# - pr-comment-bundle-desktop.yml (when added)
|
||||||
on:
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
branch:
|
||||||
|
description: 'Branch name to bundle app from'
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
workflow_call:
|
workflow_call:
|
||||||
inputs:
|
inputs:
|
||||||
version:
|
version:
|
||||||
@@ -20,14 +26,22 @@ name: "Bundle Desktop (Linux)"
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-desktop-linux:
|
build-desktop-linux:
|
||||||
name: Build Desktop (Linux)
|
name: Build Desktop (Linux, ${{ matrix.variant }})
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ${{ matrix.build-on }}
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- variant: standard
|
||||||
|
build-on: ubuntu-22.04
|
||||||
|
- variant: vulkan
|
||||||
|
build-on: ubuntu-24.04
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||||
with:
|
with:
|
||||||
ref: ${{ inputs.ref }}
|
ref: ${{ inputs.ref || inputs.branch }}
|
||||||
|
|
||||||
- name: Update versions
|
- name: Update versions
|
||||||
if: ${{ inputs.version != '' }}
|
if: ${{ inputs.version != '' }}
|
||||||
@@ -72,7 +86,6 @@ jobs:
|
|||||||
libxrandr2 \
|
libxrandr2 \
|
||||||
libgbm1 \
|
libgbm1 \
|
||||||
libxss1 \
|
libxss1 \
|
||||||
libasound2 \
|
|
||||||
rpm \
|
rpm \
|
||||||
fakeroot \
|
fakeroot \
|
||||||
dpkg-dev \
|
dpkg-dev \
|
||||||
@@ -81,6 +94,16 @@ jobs:
|
|||||||
flatpak-builder \
|
flatpak-builder \
|
||||||
elfutils
|
elfutils
|
||||||
|
|
||||||
|
if [ "${{ matrix.variant }}" = "vulkan" ]; then
|
||||||
|
sudo apt-get install -y \
|
||||||
|
libasound2t64 \
|
||||||
|
libvulkan-dev \
|
||||||
|
libvulkan1 \
|
||||||
|
glslc
|
||||||
|
else
|
||||||
|
sudo apt-get install -y libasound2
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Setup Flatpak Runtimes
|
- name: Setup Flatpak Runtimes
|
||||||
run: |
|
run: |
|
||||||
flatpak remote-add --if-not-exists --user flathub https://dl.flathub.org/repo/flathub.flatpakrepo
|
flatpak remote-add --if-not-exists --user flathub https://dl.flathub.org/repo/flathub.flatpakrepo
|
||||||
@@ -94,7 +117,7 @@ jobs:
|
|||||||
- name: Cache Rust dependencies
|
- name: Cache Rust dependencies
|
||||||
uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
|
uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
|
||||||
with:
|
with:
|
||||||
key: linux
|
key: linux-${{ matrix.build-on }}-${{ matrix.variant }}
|
||||||
|
|
||||||
- name: Build goosed binary
|
- name: Build goosed binary
|
||||||
env:
|
env:
|
||||||
@@ -104,7 +127,12 @@ jobs:
|
|||||||
source ./bin/activate-hermit
|
source ./bin/activate-hermit
|
||||||
export TARGET="x86_64-unknown-linux-gnu"
|
export TARGET="x86_64-unknown-linux-gnu"
|
||||||
rustup target add "${TARGET}"
|
rustup target add "${TARGET}"
|
||||||
cargo build --release --target ${TARGET} -p goose-server
|
FEATURE_ARGS=()
|
||||||
|
if [ "${{ matrix.variant }}" = "vulkan" ]; then
|
||||||
|
FEATURE_ARGS=(--features vulkan)
|
||||||
|
fi
|
||||||
|
|
||||||
|
cargo build --release --target ${TARGET} -p goose-server "${FEATURE_ARGS[@]}"
|
||||||
|
|
||||||
- name: Copy binaries into Electron folder
|
- name: Copy binaries into Electron folder
|
||||||
run: |
|
run: |
|
||||||
@@ -134,14 +162,25 @@ jobs:
|
|||||||
ls -la node_modules/.bin/ | head -5
|
ls -la node_modules/.bin/ | head -5
|
||||||
|
|
||||||
- name: Build Linux packages
|
- name: Build Linux packages
|
||||||
|
env:
|
||||||
|
GOOSE_DESKTOP_LINUX_VARIANT: ${{ matrix.variant }}
|
||||||
run: |
|
run: |
|
||||||
source ./bin/activate-hermit
|
source ./bin/activate-hermit
|
||||||
cd ui/desktop
|
cd ui/desktop
|
||||||
echo "Building Linux packages (.deb, .rpm, and .flatpak)..."
|
echo "Building Linux packages (.deb, .rpm, and .flatpak) for ${{ matrix.variant }}..."
|
||||||
|
|
||||||
# Build all configured packages
|
# Build all configured packages
|
||||||
pnpm run make --platform=linux --arch=x64
|
pnpm run make --platform=linux --arch=x64
|
||||||
|
|
||||||
|
if [ "${{ matrix.variant }}" = "vulkan" ]; then
|
||||||
|
for package in out/make/deb/x64/*.deb out/make/rpm/x64/*.rpm out/make/flatpak/x86_64/*.flatpak; do
|
||||||
|
[ -e "$package" ] || continue
|
||||||
|
extension="${package##*.}"
|
||||||
|
base="${package%.*}"
|
||||||
|
mv "$package" "${base}-vulkan.${extension}"
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
echo "Build completed. Checking output..."
|
echo "Build completed. Checking output..."
|
||||||
ls -la out/
|
ls -la out/
|
||||||
find out/ -name "*.deb" -o -name "*.rpm" -o -name "*.flatpak" | head -10
|
find out/ -name "*.deb" -o -name "*.rpm" -o -name "*.flatpak" | head -10
|
||||||
@@ -158,22 +197,49 @@ jobs:
|
|||||||
find ui/desktop/out/ -name "*.deb" -o -name "*.rpm" -o -name "*.flatpak" -exec ls -lh {} \;
|
find ui/desktop/out/ -name "*.deb" -o -name "*.rpm" -o -name "*.flatpak" -exec ls -lh {} \;
|
||||||
|
|
||||||
- name: Upload .deb package
|
- name: Upload .deb package
|
||||||
|
if: matrix.variant == 'standard'
|
||||||
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
|
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
|
||||||
with:
|
with:
|
||||||
name: Goose-linux-x64-deb
|
name: Goose-linux-x64-deb
|
||||||
path: ui/desktop/out/make/deb/x64/*.deb
|
path: ui/desktop/out/make/deb/x64/*.deb
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
|
||||||
|
- name: Upload .deb package (Vulkan)
|
||||||
|
if: matrix.variant == 'vulkan'
|
||||||
|
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
|
||||||
|
with:
|
||||||
|
name: Goose-linux-x64-vulkan-deb
|
||||||
|
path: ui/desktop/out/make/deb/x64/*-vulkan.deb
|
||||||
|
if-no-files-found: error
|
||||||
|
|
||||||
- name: Upload .rpm package
|
- name: Upload .rpm package
|
||||||
|
if: matrix.variant == 'standard'
|
||||||
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
|
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
|
||||||
with:
|
with:
|
||||||
name: Goose-linux-x64-rpm
|
name: Goose-linux-x64-rpm
|
||||||
path: ui/desktop/out/make/rpm/x64/*.rpm
|
path: ui/desktop/out/make/rpm/x64/*.rpm
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
|
||||||
|
- name: Upload .rpm package (Vulkan)
|
||||||
|
if: matrix.variant == 'vulkan'
|
||||||
|
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
|
||||||
|
with:
|
||||||
|
name: Goose-linux-x64-vulkan-rpm
|
||||||
|
path: ui/desktop/out/make/rpm/x64/*-vulkan.rpm
|
||||||
|
if-no-files-found: error
|
||||||
|
|
||||||
- name: Upload .flatpak package
|
- name: Upload .flatpak package
|
||||||
|
if: matrix.variant == 'standard'
|
||||||
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
|
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
|
||||||
with:
|
with:
|
||||||
name: Goose-linux-x64-flatpak
|
name: Goose-linux-x64-flatpak
|
||||||
path: ui/desktop/out/make/flatpak/x86_64/*.flatpak
|
path: ui/desktop/out/make/flatpak/x86_64/*.flatpak
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
|
||||||
|
- name: Upload .flatpak package (Vulkan)
|
||||||
|
if: matrix.variant == 'vulkan'
|
||||||
|
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
|
||||||
|
with:
|
||||||
|
name: Goose-linux-x64-vulkan-flatpak
|
||||||
|
path: ui/desktop/out/make/flatpak/x86_64/*-vulkan.flatpak
|
||||||
|
if-no-files-found: error
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ import { useState, useEffect } from "react";
|
|||||||
|
|
||||||
const FALLBACK_URL = "https://github.com/aaif-goose/goose/releases/latest";
|
const FALLBACK_URL = "https://github.com/aaif-goose/goose/releases/latest";
|
||||||
|
|
||||||
|
const isStandardLinuxAsset = (asset) => !asset.name.includes('-vulkan');
|
||||||
|
|
||||||
const LinuxDesktopInstallButtons = () => {
|
const LinuxDesktopInstallButtons = () => {
|
||||||
const [downloadUrls, setDownloadUrls] = useState({
|
const [downloadUrls, setDownloadUrls] = useState({
|
||||||
deb: FALLBACK_URL,
|
deb: FALLBACK_URL,
|
||||||
@@ -33,9 +35,15 @@ const LinuxDesktopInstallButtons = () => {
|
|||||||
const assets = release.assets || [];
|
const assets = release.assets || [];
|
||||||
|
|
||||||
// Find DEB, RPM, and Flatpak files
|
// Find DEB, RPM, and Flatpak files
|
||||||
const debAsset = assets.find(asset => asset.name.includes('.deb') && asset.name.includes('amd64'));
|
const debAsset = assets.find(asset =>
|
||||||
const rpmAsset = assets.find(asset => asset.name.includes('.rpm') && asset.name.includes('x86_64'));
|
isStandardLinuxAsset(asset) && asset.name.includes('.deb') && asset.name.includes('amd64')
|
||||||
const flatpakAsset = assets.find(asset => asset.name.endsWith('.flatpak'));
|
);
|
||||||
|
const rpmAsset = assets.find(asset =>
|
||||||
|
isStandardLinuxAsset(asset) && asset.name.includes('.rpm') && asset.name.includes('x86_64')
|
||||||
|
);
|
||||||
|
const flatpakAsset = assets.find(asset =>
|
||||||
|
isStandardLinuxAsset(asset) && asset.name.endsWith('.flatpak')
|
||||||
|
);
|
||||||
|
|
||||||
const newUrls = {
|
const newUrls = {
|
||||||
deb: debAsset?.browser_download_url || FALLBACK_URL,
|
deb: debAsset?.browser_download_url || FALLBACK_URL,
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ const { FusesPlugin } = require('@electron-forge/plugin-fuses');
|
|||||||
const { FuseV1Options, FuseVersion } = require('@electron/fuses');
|
const { FuseV1Options, FuseVersion } = require('@electron/fuses');
|
||||||
const { resolve } = require('path');
|
const { resolve } = require('path');
|
||||||
|
|
||||||
|
const isLinuxVulkanBuild = process.env.GOOSE_DESKTOP_LINUX_VARIANT === 'vulkan';
|
||||||
|
|
||||||
let cfg = {
|
let cfg = {
|
||||||
asar: true,
|
asar: true,
|
||||||
extraResource: ['src/bin', 'src/images'],
|
extraResource: ['src/bin', 'src/images'],
|
||||||
@@ -94,6 +96,7 @@ module.exports = {
|
|||||||
options: {
|
options: {
|
||||||
icon: 'src/images/icon.png',
|
icon: 'src/images/icon.png',
|
||||||
prefix: '/opt',
|
prefix: '/opt',
|
||||||
|
...(isLinuxVulkanBuild ? { depends: ['libvulkan1'] } : {}),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -109,6 +112,7 @@ module.exports = {
|
|||||||
options: {
|
options: {
|
||||||
icon: 'src/images/icon.png',
|
icon: 'src/images/icon.png',
|
||||||
prefix: '/opt',
|
prefix: '/opt',
|
||||||
|
...(isLinuxVulkanBuild ? { requires: ['vulkan-loader'] } : {}),
|
||||||
fpm: ['--rpm-rpmbuild-define', '_build_id_links none'],
|
fpm: ['--rpm-rpmbuild-define', '_build_id_links none'],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user