Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Tauri v2 #860

Merged
merged 2 commits into from
Jul 5, 2024
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
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ group :test do
gem 'rspec-rails', '~> 6.0.3'
gem 'rspec-expectations', '~> 3.12.1'
gem 'anbt-sql-formatter'
gem 'factory_bot_rails', '~> 6.2'
gem 'factory_bot_rails', '~> 6.4'
gem 'database_cleaner', '~> 2.0'
gem 'webmock', '~> 3.14.0'
gem 'elif', '~> 0.1.0'
Expand Down
8 changes: 4 additions & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,10 @@ GEM
erubis (2.7.0)
et-orbi (1.2.7)
tzinfo
factory_bot (6.2.1)
factory_bot (6.4.6)
activesupport (>= 5.0.0)
factory_bot_rails (6.2.0)
factory_bot (~> 6.2.0)
factory_bot_rails (6.4.3)
factory_bot (~> 6.4)
railties (>= 5.0.0)
faker (2.20.0)
i18n (>= 1.8.11, < 2)
Expand Down Expand Up @@ -526,7 +526,7 @@ DEPENDENCIES
dotenv-rails
ed25519
elif (~> 0.1.0)
factory_bot_rails (~> 6.2)
factory_bot_rails (~> 6.4)
faker (~> 2.20.0)
haml-rails
has_scope
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,26 @@ def show

artifacts = authorized_scope(upgrade.artifacts)
artifact = artifacts.joins(:platform, :arch, :filetype)
.where.not(filetype: { key: %w[sig] })
.reorder(
# NOTE(ezekg) Order so that NSIS always takes precedence
# over deprecated MSI on conflict.
# NOTE(ezekg) Prioritize Tauri v1 update bundles over Tauri v2 for backwards
# compatibility, as v2 dropped most compressed formats. We also
# let NSIS take precedence over deprecated MSI.
#
# 1. For Tauri v1, `.zip` and `.gz` take precedence over uncompressed formats.
# 2. For Tauri v1, `.nsis.zip` takes precedence `.msi.zip`.
# 3. For Tauri v2, `.exe` takes precedence over `.msi`.
#
# Since Tauri v2 no longer produces most compressed formats,
# this should be backwards compatible.
Arel.sql(<<~SQL.squish)
release_artifacts.filename ILIKE ANY (ARRAY['%.zip', '%.gz']) DESC,
release_artifacts.filename ILIKE '%.nsis.zip' DESC,
release_artifacts.filename ILIKE '%.exe' DESC,
release_artifacts.created_at DESC
SQL
)
.find_by!(
filetype: { key: %w[gz zip] },
platform: { key: platform },
arch: { key: arch },
)
Expand All @@ -54,7 +64,7 @@ def show
},
)

# See: https://tauri.app/v1/guides/distribution/updater
# See: https://v2.tauri.app/plugin/updater/#dynamic-update-server
render json: {
url: vanity_v1_account_release_artifact_url(artifact.account, artifact, filename: artifact.filename),
signature: artifact.signature,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@api/v1
Feature: Tauri upgrade package
Feature: Tauri v1 upgrade application
Background:
Given the following "accounts" exist:
| name | slug |
Expand Down
Loading