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
71 changes: 71 additions & 0 deletions RELEASING.linux.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# Releasing CodexMonitor (Linux/AppImage)

This is a copy/paste friendly script-style guide. It must be run on Linux and
produces an AppImage for the current machine architecture (x86_64 or
arm64/aarch64).

Prerequisites (examples):

- Ubuntu/Debian: `sudo apt-get install -y libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev patchelf libfuse2`
- Arch: `sudo pacman -S --needed webkit2gtk gtk3 libayatana-appindicator librsvg patchelf fuse2`

Notes:

- AppImage bundling uses the current OS and arch (no cross-compile in this flow).
- On Arch, AppImage bundling can fail while stripping; `npm run build:appimage`
already sets `NO_STRIP=1`.
- If AppImage tooling fails to execute because of FUSE, try:
`APPIMAGE_EXTRACT_AND_RUN=1 npm run build:appimage`.

```bash
set -euo pipefail

# --- Set versions ---
# Update these two values each release.
RELEASE_VERSION="0.5.1"
PREV_VERSION="0.5.0"

# --- Update version fields (manual check afterwards) ---
perl -pi -e "s/\"version\": \"[^\"]+\"/\"version\": \"${RELEASE_VERSION}\"/" package.json
perl -pi -e "s/\"version\": \"[^\"]+\"/\"version\": \"${RELEASE_VERSION}\"/" src-tauri/tauri.conf.json
npm install

# --- Commit + push version bump ---
git add package.json package-lock.json src-tauri/tauri.conf.json
git commit -m "chore: bump version to ${RELEASE_VERSION}"
git push origin main

# --- Build AppImage ---
npm run build:appimage

# --- Collect artifact ---
ARCH="$(uname -m)"
APPIMAGE_DIR="src-tauri/target/release/bundle/appimage"
APPIMAGE_FILE="$(ls "${APPIMAGE_DIR}"/*.AppImage | head -n 1)"
mkdir -p release-artifacts
cp "${APPIMAGE_FILE}" "release-artifacts/CodexMonitor_${RELEASE_VERSION}_${ARCH}.AppImage"

# Optional: checksum
sha256sum "release-artifacts/CodexMonitor_${RELEASE_VERSION}_${ARCH}.AppImage" \
> "release-artifacts/CodexMonitor_${RELEASE_VERSION}_${ARCH}.AppImage.sha256"

# --- Changelog (for release notes) ---
git log --name-only --pretty=format:"%h %s" v${PREV_VERSION}..v${RELEASE_VERSION}

# --- Tag ---
git tag v${RELEASE_VERSION}
git push origin v${RELEASE_VERSION}

# --- Create GitHub release with artifact ---
gh release create v${RELEASE_VERSION} \
--title "v${RELEASE_VERSION}" \
--notes "- Short update notes" \
"release-artifacts/CodexMonitor_${RELEASE_VERSION}_${ARCH}.AppImage" \
"release-artifacts/CodexMonitor_${RELEASE_VERSION}_${ARCH}.AppImage.sha256"

# --- If you need to update assets later ---
gh release upload v${RELEASE_VERSION} \
"release-artifacts/CodexMonitor_${RELEASE_VERSION}_${ARCH}.AppImage" \
"release-artifacts/CodexMonitor_${RELEASE_VERSION}_${ARCH}.AppImage.sha256" \
--clobber
```
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"build:appimage": "NO_STRIP=1 tauri build --bundles appimage",
"typecheck": "tsc --noEmit",
"preview": "vite preview",
"tauri": "tauri"
Expand Down
38 changes: 38 additions & 0 deletions src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ tokio = { version = "1", features = ["io-util", "process", "rt", "sync", "time"]
uuid = { version = "1", features = ["v4"] }
tauri-plugin-dialog = "2"
git2 = "0.20.3"
fix-path-env = { git = "https://github.com/tauri-apps/fix-path-env-rs" }

[target."cfg(not(any(target_os = \"android\", target_os = \"ios\")))".dependencies]
tauri-plugin-updater = "2"
8 changes: 8 additions & 0 deletions src-tauri/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ mod workspaces;

#[cfg_attr(mobile, tauri::mobile_entry_point)]
pub fn run() {
#[cfg(target_os = "linux")]
{
// Avoid WebKit compositing issues on some Linux setups (GBM buffer errors).
if std::env::var_os("WEBKIT_DISABLE_COMPOSITING_MODE").is_none() {
std::env::set_var("WEBKIT_DISABLE_COMPOSITING_MODE", "1");
}
}

tauri::Builder::default()
.enable_macos_default_menu(false)
.menu(|handle| {
Expand Down
3 changes: 3 additions & 0 deletions src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]

fn main() {
if let Err(err) = fix_path_env::fix() {
eprintln!("Failed to sync PATH from shell: {err}");
}
codex_monitor_lib::run()
}
8 changes: 8 additions & 0 deletions src-tauri/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,17 +130,24 @@ pub(crate) struct AppSettings {
pub(crate) codex_bin: Option<String>,
#[serde(default = "default_access_mode", rename = "defaultAccessMode")]
pub(crate) default_access_mode: String,
#[serde(default = "default_ui_scale", rename = "uiScale")]
pub(crate) ui_scale: f64,
}

fn default_access_mode() -> String {
"current".to_string()
}

fn default_ui_scale() -> f64 {
1.0
}

impl Default for AppSettings {
fn default() -> Self {
Self {
codex_bin: None,
default_access_mode: "current".to_string(),
ui_scale: 1.0,
}
}
}
Expand All @@ -154,6 +161,7 @@ mod tests {
let settings: AppSettings = serde_json::from_str("{}").expect("settings deserialize");
assert!(settings.codex_bin.is_none());
assert_eq!(settings.default_access_mode, "current");
assert!((settings.ui_scale - 1.0).abs() < f64::EPSILON);
}

#[test]
Expand Down
18 changes: 18 additions & 0 deletions src-tauri/tauri.linux.conf.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"app": {
"windows": [
{
"title": "CodexMonitor",
"width": 1200,
"height": 700,
"minWidth": 360,
"minHeight": 600,
"titleBarStyle": "Visible",
"hiddenTitle": false,
"transparent": false,
"devtools": true,
"windowEffects": null
}
]
}
}
Loading