Skip to content

Commit

Permalink
Migrate to tauri 2.0.0 (#194)
Browse files Browse the repository at this point in the history
  • Loading branch information
hrzlgnm authored Oct 2, 2024
1 parent 1265328 commit ab0ece8
Show file tree
Hide file tree
Showing 13 changed files with 561 additions and 519 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/auto-bump-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,18 @@ jobs:
- name: Check out the repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4

- name: Bump version in tauri.conf.json
- name: Bump version in tauri.conf.json and tauri.android.conf.json
id: bump_version
run: |
CURRENT_VERSION=$(jq -r '.package.version' src-tauri/tauri.conf.json)
CURRENT_VERSION=$(jq -r '.version' src-tauri/tauri.conf.json)
IFS='.' read -r -a VERSION_PARTS <<< "$CURRENT_VERSION"
MAJOR=${VERSION_PARTS[0]}
MINOR=${VERSION_PARTS[1]}
PATCH=${VERSION_PARTS[2]}
NEW_PATCH=$((PATCH + 1))
NEW_VERSION="$MAJOR.$MINOR.$NEW_PATCH"
jq --indent 4 ".package.version = \"$NEW_VERSION\"" src-tauri/tauri.conf.json > src-tauri/tauri.conf.json.tmp && mv src-tauri/tauri.conf.json.tmp src-tauri/tauri.conf.json
jq --indent 4 ".version = \"$NEW_VERSION\"" src-tauri/tauri.conf.json > src-tauri/tauri.conf.json.tmp && mv src-tauri/tauri.conf.json.tmp src-tauri/tauri.conf.json
jq --indent 4 ".version = \"$NEW_VERSION\"" src-tauri/tauri.android.conf.json > src-tauri/tauri.android.conf.json.tmp && mv src-tauri/tauri.android.conf.json.tmp src-tauri/tauri.android.conf.json
echo "new_version=$NEW_VERSION" >> "$GITHUB_ENV"
- name: Create Pull Request
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/refresh-main-tool-caches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@ jobs:
- name: cached install tauri-cli
uses: taiki-e/cache-cargo-install-action@caa6f48d18d42462f9c30df89e2b4f71a42b7c2c # v2.0.1
with:
tool: tauri-cli
tool: tauri-cli@2.0.0
locked: true
12 changes: 3 additions & 9 deletions .github/workflows/tauri-pr-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,20 +108,14 @@ jobs:
- name: Cached install tauri-cli
uses: taiki-e/cache-cargo-install-action@caa6f48d18d42462f9c30df89e2b4f71a42b7c2c # v2.0.1
with:
tool: tauri-cli@1.6.2
tool: tauri-cli@2.0.0
locked: true

- name: Build using tauri action
uses: tauri-apps/tauri-action@8c3e0753aa015d00d03631d6d4f64ad59489251d # v0.5.15
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
with:
tauriScript: cargo --locked auditable tauri

- name: Upload build artifacts
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
with:
name: "bundles-${{matrix.platform}}${{matrix.args}}"
path: target/release/bundle
6 changes: 3 additions & 3 deletions .github/workflows/tauri-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,15 @@ jobs:
- name: Cached install tauri-cli
uses: taiki-e/cache-cargo-install-action@caa6f48d18d42462f9c30df89e2b4f71a42b7c2c # v2.0.1
with:
tool: tauri-cli@1.6.2
tool: tauri-cli@2.0.0
locked: true

- name: Build using tauri action
uses: tauri-apps/tauri-action@8c3e0753aa015d00d03631d6d4f64ad59489251d # v0.5.15
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
with:
tagName: mdns-browser-v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version
releaseName: "mDNS-Browser Release v__VERSION__"
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ log = "0.4.22"
serde = { version = "1.0.210", features = ["derive"] }
serde-wasm-bindgen = "0.6.5"
strsim = "0.11.1"
tauri-sys = { git = "https://github.com/JonasKruckenberg/tauri-sys", rev = "3e93a42", features = [
tauri-sys = { git = "https://github.com/JonasKruckenberg/tauri-sys", branch = "v2", features = [
"core",
"event",
"tauri",
] }
thaw = { version = "0.3.4", features = ["csr"] }
thaw_utils = { version = "0.0.6", features = ["csr"] }
Expand Down
27 changes: 11 additions & 16 deletions src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,22 @@ authors = ["hrzlgnm"]
edition = "2021"

[build-dependencies]
tauri-build = { version = "1.5.5", features = [] }
tauri-build = { version = "2.0.0", features = [] }

[target."cfg(not(any(target_os = \"android\", target_os = \"ios\")))".dependencies]
tauri-plugin-updater = "2.0.0"

[dependencies]
clap = { version = "4.5.17", features = ["derive"] }
clap = { version = "4.5.19", features = ["derive"] }
log = "0.4.22"
mdns-sd = { version = "0.11.4", features = ["async", "log"] }
open = "5"
serde = { version = "1.0.210", features = ["derive"] }
serde_json = "1.0.128"
tauri = { version = "1.8.0", features = [
"dialog-ask",
"http-api",
"http-request",
"process-exit",
"process-relaunch",
"shell-open",
"updater",
"window-all",
] }
tauri-plugin-log = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v1" }
tauri = { version = "2.0.0", features = [] }
tauri-plugin-log = "2.0.0"
tauri-plugin-shell = "2.0.0"

[features]
# This feature is used for production builds or when a dev server is not specified, DO NOT REMOVE!!
custom-protocol = ["tauri/custom-protocol"]
[lib]
name = "mdns_browser_lib"
crate-type = ["staticlib", "cdylib", "lib"]
17 changes: 17 additions & 0 deletions src-tauri/capabilities/migrated.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"identifier": "migrated",
"description": "permissions that were migrated from v1",
"local": true,
"windows": [
"main"
],
"permissions": [
"core:default",
"updater:default"
],
"platforms": [
"macOS",
"windows",
"linux"
]
}
14 changes: 14 additions & 0 deletions src-tauri/capabilities/mobile.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"identifier": "mobile",
"description": "permissions for mobile",
"local": true,
"windows": [
"main"
],
"permissions": [
"core:default"
],
"platforms": [
"android"
]
}
Loading

0 comments on commit ab0ece8

Please sign in to comment.