Skip to content

Commit b52ec74

Browse files
committed
chore: enhance publish workflow and plugin initialization
- Added steps to bundle and verify plugins in the publish workflow, ensuring that at least one bundled plugin is present. - Refactored plugin initialization logic to streamline the process of copying bundled plugins to the installation directory.
1 parent 8feca7a commit b52ec74

4 files changed

Lines changed: 41 additions & 5 deletions

File tree

.github/workflows/publish.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,15 @@ jobs:
4343
with:
4444
bun-version: "latest"
4545
- run: bun install
46+
- name: Bundle plugins
47+
run: bun run bundle:plugins
48+
- name: Verify bundled plugins
49+
run: |
50+
COUNT=$(find src-tauri/resources/bundled_plugins -maxdepth 2 -name plugin.json | wc -l | tr -d ' ')
51+
if [[ "$COUNT" -lt 1 ]]; then
52+
echo "No bundled plugins found under src-tauri/resources/bundled_plugins."
53+
exit 1
54+
fi
4655
4756
- name: Validate release tag
4857
run: |
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2026-02-02
2+
3+
# Bundled plugins in CI
4+
5+
## Goal
6+
- Ensure publish workflow bundles plugins into `src-tauri/resources/bundled_plugins/` before `tauri build`.
7+
- Fail fast if no bundled plugins are present.
8+
9+
## Non-goals
10+
- Change plugin runtime or plugin discovery logic.
11+
12+
## Plan
13+
1. Run `bun run bundle:plugins` in `publish.yml` before `tauri-action`.
14+
2. Verify at least one `plugin.json` exists under `src-tauri/resources/bundled_plugins/*/`.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2026-02-02
2+
3+
# Bundled plugins runtime sync
4+
5+
## Goal
6+
- Ensure bundled plugins are always present and updated in the app data plugins dir.
7+
- Avoid empty plugin lists when the install dir has stray files.
8+
9+
## Non-goals
10+
- Delete or remove user-installed plugins.
11+
- Add remote plugin updates.
12+
13+
## Plan
14+
1. Always copy bundled plugins from app resources into `{appDataDir}/plugins` on startup.
15+
2. Copy merges overwrite existing bundled plugin files but does not delete extra files.

src-tauri/src/plugin_engine/mod.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,9 @@ pub fn initialize_plugins(
2121
log::warn!("failed to create install dir {}: {}", install_dir.display(), err);
2222
}
2323

24-
if is_dir_empty(&install_dir) {
25-
let bundled_dir = resolve_bundled_dir(resource_dir);
26-
if bundled_dir.exists() {
27-
copy_dir_recursive(&bundled_dir, &install_dir);
28-
}
24+
let bundled_dir = resolve_bundled_dir(resource_dir);
25+
if bundled_dir.exists() {
26+
copy_dir_recursive(&bundled_dir, &install_dir);
2927
}
3028

3129
let plugins = manifest::load_plugins_from_dir(&install_dir);

0 commit comments

Comments
 (0)