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
37 changes: 37 additions & 0 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,37 @@ jobs:
sudo apt-get install -y libappindicator3-dev librsvg2-dev patchelf
sudo apt-get install -y libwebkit2gtk-4.1-dev || sudo apt-get install -y libwebkit2gtk-4.0-dev

# ---------- Flatpak (Linux only; artifact) ----------
- name: Install Flatpak tooling
if: matrix.platform == 'ubuntu-22.04' && hashFiles('packaging/flatpak/io.github.jordonbc.OpenVCS.yml') != ''
run: |
set -euxo pipefail
sudo apt-get update
sudo apt-get install -y --no-install-recommends flatpak flatpak-builder
flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak install --user -y flathub org.gnome.Platform//48 org.gnome.Sdk//48

- name: Verify Flatpak manifest exists
if: matrix.platform == 'ubuntu-22.04' && hashFiles('packaging/flatpak/io.github.jordonbc.OpenVCS.yml') != ''
run: |
set -euxo pipefail
ls -la packaging/flatpak
test -f packaging/flatpak/io.github.jordonbc.OpenVCS.yml

- name: Build Flatpak bundle
if: matrix.platform == 'ubuntu-22.04' && hashFiles('packaging/flatpak/io.github.jordonbc.OpenVCS.yml') != ''
run: |
set -euxo pipefail
flatpak-builder --user --force-clean --repo=repo build-flatpak packaging/flatpak/io.github.jordonbc.OpenVCS.yml
flatpak build-bundle repo OpenVCS.flatpak io.github.jordonbc.OpenVCS

- name: Upload Flatpak bundle (artifact)
if: matrix.platform == 'ubuntu-22.04' && hashFiles('packaging/flatpak/io.github.jordonbc.OpenVCS.yml') != ''
uses: actions/upload-artifact@v4
with:
name: OpenVCS-flatpak-nightly
path: OpenVCS.flatpak

# ---------- Cache ----------
- name: Rust cache
uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2.8.2
Expand Down Expand Up @@ -209,3 +240,9 @@ jobs:
releaseDraft: false
prerelease: true
args: ${{ matrix.args }}

- name: Upload Flatpak bundle to GitHub Release
if: matrix.platform == 'ubuntu-22.04' && hashFiles('packaging/flatpak/io.github.jordonbc.OpenVCS.yml') != ''
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release upload openvcs-nightly OpenVCS.flatpak --clobber
49 changes: 49 additions & 0 deletions .github/workflows/publish-stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,16 @@ jobs:
lfs: true
fetch-depth: 0

- name: Compute version tag
id: version
if: matrix.platform == 'ubuntu-22.04'
shell: bash
run: |
set -euo pipefail
VERSION="$(grep -m1 '^version *= *\"' Backend/Cargo.toml | sed -E 's/^version *= *\"([^\"]+)\".*/\\1/')"
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
echo "tag=openvcs-v$VERSION" >> "$GITHUB_OUTPUT"

# ---------- Frontend (Node + Vite) ----------
- name: Setup Node
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
Expand Down Expand Up @@ -65,6 +75,39 @@ jobs:
# Prefer WebKitGTK 4.1; fall back to 4.0 if 4.1 isn't available
sudo apt-get install -y libwebkit2gtk-4.1-dev || sudo apt-get install -y libwebkit2gtk-4.0-dev

# ---------- Flatpak (Linux only; artifact) ----------
- name: Install Flatpak tooling
if: matrix.platform == 'ubuntu-22.04' && hashFiles('packaging/flatpak/io.github.jordonbc.OpenVCS.yml') != ''
shell: bash
run: |
set -euxo pipefail
sudo apt-get install -y --no-install-recommends flatpak flatpak-builder
flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak install --user -y flathub org.gnome.Platform//48 org.gnome.Sdk//48

- name: Verify Flatpak manifest exists
if: matrix.platform == 'ubuntu-22.04' && hashFiles('packaging/flatpak/io.github.jordonbc.OpenVCS.yml') != ''
shell: bash
run: |
set -euxo pipefail
ls -la packaging/flatpak
test -f packaging/flatpak/io.github.jordonbc.OpenVCS.yml

- name: Build Flatpak bundle
if: matrix.platform == 'ubuntu-22.04' && hashFiles('packaging/flatpak/io.github.jordonbc.OpenVCS.yml') != ''
shell: bash
run: |
set -euxo pipefail
flatpak-builder --user --force-clean --repo=repo build-flatpak packaging/flatpak/io.github.jordonbc.OpenVCS.yml
flatpak build-bundle repo OpenVCS.flatpak io.github.jordonbc.OpenVCS

- name: Upload Flatpak bundle (artifact)
if: matrix.platform == 'ubuntu-22.04' && hashFiles('packaging/flatpak/io.github.jordonbc.OpenVCS.yml') != ''
uses: actions/upload-artifact@v4
with:
name: OpenVCS-flatpak-stable
path: OpenVCS.flatpak

# ---------- Cargo caching ----------
- name: Rust cache
uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2.8.2
Expand Down Expand Up @@ -93,3 +136,9 @@ jobs:
args: ${{ matrix.args }}
includeDebug: false # default; set true if you want debug archives too
# bundles: '' # e.g. 'deb,appimage,msi,nsis' if you want to restrict output

- name: Upload Flatpak bundle to GitHub Release
if: matrix.platform == 'ubuntu-22.04' && hashFiles('packaging/flatpak/io.github.jordonbc.OpenVCS.yml') != ''
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release upload "${{ steps.version.outputs.tag }}" OpenVCS.flatpak --clobber
19 changes: 19 additions & 0 deletions Backend/build.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
use std::{env, fs, path::PathBuf, process::Command};

fn is_flatpak_build() -> bool {
matches!(
env::var("OPENVCS_FLATPAK").as_deref(),
Ok("1") | Ok("true") | Ok("yes") | Ok("on")
)
}

fn main() {
// Base config path (in the Backend crate)
let manifest_dir = PathBuf::from(env::var("CARGO_MANIFEST_DIR").expect("CARGO_MANIFEST_DIR"));
Expand Down Expand Up @@ -32,6 +39,18 @@ fn main() {
}
}

// Flatpak apps update via Flatpak, not the in-app updater.
if is_flatpak_build() {
if let Some(plugins) = json.get_mut("plugins") {
if let Some(updater) = plugins.get_mut("updater") {
updater["active"] = serde_json::Value::Bool(false);
}
}
if let Some(bundle) = json.get_mut("bundle") {
bundle["createUpdaterArtifacts"] = serde_json::Value::Bool(false);
}
}

// Provide the generated config via inline JSON env var (must be single-line)
let inline = serde_json::to_string(&json).unwrap();
println!("cargo:rustc-env=TAURI_CONFIG={}", inline);
Expand Down
25 changes: 25 additions & 0 deletions packaging/flatpak/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Flatpak (local builds)

This repo includes a starter Flatpak manifest for local development builds:

- `packaging/flatpak/io.github.jordonbc.OpenVCS.yml`

## Build + run

From the repo root:

```bash
flatpak install -y flathub org.gnome.Platform//48 org.gnome.Sdk//48

cd Frontend && npm ci && npm run build && cd ..

flatpak-builder --force-clean --user --install build-flatpak packaging/flatpak/io.github.jordonbc.OpenVCS.yml
flatpak run io.github.jordonbc.OpenVCS
```

## Notes

- The manifest expects the frontend to already be built at `Frontend/dist`.
- It exports `OPENVCS_FLATPAK=1` so `Backend/build.rs` disables the in-app updater (Flatpak apps update via Flatpak).
- It bootstraps a minimal Rust toolchain via rustup if `cargo` is not available in the SDK.
- For Flathub, you should pin sources (tag/commit) and vendor/pin dependencies so builds don’t require network access.
9 changes: 9 additions & 0 deletions packaging/flatpak/io.github.jordonbc.OpenVCS.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[Desktop Entry]
Type=Application
Name=OpenVCS
Comment=A simple, cross-platform GUI for Git.
Exec=openvcs
Icon=io.github.jordonbc.OpenVCS
Terminal=false
Categories=Development;RevisionControl;
Keywords=git;vcs;version control;
20 changes: 20 additions & 0 deletions packaging/flatpak/io.github.jordonbc.OpenVCS.metainfo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop-application">
<id>io.github.jordonbc.OpenVCS</id>
<name>OpenVCS</name>
<summary>A simple, cross-platform GUI for Git.</summary>
<metadata_license>CC0-1.0</metadata_license>
<project_license>GPL-3.0-or-later</project_license>
<developer id="io.github.jordonbc">
<name>Jordon Brooks</name>
</developer>
<url type="homepage">https://bbgames.dev</url>
<url type="bugtracker">https://github.com/Jordonbc/OpenVCS/issues</url>
<description>
<p>OpenVCS is a lightweight, highly customizable Git GUI built with Rust and Tauri.</p>
</description>
<launchable type="desktop-id">io.github.jordonbc.OpenVCS.desktop</launchable>
<provides>
<binary>openvcs</binary>
</provides>
</component>
43 changes: 43 additions & 0 deletions packaging/flatpak/io.github.jordonbc.OpenVCS.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
app-id: io.github.jordonbc.OpenVCS
runtime: org.gnome.Platform
runtime-version: "48"
sdk: org.gnome.Sdk

command: openvcs

finish-args:
- --share=ipc
- --share=network
- --socket=wayland
- --socket=fallback-x11
- --device=dri
- --talk-name=org.freedesktop.portal.Desktop
- --talk-name=org.freedesktop.portal.FileChooser
- --talk-name=org.freedesktop.portal.OpenURI

modules:
- name: openvcs
buildsystem: simple
build-options:
env:
OPENVCS_FLATPAK: "1"
build-args:
- --share=network
sources:
- type: dir
path: ../..
skip:
- .flatpak-builder
- Frontend/node_modules
- target
build-commands:
- test -f Frontend/dist/index.html
- command -v cargo >/dev/null || ((curl -sSf https://sh.rustup.rs || wget -qO- https://sh.rustup.rs) | sh -s -- -y --profile minimal)
- $HOME/.cargo/bin/cargo build --release --manifest-path Backend/Cargo.toml
- install -Dm755 target/release/openvcs /app/bin/openvcs
- install -Dm644 packaging/flatpak/io.github.jordonbc.OpenVCS.desktop /app/share/applications/io.github.jordonbc.OpenVCS.desktop
- install -Dm644 packaging/flatpak/io.github.jordonbc.OpenVCS.metainfo.xml /app/share/metainfo/io.github.jordonbc.OpenVCS.metainfo.xml
- install -Dm644 Backend/icons/32x32.png /app/share/icons/hicolor/32x32/apps/io.github.jordonbc.OpenVCS.png
- install -Dm644 Backend/icons/64x64.png /app/share/icons/hicolor/64x64/apps/io.github.jordonbc.OpenVCS.png
- install -Dm644 Backend/icons/128x128.png /app/share/icons/hicolor/128x128/apps/io.github.jordonbc.OpenVCS.png
- install -Dm644 Backend/icons/128x128@2x.png /app/share/icons/hicolor/256x256/apps/io.github.jordonbc.OpenVCS.png
Loading