Skip to content

ci: Add rust build cache and update actions in Tauri release workflow#1431

Open
SameDesu123 wants to merge 2 commits into
kwaroran:mainfrom
SameDesu123:codex/optimize-tauri-actions
Open

ci: Add rust build cache and update actions in Tauri release workflow#1431
SameDesu123 wants to merge 2 commits into
kwaroran:mainfrom
SameDesu123:codex/optimize-tauri-actions

Conversation

@SameDesu123
Copy link
Copy Markdown
Contributor

@SameDesu123 SameDesu123 commented May 3, 2026

PR Checklist

  • Required Checks
    • Have you added type definitions?
    • Have you tested your changes?
    • Have you checked that it won't break any existing features?
  • If your PR uses models1, check the following:
    • Have you checked if it works normally in all models?
    • Have you checked if it works normally in all web, local, and node-hosted versions? If it doesn't, have you blocked it in those versions?
  • If your PR is highly AI generated2, check the following:
    • Have you understood what the code does?
    • Have you cleaned up any unnecessary or redundant code?
    • Is it not a huge change?
      • We currently do not accept highly AI generated PRs that are large changes.

Summary

Optimizes the Tauri release workflow by adding Rust build caching, simplifying pnpm caching, removing redundant macOS target installation, updating GitHub Action versions.

Related Issues

None.

Changes

  • Adds matrix target values and installs only the required Rust target for each Tauri job.
  • Replaces the manual pnpm store cache step with the built-in actions/setup-node pnpm cache.
  • Adds Swatinem/rust-cache@v2 for src-tauri Cargo artifacts.
  • Removes duplicate macOS rustup target add steps.
  • Switches CI dependency installation to pnpm install --frozen-lockfile.
  • Updates workflow actions where newer major versions are available.

Impact

This should reduce repeated Tauri release build work in GitHub Actions while keeping release artifact generation unchanged, including updater artifacts. The committed Cargo lockfile also prevents CI from resolving different Rust dependency versions on each run.

For context, I compared the existing upstream workflow usage run:
https://github.com/kwaroran/Risuai/actions/runs/24605548471/usage

Job Run time
publish-tauri (macos-latest, --target x86_64-apple-darwin) 8m 24s
publish-tauri (macos-latest, --target aarch64-apple-darwin) 6m 28s
publish-tauri (ubuntu-latest, --target x86_64-unknown-linux-gnu) 13m 0s
publish-tauri (windows-latest, --target x86_64-pc-windows-msvc) 13m 37s
Total 41m 29s

with the fork test run using the optimized workflow:
https://github.com/SameDesu123/Risuai/actions/runs/25267682504/usage

Job Run time
publish-tauri (macos-latest, aarch64-apple-darwin, --target aarch64-apple-darwin --config src-tau... 4m 51s
publish-tauri (macos-latest, x86_64-apple-darwin, --target x86_64-apple-darwin --config src-tauri... 3m 25s
publish-tauri (ubuntu-latest, x86_64-unknown-linux-gnu, --target x86_64-unknown-linux-gnu --confi... 8m 36s
publish-tauri (windows-latest, x86_64-pc-windows-msvc, --target x86_64-pc-windows-msvc --config s... 6m 37s
Total 23m 29s

The fork test run showed the streamlined step layout with Rust cache and without the old manual pnpm cache / duplicate macOS target installation steps.

Additional Notes

Validated locally with:

  • ruby -e "require 'yaml'; Dir['.github/workflows/*.{yml,yaml}'].each { |f| YAML.load_file(f) }"
  • git diff --check

Footnotes

  1. Modifies the behavior of prompting, requesting, or handling responses from AI models.

  2. Over 80% of the code is AI generated.

@SameDesu123 SameDesu123 marked this pull request as ready for review May 3, 2026 02:50
@SameDesu123 SameDesu123 force-pushed the codex/optimize-tauri-actions branch from faee1c5 to 6224af9 Compare May 9, 2026 09:23
@SameDesu123
Copy link
Copy Markdown
Contributor Author

cargo.lock changes are reverted.

@SameDesu123 SameDesu123 changed the title ci: speed up tauri release workflow ci: Add rust build cache and update actions in Tauri release workflow May 9, 2026
@SameDesu123 SameDesu123 marked this pull request as draft May 12, 2026 01:11
@SameDesu123
Copy link
Copy Markdown
Contributor Author

#1440
Hang up until the npm version is fixed.

@SameDesu123 SameDesu123 marked this pull request as ready for review June 3, 2026 09:25
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