Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 22 additions & 7 deletions .github/workflows/bundle-desktop-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ name: "Bundle Desktop (Linux)"
jobs:
build-desktop-linux:
name: Build Desktop (Linux)
runs-on: ubuntu-latest
runs-on: ubuntu-x86-16core-64gb

steps:
- name: Checkout repository
Expand Down Expand Up @@ -76,7 +76,14 @@ jobs:
rpm \
fakeroot \
dpkg-dev \
protobuf-compiler
protobuf-compiler \
flatpak \
flatpak-builder \
elfutils

- name: Setup Flatpak Runtimes
run: |
flatpak remote-add --if-not-exists --user flathub https://dl.flathub.org/repo/flathub.flatpakrepo

- name: Activate hermit and set CARGO_HOME
run: |
Expand Down Expand Up @@ -136,25 +143,25 @@ jobs:
run: |
source ./bin/activate-hermit
cd ui/desktop
echo "Building Linux packages (.deb and .rpm)..."
echo "Building Linux packages (.deb, .rpm, and .flatpak)..."

# Build both .deb and .rpm packages
# Build all configured packages
npm run make -- --platform=linux --arch=x64

echo "Build completed. Checking output..."
ls -la out/
find out/ -name "*.deb" -o -name "*.rpm" | head -10
find out/ -name "*.deb" -o -name "*.rpm" -o -name "*.flatpak" | head -10

- name: List generated files
run: |
echo "=== All files in out/ directory ==="
find ui/desktop/out/ -type f | head -20
echo ""
echo "=== Package files specifically ==="
find ui/desktop/out/ -name "*.deb" -o -name "*.rpm"
find ui/desktop/out/ -name "*.deb" -o -name "*.rpm" -o -name "*.flatpak"
echo ""
echo "=== File sizes ==="
find ui/desktop/out/ -name "*.deb" -o -name "*.rpm" -exec ls -lh {} \;
find ui/desktop/out/ -name "*.deb" -o -name "*.rpm" -o -name "*.flatpak" -exec ls -lh {} \;

- name: Upload .deb package
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
Expand All @@ -170,11 +177,19 @@ jobs:
path: ui/desktop/out/make/rpm/x64/*.rpm
if-no-files-found: error

- name: Upload .flatpak package
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: Goose-linux-x64-flatpak
path: ui/desktop/out/make/flatpak/**/*.flatpak
if-no-files-found: error

- name: Upload combined Linux packages
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: Goose-linux-x64
path: |
ui/desktop/out/make/deb/x64/*.deb
ui/desktop/out/make/rpm/x64/*.rpm
ui/desktop/out/make/flatpak/**/*.flatpak
if-no-files-found: error
1 change: 1 addition & 0 deletions .github/workflows/canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ jobs:
Goose*.zip
*.deb
*.rpm
*.flatpak
download_cli.sh
allowUpdates: true
omitBody: true
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ jobs:
Goose*.zip
*.deb
*.rpm
*.flatpak
download_cli.sh
allowUpdates: true
omitBody: true
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ jobs:
Goose*.zip
*.deb
*.rpm
*.flatpak
download_cli.sh
allowUpdates: true
omitBody: true
Expand All @@ -127,6 +128,7 @@ jobs:
Goose*.zip
*.deb
*.rpm
*.flatpak
download_cli.sh
allowUpdates: true
omitBody: true
Expand Down
19 changes: 17 additions & 2 deletions BUILDING_LINUX.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,23 @@ If you see "Could not find goosed binary", ensure you've:
- The RPM maker is disabled by default as it's not compatible with Arch-based systems
- Use the ZIP distribution method for maximum compatibility

#### Flatpak/Snap
Building as Flatpak or Snap packages is not currently supported but may be added in the future.
#### Flatpak
Flatpak builds are supported via CI. To build locally:
```bash
# Install flatpak and flatpak-builder
sudo apt install flatpak flatpak-builder

# Add Flathub remote
flatpak remote-add --if-not-exists --user flathub https://dl.flathub.org/repo/flathub.flatpakrepo

# Build with Electron Forge
npm run make -- --targets=@electron-forge/maker-flatpak
```

Output: `out/make/flatpak/x86_64/*.flatpak`

#### Snap
Building as Snap packages is not currently supported but may be added in the future.

## Development Workflow

Expand Down
43 changes: 25 additions & 18 deletions documentation/src/components/LinuxDesktopInstallButtons.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ const FALLBACK_URL = "https://github.com/block/goose/releases/latest";
const LinuxDesktopInstallButtons = () => {
const [downloadUrls, setDownloadUrls] = useState({
deb: FALLBACK_URL,
rpm: FALLBACK_URL
rpm: FALLBACK_URL,
flatpak: FALLBACK_URL
});

useEffect(() => {
Expand All @@ -17,7 +18,7 @@ const LinuxDesktopInstallButtons = () => {
const cached = localStorage.getItem('goose-release-cache');
const cacheTime = localStorage.getItem('goose-release-cache-time');
const now = Date.now();

if (cached && cacheTime && (now - parseInt(cacheTime)) < 3600000) {
// Use cached data if less than 1 hour old
setDownloadUrls(JSON.parse(cached));
Expand All @@ -27,25 +28,25 @@ const LinuxDesktopInstallButtons = () => {
// Fetch latest release from GitHub API
const response = await fetch('https://api.github.com/repos/block/goose/releases/latest');
if (!response.ok) throw new Error('API request failed');

const release = await response.json();
const assets = release.assets || [];
// Find DEB and RPM files

// Find DEB, RPM, and Flatpak files
const debAsset = assets.find(asset => asset.name.includes('.deb') && asset.name.includes('amd64'));
const rpmAsset = assets.find(asset => asset.name.includes('.rpm') && asset.name.includes('x86_64'));

if (debAsset && rpmAsset) {
const newUrls = {
deb: debAsset.browser_download_url,
rpm: rpmAsset.browser_download_url
};
// Update state and cache
setDownloadUrls(newUrls);
localStorage.setItem('goose-release-cache', JSON.stringify(newUrls));
localStorage.setItem('goose-release-cache-time', now.toString());
}
const flatpakAsset = assets.find(asset => asset.name.endsWith('.flatpak'));

const newUrls = {
deb: debAsset?.browser_download_url || FALLBACK_URL,
rpm: rpmAsset?.browser_download_url || FALLBACK_URL,
flatpak: flatpakAsset?.browser_download_url || FALLBACK_URL
};

// Update state and cache
setDownloadUrls(newUrls);
localStorage.setItem('goose-release-cache', JSON.stringify(newUrls));
localStorage.setItem('goose-release-cache-time', now.toString());
} catch (error) {
console.warn('Failed to fetch latest release, using fallback URLs:', error);
// Fallback URLs are already set in initial state
Expand All @@ -71,9 +72,15 @@ const LinuxDesktopInstallButtons = () => {
>
<IconDownload /> RPM Package (RHEL/Fedora)
</Link>
<Link
className="button button--primary button--lg"
to={downloadUrls.flatpak}
>
<IconDownload /> Flatpak (Universal)
</Link>
</div>
</div>
);
};

export default LinuxDesktopInstallButtons;
export default LinuxDesktopInstallButtons;
4 changes: 4 additions & 0 deletions ui/desktop/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,15 @@ npm run make -- --targets=@electron-forge/maker-zip

# For DEB package (Debian/Ubuntu)
npm run make -- --targets=@electron-forge/maker-deb

# For Flatpak (requires flatpak and flatpak-builder)
npm run make -- --targets=@electron-forge/maker-flatpak
```

The built application will be available in:
- ZIP: `out/make/zip/linux/x64/goose-linux-x64-{version}.zip`
- DEB: `out/make/deb/x64/goose_{version}_amd64.deb`
- Flatpak: `out/make/flatpak/x86_64/*.flatpak`
- Executable: `out/goose-linux-x64/goose`

### Windows
Expand Down
39 changes: 39 additions & 0 deletions ui/desktop/forge.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,45 @@ module.exports = {
},
},
},
{
name: '@electron-forge/maker-flatpak',
config: {
options: {
categories: ['Development'],
icon: 'src/images/icon.png',
homepage: 'https://block.github.io/goose/',
runtimeVersion: '25.08',
baseVersion: '25.08',
bin: 'Goose',
modules: [
{
name: 'libbz2-shim',
buildsystem: 'simple',
'build-commands': [
// Create the lib directory in the app bundle
'mkdir -p /app/lib',
// Point to the actual library in the 25.08 runtime
// We use a wildcard to handle multi-arch paths (x86_64-linux-gnu, etc)
'ln -s $(find /usr/lib -name "libbz2.so.1" | head -n 1) /app/lib/libbz2.so.1.0'
]
}
],
finishArgs: [
'--share=ipc',
'--socket=x11',
'--socket=wayland',
'--device=dri',
'--share=network',
'--filesystem=home',
'--talk-name=org.freedesktop.Notifications',
'--socket=session-bus',
'--socket=system-bus',
// This ensures the app looks in our shim folder first
'--env=LD_LIBRARY_PATH=/app/lib'
],
},
},
},
],
plugins: [
{
Expand Down
Loading