Skip to content

fix(ci): pass TAURI_SIGNING_PRIVATE_KEY to tauri build step - #241

Merged
EVWorth merged 1 commit into
mainfrom
fix/release-pass-tauri-signing-key
Jul 20, 2026
Merged

EVWorth merged 1 commit into
mainfrom
fix/release-pass-tauri-signing-key

Conversation

@EVWorth

@EVWorth EVWorth commented Jul 20, 2026

Copy link
Copy Markdown
Owner

What

After #239 set bundle.createUpdaterArtifacts: true in tauri.conf.json, [email protected] began attempting to sign artifacts during the build step itself, not just the generate-update-manifest step.

The release workflow passed TAURI_SIGNING_PRIVATE_KEY only to the manifest step. With createUpdaterArtifacts: true, the build step needs the env var too, or tauri-action aborts:

A public key has been found, but no private key. Make sure to set TAURI_SIGNING_PRIVATE_KEY environment variable.

Effect

All 4 build matrix entries failed at the 'Build and publish' step on the v0.4.0 tag push:

  • ubuntu-22.04 (x86_64-unknown-linux-gnu)
  • windows-latest (x86_64-pc-windows-msvc)
  • macos-latest (aarch64-apple-darwin)
  • macos-latest (x86_64-apple-darwin)

Run: https://github.com/EVWorth/sqlpilot/actions/runs/29715589604

Fix

Add TAURI_SIGNING_PRIVATE_KEY + TAURI_SIGNING_PRIVATE_KEY_PASSWORD: "" to the build step's env: block. Mirror what's already set in the generate-update-manifest step. Same pattern, same secret, same password (empty string).

       env:
         GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+        TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
+        TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ""
       with:

Safe

The env var is only consulted by tauri-action when createUpdaterArtifacts is set in tauri.conf.json. Adding it without createUpdaterArtifacts is a no-op. Forward-compatible to a future where the manifest step also re-signs artifacts defensively.

Out of scope

  • Rotating the signing key
  • Switching to Windows code signing (separate WINDOWS_CERTIFICATE secret already wired)
  • Adding a step that verifies the signature before upload

Why this worked for v0.3.4

[email protected] did not set bundle.createUpdaterArtifacts: true (that was added in #239 alongside the linux-rpm fix). Without the flag, the bundler skipped signing during build and only signed at the manifest step — which had the env var. #239 flipped the flag to true; the workflow env config wasn't updated to match.

After #239 set 'bundle.createUpdaterArtifacts: true' in
tauri.conf.json, tauri-action v1.0.0 began attempting to sign
artifacts during the BUILD step itself (not just the
generate-update-manifest step).

The workflow passed TAURI_SIGNING_PRIVATE_KEY only to the
generate-update-manifest step. With createUpdaterArtifacts: true,
the build step needs the env var too, or tauri-action aborts
with:

  'A public key has been found, but no private key. Make sure to
   set TAURI_SIGNING_PRIVATE_KEY environment variable.'

Effect: all 4 build matrix entries (Linux, Windows, macOS x2)
failed at the 'Build and publish' step on the v0.4.0 release
tag push, with exit code 1. Run #29715589604.

Fix: add TAURI_SIGNING_PRIVATE_KEY + TAURI_SIGNING_PRIVATE_KEY_PASSWORD
to the build step's env block. Mirror what's already in the
generate-update-manifest step. Same pattern, same secret.

Safe: the env is only read by tauri-action when 'createUpdaterArtifacts'
is set in tauri.conf.json. Otherwise it's ignored. Forward-compatible
to a future where the manifest step also re-signs (defensive).

Out of scope: rotating the signing key, switching to a different
key, or using Windows code signing (separate WINDOWS_CERTIFICATE
secret already wired).
@EVWorth
EVWorth merged commit 42ff01a into main Jul 20, 2026
10 checks passed
@EVWorth
EVWorth deleted the fix/release-pass-tauri-signing-key branch July 20, 2026 11:05
EVWorth added a commit that referenced this pull request Jul 21, 2026
Capture today's release-cut lessons so the next person doesn't
re-discover them. Five gotchas documented with symptoms, root
cause, fix, and recovery:

1. tauri-action v1.0.0 creates duplicate release candidates
   with strategy.matrix (parallel jobs racing on draft creation).
   Fix path: split build/upload jobs, or manually publish the
   correct Draft via gh api PATCH after the run.

2. `bundle.createUpdaterArtifacts: true` requires
   TAURI_SIGNING_PRIVATE_KEY on the BUILD step (not just the
   manifest step). Adding the flag without updating the workflow
   causes all 4 matrix builds to fail with 'no private key'.

3. `linux-rpm` platform key was silently absent from
   `latest.json` before #239. Bash case statement needed an
   explicit `*_x86_64.rpm` branch.

4. `bundle.linux.{deb,rpm}.depends` should be declared in
   `tauri.conf.json` for clean installs. Without these, fresh
   installs hit unsatisfiable-deps transaction failures.

5. Tag re-push recovery: if a release run produces a broken
   release, delete + re-push the tag (existing tags don't re-trigger).

Cross-linked to issues #242 (race condition), #243 (this doc),
#244 (Bazzite), and PRs #239 / #241.
EVWorth added a commit that referenced this pull request Jul 22, 2026
The "Local Storage Architecture" section claimed directories and
schema that don't exist. Replace fiction with the actual state of
the codebase.

Old claims that were wrong (all removed):
- `config.toml` — does not exist. Settings are in localStorage via
  zustand stores. Section replaced with a localStorage-key table.
- `history.db` — does not exist. Query history is in localStorage
  via `historyStore.ts` + `zustand/middleware::persist`. Removed
  the entire history.db schema section.
- `themes/`, `snippets/`, `backups/`, `cache/schema/`, `cache/ai/`
  — none of these directories exist. Replaced with a one-paragraph
  note pointing to the actual storage locations (theme localStorage
  key, favoritesStore, in-memory schema cache, in-memory AI cache).
- `connections.db` schema listed `password_ref`, `sort_order`,
  `pool_config` — none of these columns exist. Replaced with the
  ACTUAL schema: 19 columns with their real migration chain (env,
  connect_timeout_secs, query_timeout_secs, charset). The `password`
  column gets emptied after keyring migration; password is held in
  OS keyring via `apple-native-keyring-store`, not in the SQL row.
- `query_history` table — does not exist. Replaced with a
  paragraph on the in-memory + persist-middleware implementation
  and the future-SQLite migration scope.

The corrected doc has:
- File tree: `connections.db` (+ wal/shm) and `logs/` only. Two
  text files. No config.toml, no history.db, no themes, no snippets.
- localStorage keys table (theme, sqlpilot-formatter-settings,
  sqlpilot-query-settings, mas-query-history, mas-query-favorites,
  sqlpilot-editor-session) with their owners and formats.
- Password storage section explaining the keyring + migration +
  why the SQL `password` column gets emptied.
- Actual `connection_profiles` SQL with the real 19 columns and a
  migration chain table.
- A short paragraph on the missing `password_ref` / `sort_order` /
  `pool_config` so future contributors don't assume they exist.

No code changes. Pure doc.

Cross-linked to #241 (SQLite migration framework) — the `.ok()`-
swallowed ALTER TABLE approach flagged as needing replacement with
a `PRAGMA user_version`-gated runner.
EVWorth added a commit that referenced this pull request Jul 23, 2026
…) (#249)

Replace the silent-failure pattern in `init_tables` with a real
migration framework:

- `PRAGMA user_version` is the cursor (sqlite built-in, no
  custom table needed)
- `MIGRATIONS` is an ordered list of `(version, name, up SQL)` in
  `connection/migrations.rs`
- `run(conn)` reads the current cursor, runs only migrations with
  version > cursor, each inside a transaction, then bumps the
  cursor. Idempotent.
- Each `up` is split on `;` and run statement-by-statement
  (`execute()` rejects multi-statement strings for DDL).

Migrations captured:
- v1: `create_connection_profiles` (initial 15-col schema)
- v2: `add_env_column`
- v3: `add_connect_timeout_secs`
- v4: `add_query_timeout_secs`
- v5: `add_charset_column`

`SCHEMA_VERSION = 5` is the single source of truth for "what's the
current head". Append a new entry; never renumber.

`init_tables` is now 8 lines: lock the mutex, call `migrations::run(&db)`.
No more `.ok()` swallowing "duplicate column" errors silently. The
old code's silent failure pattern was masking every
column-addition in 0.2.x / 0.3.x as a no-op.

Why the redesign:
- Silent `.ok()` failures are dangerous: if 0.4.0 renames a column
  or changes a type, the migration would fail silently and the
  user's local DB would have the old schema while a 0.3.4→0.4.0
  upgrade would write data into the wrong shape. Real corruption
  risk.
- Per-version cursor: deterministic order, deterministic
  re-runnability, debuggable failure messages.

Tests (4 cases):
- `fresh_db_runs_all_migrations` — empty DB ends at v5 with all
  columns present
- `existing_v3_db_applies_only_pending_migrations` — simulate a
  user at v3 (manually set up the table + env + connect_timeout),
  verify the framework applies v4 + v5 only and lands at the head
- `already_at_head_is_noop` — running `run()` on a current-state
  DB is a no-op
- `runs_each_migration_exactly_once` — re-running after success
  doesn't error or duplicate-apply

Out of scope:
- Connection-store CRUD tests in `tests/integration_tests.rs`
  require a real MySQL 8 (port 13306) per the project's testing
  doc. They were not run here; the migration framework changes
  don't touch those flows.
- The `query_database_context_regression` test (the "5 filtered
  out" in `cargo test -p mas-core`) is unrelated to this change.
- A more sophisticated framework (e.g. with rollback tables, dry-run
  mode, checksum) is overkill for this project's needs.

Files:
- `crates/mas-core/src/connection/migrations.rs` (new, 219 lines):
  `Migration` struct, `MIGRATIONS` const, `run()` function, 4 unit
  tests
- `crates/mas-core/src/connection/mod.rs`: register the new
  `migrations` module
- `crates/mas-core/src/connection/store.rs`:
  `init_tables` calls `migrations::run(&db)` instead of inline
  CREATE + 4 silent ALTERs. -45 / +6 net.
- `Cargo.lock`: bumped sqlpilot 0.3.4 -> 0.4.0 (from the version
  bump in main; not a code change here).
EVWorth added a commit that referenced this pull request Jul 23, 2026
Issue 243 asks to capture the createUpdaterArtifacts gotcha in RELEASING.md.
The gotcha already exists as gotcha #2 (PR #241 added the env var). What's
missing is the cross-link from .opencode/AGENTS.md and an update to the
example to reflect the renamed Build bundles (no release) step after #251.

- docs/RELEASING.md: rename step in gotcha #2 example from Build and publish
  to Build bundles (no release), trim the trailing '...'
- .opencode/AGENTS.md: add pitfall #13 referencing the gotcha, and a
  'read RELEASING.md gotchas 1-5' note in the Release Flow section

Closes #243
EVWorth added a commit that referenced this pull request Jul 23, 2026
Issue 243 asks to capture the createUpdaterArtifacts gotcha in RELEASING.md.
The gotcha already exists as gotcha #2 (PR #241 added the env var). What's
missing is the cross-link from .opencode/AGENTS.md and an update to the
example to reflect the renamed Build bundles (no release) step after #251.

- docs/RELEASING.md: rename step in gotcha #2 example from Build and publish
  to Build bundles (no release), trim the trailing '...'
- .opencode/AGENTS.md: add pitfall #13 referencing the gotcha, and a
  'read RELEASING.md gotchas 1-5' note in the Release Flow section

Closes #243
EVWorth added a commit that referenced this pull request Jul 23, 2026
…252)

Issue 243 asks to capture the createUpdaterArtifacts gotcha in RELEASING.md.
The gotcha already exists as gotcha #2 (PR #241 added the env var). What's
missing is the cross-link from .opencode/AGENTS.md and an update to the
example to reflect the renamed Build bundles (no release) step after #251.

- docs/RELEASING.md: rename step in gotcha #2 example from Build and publish
  to Build bundles (no release), trim the trailing '...'
- .opencode/AGENTS.md: add pitfall #13 referencing the gotcha, and a
  'read RELEASING.md gotchas 1-5' note in the Release Flow section

Closes #243
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant