mirror of
https://github.com/tauri-apps/tauri.git
synced 2026-04-11 10:43:31 +02:00
Compare commits
3 Commits
feat/refer
...
feat/cli/k
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0fa69531ea | ||
|
|
32c61f8f23 | ||
|
|
7b8c23aa37 |
@@ -1,9 +0,0 @@
|
||||
[advisories]
|
||||
ignore = [
|
||||
# rsa Marvin Attack
|
||||
"RUSTSEC-2023-0071",
|
||||
# difference is unmaintained
|
||||
"RUSTSEC-2020-0095",
|
||||
# proc-macro-error is unmaintained
|
||||
"RUSTSEC-2024-0370",
|
||||
]
|
||||
2
.cargo/config
Normal file
2
.cargo/config
Normal file
@@ -0,0 +1,2 @@
|
||||
[env]
|
||||
__TAURI_WORKSPACE__ = "true"
|
||||
@@ -1,4 +0,0 @@
|
||||
[env]
|
||||
# workaround needed to prevent `STATUS_ENTRYPOINT_NOT_FOUND` error in tests
|
||||
# see https://github.com/tauri-apps/tauri/pull/4383#issuecomment-1212221864
|
||||
__TAURI_WORKSPACE__ = "true"
|
||||
5
.changes/add-section-priority-changelog.md
Normal file
5
.changes/add-section-priority-changelog.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"tauri-bundler": patch:feat
|
||||
---
|
||||
|
||||
Add `priority`, `section` and `changelog` options in Debian config.
|
||||
5
.changes/bundler-socks-proxy.md
Normal file
5
.changes/bundler-socks-proxy.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"tauri-bundler": patch:enhance
|
||||
---
|
||||
|
||||
Support using socks proxy from environment when downloading files.
|
||||
6
.changes/cli-dev-profile.md
Normal file
6
.changes/cli-dev-profile.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
'tauri-cli': 'patch:bug'
|
||||
'@tauri-apps/cli': 'patch:bug'
|
||||
---
|
||||
|
||||
Fix `fail to rename app` when using `--profile dev`.
|
||||
6
.changes/cli-devserver-queryparam.md
Normal file
6
.changes/cli-devserver-queryparam.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"tauri-cli": patch:bug
|
||||
"@tauri-apps/cli": patch:bug
|
||||
---
|
||||
|
||||
Fix the built-in dev server failing to serve files when URL had queries `?` and other url components.
|
||||
5
.changes/cli-js-kill-dev-fn.md
Normal file
5
.changes/cli-js-kill-dev-fn.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@tauri-apps/cli': 'minor:feat'
|
||||
---
|
||||
|
||||
Add `killDevApp` API to kill the dev app process manually.
|
||||
5
.changes/cli-rs-kill-dev-fn.md
Normal file
5
.changes/cli-rs-kill-dev-fn.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'tauri-cli': 'minor:feat'
|
||||
---
|
||||
|
||||
Add `tauri_cli::kill_dev_app` API to kill the dev app process manually.
|
||||
6
.changes/cli-watch-ws-members.md
Normal file
6
.changes/cli-watch-ws-members.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"tauri-cli": patch:bug
|
||||
"@tauri-apps/cli": patch:bug
|
||||
---
|
||||
|
||||
The cli now also watches cargo workspace members if the tauri folder is the workspace root.
|
||||
@@ -4,7 +4,7 @@
|
||||
"feat": "New Features",
|
||||
"enhance": "Enhancements",
|
||||
"bug": "Bug Fixes",
|
||||
"perf": "Performance Improvements",
|
||||
"pref": "Performance Improvements",
|
||||
"changes": "What's Changed",
|
||||
"sec": "Security fixes",
|
||||
"deps": "Dependencies",
|
||||
@@ -13,26 +13,24 @@
|
||||
"defaultChangeTag": "changes",
|
||||
"pkgManagers": {
|
||||
"rust": {
|
||||
"errorOnVersionRange": "^2.0.0-0",
|
||||
"version": true,
|
||||
"getPublishedVersion": {
|
||||
"use": "fetch:check",
|
||||
"options": {
|
||||
"url": "https://crates.io/api/v1/crates/${ pkg.pkgFile.pkg.package.name }/${ pkg.pkgFile.version }"
|
||||
}
|
||||
},
|
||||
"getPublishedVersion": "node ../../.scripts/covector/package-latest-version.js cargo ${ pkgFile.pkg.package.name } ${ pkgFile.pkg.package.version }",
|
||||
"prepublish": [
|
||||
"sudo apt-get update",
|
||||
"sudo apt-get install -y webkit2gtk-4.0 libayatana-appindicator3-dev",
|
||||
"cargo install cargo-audit --features=fix",
|
||||
{
|
||||
"command": "echo '<details>\n<summary><em><h4>Cargo Audit</h4></em></summary>\n\n```'",
|
||||
"dryRunCommand": true,
|
||||
"pipe": true
|
||||
},
|
||||
{
|
||||
"command": "cargo generate-lockfile",
|
||||
"dryRunCommand": true,
|
||||
"runFromRoot": true,
|
||||
"pipe": true
|
||||
},
|
||||
{
|
||||
"command": "echo '<details>\n<summary><em><h4>Cargo Audit</h4></em></summary>\n\n```'",
|
||||
"dryRunCommand": true,
|
||||
"pipe": true
|
||||
},
|
||||
{
|
||||
"command": "cargo audit ${ process.env.CARGO_AUDIT_OPTIONS || '' }",
|
||||
"dryRunCommand": true,
|
||||
@@ -46,6 +44,11 @@
|
||||
}
|
||||
],
|
||||
"publish": [
|
||||
"sleep 15s",
|
||||
{
|
||||
"command": "cargo package --no-verify",
|
||||
"dryRunCommand": true
|
||||
},
|
||||
{
|
||||
"command": "echo '<details>\n<summary><em><h4>Cargo Publish</h4></em></summary>\n\n```'",
|
||||
"dryRunCommand": true,
|
||||
@@ -62,34 +65,34 @@
|
||||
"pipe": true
|
||||
}
|
||||
],
|
||||
"postpublish": {
|
||||
"use": "fetch:check",
|
||||
"options": {
|
||||
"url": "https://crates.io/api/v1/crates/${ pkg.pkgFile.pkg.package.name }/${ pkg.pkgFile.version }"
|
||||
},
|
||||
"retries": [5000, 5000, 5000]
|
||||
}
|
||||
"postpublish": [
|
||||
"git tag ${ pkg.pkg }-v${ pkgFile.versionMajor } -f",
|
||||
"git tag ${ pkg.pkg }-v${ pkgFile.versionMajor }.${ pkgFile.versionMinor } -f",
|
||||
"git push --tags -f"
|
||||
],
|
||||
"assets": [
|
||||
{
|
||||
"path": "${ pkg.path }/target/package/${ pkg.pkg }-${ pkgFile.version }.crate",
|
||||
"name": "${ pkg.pkg }-${ pkgFile.version }.crate"
|
||||
}
|
||||
]
|
||||
},
|
||||
"javascript": {
|
||||
"errorOnVersionRange": "^2.0.0-0",
|
||||
"version": true,
|
||||
"getPublishedVersion": {
|
||||
"use": "fetch:check",
|
||||
"options": {
|
||||
"url": "https://registry.npmjs.com/${ pkg.pkgFile.pkg.name }/${ pkg.pkgFile.version }"
|
||||
}
|
||||
},
|
||||
"getPublishedVersion": "node ../../.scripts/covector/package-latest-version.js npm ${ pkgFile.pkg.name } ${ pkgFile.pkg.version }",
|
||||
"prepublish": [
|
||||
{
|
||||
"command": "echo '<details>\n<summary><em><h4>PNPM Audit</h4></em></summary>\n\n```'",
|
||||
"command": "yarn",
|
||||
"dryRunCommand": true
|
||||
},
|
||||
{
|
||||
"command": "echo '<details>\n<summary><em><h4>Yarn Audit</h4></em></summary>\n\n```'",
|
||||
"dryRunCommand": true,
|
||||
"pipe": true
|
||||
},
|
||||
{
|
||||
"command": "pnpm i --frozen-lockfile",
|
||||
"dryRunCommand": true
|
||||
},
|
||||
{
|
||||
"command": "pnpm audit",
|
||||
"command": "yarn audit",
|
||||
"dryRunCommand": true,
|
||||
"runFromRoot": true,
|
||||
"pipe": true
|
||||
@@ -98,17 +101,22 @@
|
||||
"command": "echo '```\n\n</details>\n'",
|
||||
"dryRunCommand": true,
|
||||
"pipe": true
|
||||
},
|
||||
{
|
||||
"command": "npm pack",
|
||||
"dryRunCommand": true
|
||||
}
|
||||
],
|
||||
"publish": [
|
||||
"sleep 15s",
|
||||
{
|
||||
"command": "echo '<details>\n<summary><em><h4>PNPM Publish</h4></em></summary>\n\n```'",
|
||||
"command": "echo '<details>\n<summary><em><h4>Yarn Publish</h4></em></summary>\n\n```'",
|
||||
"dryRunCommand": true,
|
||||
"pipe": true
|
||||
},
|
||||
{
|
||||
"command": "pnpm publish --access public --loglevel silly --no-git-checks",
|
||||
"dryRunCommand": "npm publish --dry-run --access public --no-git-checks",
|
||||
"command": "yarn publish --access public --loglevel silly",
|
||||
"dryRunCommand": "npm publish --dry-run --access public",
|
||||
"pipe": true
|
||||
},
|
||||
{
|
||||
@@ -117,27 +125,57 @@
|
||||
"pipe": true
|
||||
}
|
||||
],
|
||||
"postpublish": {
|
||||
"use": "fetch:check",
|
||||
"options": {
|
||||
"url": "https://registry.npmjs.com/${ pkg.pkgFile.pkg.name }/${ pkg.pkgFile.version }"
|
||||
},
|
||||
"retries": [5000, 5000, 5000]
|
||||
}
|
||||
"postpublish": [
|
||||
"git tag ${ pkg.pkg }-v${ pkgFile.versionMajor } -f",
|
||||
"git tag ${ pkg.pkg }-v${ pkgFile.versionMajor }.${ pkgFile.versionMinor } -f",
|
||||
"git push --tags -f"
|
||||
]
|
||||
}
|
||||
},
|
||||
"packages": {
|
||||
"@tauri-apps/api": {
|
||||
"path": "./packages/api",
|
||||
"path": "./tooling/api",
|
||||
"manager": "javascript",
|
||||
"publish": [
|
||||
"assets": [
|
||||
{
|
||||
"command": "echo '<details>\n<summary><em><h4>PNPM Publish</h4></em></summary>\n\n```'",
|
||||
"path": "./tooling/api/dist/tauri-apps-api-${ pkgFile.version }.tgz",
|
||||
"name": "tauri-apps-api-${ pkgFile.version }.tgz"
|
||||
}
|
||||
],
|
||||
"prepublish": [
|
||||
{
|
||||
"command": "yarn",
|
||||
"dryRunCommand": true
|
||||
},
|
||||
{
|
||||
"command": "echo '<details>\n<summary><em><h4>Yarn Audit</h4></em></summary>\n\n```'",
|
||||
"dryRunCommand": true,
|
||||
"pipe": true
|
||||
},
|
||||
{
|
||||
"command": "pnpm npm-publish",
|
||||
"command": "yarn audit",
|
||||
"dryRunCommand": true,
|
||||
"runFromRoot": true,
|
||||
"pipe": true
|
||||
},
|
||||
{
|
||||
"command": "echo '```\n\n</details>\n'",
|
||||
"dryRunCommand": true,
|
||||
"pipe": true
|
||||
},
|
||||
{
|
||||
"command": "yarn npm-pack",
|
||||
"dryRunCommand": true
|
||||
}
|
||||
],
|
||||
"publish": [
|
||||
{
|
||||
"command": "echo '<details>\n<summary><em><h4>Yarn Publish</h4></em></summary>\n\n```'",
|
||||
"dryRunCommand": true,
|
||||
"pipe": true
|
||||
},
|
||||
{
|
||||
"command": "yarn npm-publish",
|
||||
"dryRunCommand": true,
|
||||
"pipe": true
|
||||
},
|
||||
@@ -149,82 +187,92 @@
|
||||
]
|
||||
},
|
||||
"tauri-utils": {
|
||||
"path": "./crates/tauri-utils",
|
||||
"manager": "rust"
|
||||
},
|
||||
"tauri-macos-sign": {
|
||||
"path": "./crates/tauri-macos-sign",
|
||||
"path": "./core/tauri-utils",
|
||||
"manager": "rust"
|
||||
},
|
||||
"tauri-bundler": {
|
||||
"path": "./crates/tauri-bundler",
|
||||
"path": "./tooling/bundler",
|
||||
"manager": "rust",
|
||||
"dependencies": ["tauri-utils", "tauri-macos-sign"]
|
||||
"dependencies": ["tauri-utils"]
|
||||
},
|
||||
"tauri-runtime": {
|
||||
"path": "./crates/tauri-runtime",
|
||||
"path": "./core/tauri-runtime",
|
||||
"manager": "rust",
|
||||
"dependencies": ["tauri-utils"]
|
||||
},
|
||||
"tauri-runtime-wry": {
|
||||
"path": "./crates/tauri-runtime-wry",
|
||||
"path": "./core/tauri-runtime-wry",
|
||||
"manager": "rust",
|
||||
"dependencies": ["tauri-utils", "tauri-runtime"]
|
||||
},
|
||||
"tauri-codegen": {
|
||||
"path": "./crates/tauri-codegen",
|
||||
"path": "./core/tauri-codegen",
|
||||
"manager": "rust",
|
||||
"dependencies": ["tauri-utils"]
|
||||
},
|
||||
"tauri-macros": {
|
||||
"path": "./crates/tauri-macros",
|
||||
"path": "./core/tauri-macros",
|
||||
"manager": "rust",
|
||||
"dependencies": ["tauri-codegen", "tauri-utils"]
|
||||
},
|
||||
"tauri-plugin": {
|
||||
"path": "./crates/tauri-plugin",
|
||||
"manager": "rust",
|
||||
"dependencies": ["tauri-utils"],
|
||||
"postversion": "node ../../.scripts/ci/sync-cli-metadata.js ${ pkg.pkg } ${ release.type }"
|
||||
},
|
||||
"tauri-build": {
|
||||
"path": "./crates/tauri-build",
|
||||
"path": "./core/tauri-build",
|
||||
"manager": "rust",
|
||||
"dependencies": ["tauri-codegen", "tauri-utils"],
|
||||
"postversion": "node ../../.scripts/ci/sync-cli-metadata.js ${ pkg.pkg } ${ release.type }"
|
||||
"postversion": [
|
||||
"node ../../.scripts/covector/sync-cli-metadata.js ${ pkg.pkg } ${ release.type }",
|
||||
"cargo build --manifest-path ../tauri-config-schema/Cargo.toml"
|
||||
],
|
||||
"assets": [
|
||||
{
|
||||
"path": "./tooling/cli/schema.json",
|
||||
"name": "schema.json"
|
||||
}
|
||||
]
|
||||
},
|
||||
"tauri": {
|
||||
"path": "./crates/tauri",
|
||||
"path": "./core/tauri",
|
||||
"manager": "rust",
|
||||
"dependencies": [
|
||||
"tauri-macros",
|
||||
"tauri-utils",
|
||||
"tauri-runtime",
|
||||
"tauri-runtime-wry",
|
||||
"tauri-build"
|
||||
"tauri-runtime-wry"
|
||||
],
|
||||
"postversion": [
|
||||
"node ../../.scripts/ci/sync-cli-metadata.js ${ pkg.pkg } ${ release.type }",
|
||||
"cargo build --manifest-path ../tauri-schema-generator/Cargo.toml"
|
||||
]
|
||||
"postversion": "node ../../.scripts/covector/sync-cli-metadata.js ${ pkg.pkg } ${ release.type }"
|
||||
},
|
||||
"@tauri-apps/cli": {
|
||||
"path": "./packages/cli",
|
||||
"path": "./tooling/cli/node",
|
||||
"manager": "javascript",
|
||||
"getPublishedVersion": "node ../../../.scripts/covector/package-latest-version.js npm ${ pkgFile.pkg.name } ${ pkgFile.pkg.version }",
|
||||
"dependencies": ["tauri-cli"],
|
||||
"postversion": "node ../../.scripts/ci/sync-cli-metadata.js ${ pkg.pkg } ${ release.type }",
|
||||
"postversion": [
|
||||
"node ../../../.scripts/covector/sync-cli-metadata.js ${ pkg.pkg } ${ release.type }",
|
||||
"cargo build --manifest-path ../../../core/tauri-config-schema/Cargo.toml"
|
||||
],
|
||||
"prepublish": [],
|
||||
"publish": [],
|
||||
"postpublish": []
|
||||
},
|
||||
"tauri-cli": {
|
||||
"path": "./crates/tauri-cli",
|
||||
"path": "./tooling/cli",
|
||||
"manager": "rust",
|
||||
"dependencies": ["tauri-bundler", "tauri-utils", "tauri-macos-sign"]
|
||||
"dependencies": ["tauri-bundler", "tauri-utils"],
|
||||
"postversion": [
|
||||
"cargo check",
|
||||
"cargo build --manifest-path ../../core/tauri-config-schema/Cargo.toml"
|
||||
],
|
||||
"assets": [
|
||||
{
|
||||
"path": "${ pkg.path }/target/package/tauri-cli-${ pkgFile.version }.crate",
|
||||
"name": "${ pkg.pkg }-${ pkgFile.version }.crate"
|
||||
}
|
||||
]
|
||||
},
|
||||
"tauri-driver": {
|
||||
"path": "./crates/tauri-driver",
|
||||
"manager": "rust"
|
||||
"path": "./tooling/webdriver",
|
||||
"manager": "rust",
|
||||
"postversion": "cargo check"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
5
.changes/export-url.md
Normal file
5
.changes/export-url.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'tauri': 'patch:feat'
|
||||
---
|
||||
|
||||
Re-export `Url` type.
|
||||
5
.changes/fix-command-spawn-deadlock.md
Normal file
5
.changes/fix-command-spawn-deadlock.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"tauri": patch:bug
|
||||
---
|
||||
|
||||
Fixes a deadlock when reading a stdout or stderr line returns an error.
|
||||
5
.changes/fix-formbody-order.md
Normal file
5
.changes/fix-formbody-order.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'tauri': 'patch:bug'
|
||||
---
|
||||
|
||||
Preserve the order of JS object/map keys in IPC calls. This also fixes issues with the JS `http` module when calling to servers that required a specific order of `FormBody` contents.
|
||||
6
.changes/fix-non-standard-permission-bug.md
Normal file
6
.changes/fix-non-standard-permission-bug.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
'tauri-bundler': 'patch:bug'
|
||||
---
|
||||
|
||||
|
||||
Fix the `non-standard-file-perm` and `non-standard-dir-perm` issue in Debian packages
|
||||
5
.changes/libflate-to-flate2.md
Normal file
5
.changes/libflate-to-flate2.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"tauri-bundler": patch:deps
|
||||
---
|
||||
|
||||
Replace `libflate` with `flate2` , this will help to provide additional functionalities and features.
|
||||
6
.changes/mac-bundler-nested-code-sign.md
Normal file
6
.changes/mac-bundler-nested-code-sign.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"tauri-cli": patch:feat
|
||||
"tauri-bundler": patch:feat
|
||||
---
|
||||
|
||||
On macOS, support for signing nested .dylib, .app, .xpc and .framework under predefined directories inside the bundled frameworks ("MacOS", "Frameworks", "Plugins", "Helpers", "XPCServices" and "Libraries").
|
||||
@@ -10,8 +10,8 @@ Use the following format:
|
||||
|
||||
```md
|
||||
---
|
||||
'package-a': 'patch:enhance'
|
||||
'package-b': 'patch:enhance'
|
||||
'package-a': patch
|
||||
'package-b': patch
|
||||
---
|
||||
|
||||
Change summary goes here
|
||||
@@ -33,7 +33,7 @@ Additionally you could specify a tag for the change file to group it with other
|
||||
|
||||
```md
|
||||
---
|
||||
'package-a': 'patch:enhance'
|
||||
'package-a': patch:bug
|
||||
---
|
||||
|
||||
Change summary goes here
|
||||
5
.changes/runtime-wry-wayland.md
Normal file
5
.changes/runtime-wry-wayland.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
tauri-runtime-wry: patch:bug
|
||||
---
|
||||
|
||||
Add missing `arboard` feature flag to prevent panics in wayland session.
|
||||
5
.changes/tauri-bundler-nsis-args.md
Normal file
5
.changes/tauri-bundler-nsis-args.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'tauri-bundler': 'minor:feat'
|
||||
---
|
||||
|
||||
On Windows, NSIS installer now supports `/ARGS` flag to pass arguments to be used when launching the app after installation, only works if `/R` is used.
|
||||
5
.changes/tauri-data-drag-region-macos-maximize.md
Normal file
5
.changes/tauri-data-drag-region-macos-maximize.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'tauri': 'patch:bug'
|
||||
---
|
||||
|
||||
On macOS, allow cancelling maximization when doubleclick happens on `data-tauri-drag-region` by simply keeping the left moust button pressed and then moving the mouse away of the starting position of the click, which is consistent with the native behavior of macOS.
|
||||
5
.changes/tauri-updater-retain-args.md
Normal file
5
.changes/tauri-updater-retain-args.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'tauri': 'minor:enhance'
|
||||
---
|
||||
|
||||
On Windows, retain command line args when relaunching the app after an update. Supports NSIS and WiX (without elevated update task).
|
||||
@@ -5,8 +5,8 @@ FROM mcr.microsoft.com/vscode/devcontainers/base:0-${VARIANT}
|
||||
|
||||
# Derived from Tauri contribution and setup guides:
|
||||
# See: https://github.com/tauri-apps/tauri/blob/dev/.github/CONTRIBUTING.md#development-guide
|
||||
# See: https://v2.tauri.app/start/prerequisites/
|
||||
ARG TAURI_BUILD_DEPS="build-essential curl libappindicator3-dev libgtk-3-dev librsvg2-dev libssl-dev libwebkit2gtk-4.1-dev wget"
|
||||
# See: https://tauri.app/v1/guides/getting-started/prerequisites/#setting-up-linux
|
||||
ARG TAURI_BUILD_DEPS="build-essential curl libappindicator3-dev libgtk-3-dev librsvg2-dev libssl-dev libwebkit2gtk-4.0-dev wget"
|
||||
|
||||
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
|
||||
&& apt-get install -y --no-install-recommends $TAURI_BUILD_DEPS
|
||||
|
||||
@@ -24,7 +24,7 @@ Prerequisites are mainly derived from VS Code's instructions for usage of develo
|
||||
|
||||
### A note on filesystem performance
|
||||
|
||||
Due to limitations in how Docker shares files between the Docker host and a container, it's also recommended that developers [clone Tauri source code into a container volume](https://code.visualstudio.com/remote/advancedcontainers/improve-performance#_use-clone-repository-in-container-volume). This is optional, but highly advised as many filesystem/IO heavy operations (`cargo build`, `pnpm install`, etc) will be very slow if they operate on directories shared with a Docker container from the Docker host.
|
||||
Due to limitations in how Docker shares files between the Docker host and a container, it's also recommended that developers [clone Tauri source code into a container volume](https://code.visualstudio.com/remote/advancedcontainers/improve-performance#_use-clone-repository-in-container-volume). This is optional, but highly advised as many filesystem/IO heavy operations (`cargo build`, `yarn install`, etc) will be very slow if they operate on directories shared with a Docker container from the Docker host.
|
||||
|
||||
To do this, open your project with VS Code and run **Remote-Containers: Clone Repository in Container Volume...** from the Command Palette (<kbd>F1</kbd>).
|
||||
|
||||
@@ -33,7 +33,6 @@ To do this, open your project with VS Code and run **Remote-Containers: Clone Re
|
||||
Docker Desktop provides facilities for [allowing the development container to connect to a service on the Docker host](https://docs.docker.com/desktop/windows/networking/#i-want-to-connect-from-a-container-to-a-service-on-the-host). So long as you have an X window server running on your Docker host, the devcontainer can connect to it and expose your Tauri GUI via an X window.
|
||||
|
||||
**Export the `DISPLAY` variable within the devcontainer terminal you launch your Tauri application from to expose your GUI outside of the devcontainer**.
|
||||
|
||||
```bash
|
||||
export DISPLAY="host.docker.internal:0"
|
||||
```
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM ubuntu:22.04
|
||||
FROM ubuntu:18.04
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
COPY common.sh lib.sh /
|
||||
@@ -41,4 +41,4 @@ ENV CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc \
|
||||
|
||||
RUN dpkg --add-architecture arm64
|
||||
RUN apt-get update
|
||||
RUN apt-get install --assume-yes --no-install-recommends libssl-dev:arm64 libdbus-1-dev:arm64 libsoup2.4-dev:arm64 libssl-dev:arm64 libgtk-3-dev:arm64 webkit2gtk-4.1-dev:arm64 libappindicator3-1:arm64 librsvg2-dev:arm64 patchelf:arm64
|
||||
RUN apt-get install --assume-yes --no-install-recommends libssl-dev:arm64 libdbus-1-dev:arm64 libsoup2.4-dev:arm64 libssl-dev:arm64 libgtk-3-dev:arm64 webkit2gtk-4.0-dev:arm64 libappindicator3-1:arm64 librsvg2-dev:arm64 patchelf:arm64
|
||||
|
||||
23
.github/CODE_OF_CONDUCT.md
vendored
23
.github/CODE_OF_CONDUCT.md
vendored
@@ -1,3 +1,4 @@
|
||||
|
||||
# Contributor Covenant Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
@@ -17,23 +18,23 @@ diverse, inclusive, and healthy community.
|
||||
Examples of behavior that contributes to a positive environment for our
|
||||
community include:
|
||||
|
||||
- Demonstrating empathy and kindness toward other people
|
||||
- Being respectful of differing opinions, viewpoints, and experiences
|
||||
- Giving and gracefully accepting constructive feedback
|
||||
- Accepting responsibility and apologizing to those affected by our mistakes,
|
||||
* Demonstrating empathy and kindness toward other people
|
||||
* Being respectful of differing opinions, viewpoints, and experiences
|
||||
* Giving and gracefully accepting constructive feedback
|
||||
* Accepting responsibility and apologizing to those affected by our mistakes,
|
||||
and learning from the experience
|
||||
- Focusing on what is best not just for us as individuals, but for the overall
|
||||
* Focusing on what is best not just for us as individuals, but for the overall
|
||||
community
|
||||
|
||||
Examples of unacceptable behavior include:
|
||||
|
||||
- The use of sexualized language or imagery, and sexual attention or advances of
|
||||
* The use of sexualized language or imagery, and sexual attention or advances of
|
||||
any kind
|
||||
- Trolling, insulting or derogatory comments, and personal or political attacks
|
||||
- Public or private harassment
|
||||
- Publishing others' private information, such as a physical or email address,
|
||||
* Trolling, insulting or derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or email address,
|
||||
without their explicit permission
|
||||
- Other conduct which could reasonably be considered inappropriate in a
|
||||
* Other conduct which could reasonably be considered inappropriate in a
|
||||
professional setting
|
||||
|
||||
## Enforcement Responsibilities
|
||||
@@ -129,4 +130,4 @@ For answers to common questions about this code of conduct, see the FAQ at
|
||||
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
|
||||
[Mozilla CoC]: https://github.com/mozilla/diversity
|
||||
[FAQ]: https://www.contributor-covenant.org/faq
|
||||
[translations]: https://www.contributor-covenant.org/translations
|
||||
[translations]: https://www.contributor-covenant.org/translations
|
||||
61
.github/CONTRIBUTING.md
vendored
61
.github/CONTRIBUTING.md
vendored
@@ -22,7 +22,7 @@ Hi! We, the maintainers, are really excited that you are interested in contribut
|
||||
|
||||
- Issues with no clear repro steps will not be triaged. If an issue labeled "need repro" receives no further input from the issue author for more than 5 days, it will be closed.
|
||||
|
||||
- If your issue is resolved but still open, don't hesitate to close it. In case you found a solution by yourself, it could be helpful to explain how you fixed it.
|
||||
- If your issue is resolved but still open, don’t hesitate to close it. In case you found a solution by yourself, it could be helpful to explain how you fixed it.
|
||||
|
||||
- Most importantly, we beg your patience: the team must balance your request against many other responsibilities — fixing other bugs, answering other questions, new features, new documentation, etc. The issue list is not paid support and we cannot make guarantees about how fast your issue can be resolved.
|
||||
|
||||
@@ -37,75 +37,54 @@ Hi! We, the maintainers, are really excited that you are interested in contribut
|
||||
- Provide convincing reason to add this feature. Ideally you should open a suggestion issue first and have it greenlighted before working on it.
|
||||
|
||||
- If fixing a bug:
|
||||
|
||||
- If you are resolving a special issue, add `(fix: #xxxx[,#xxx])` (#xxxx is the issue id) in your PR title for a better release log, e.g. `fix: update entities encoding/decoding (fix #3899)`.
|
||||
- Provide detailed description of the bug in the PR, or link to an issue that does.
|
||||
|
||||
- If the PR is meant to be released, follow the instructions in `.changes/readme.md` to log your changes. ie. [readme.md](https://github.com/tauri-apps/tauri/blob/dev/.changes/README.md)
|
||||
|
||||
## Development Guide
|
||||
|
||||
**NOTE: If you have any question don't hesitate to ask in our Discord server. We try to keep this guide to up guide, but if something doesn't work let us know.**
|
||||
**NOTE: Tauri is undergoing rapid development right now, and the docs match the latest published version of Tauri. They are horribly out of date when compared with the code in the dev branch. This contributor guide is up-to-date, but it doesn't cover all of Tauri's functions in depth. If you have any questions, don't hesitate to ask in our Discord server.**
|
||||
|
||||
### General Setup
|
||||
|
||||
First, [join our Discord server](https://discord.gg/SpmNs4S) and let us know that you want to contribute. This way we can point you in the right direction and help ensure your contribution will be as helpful as possible.
|
||||
|
||||
To set up your machine for development, follow the [Tauri setup guide](https://v2.tauri.app/start/prerequisites/) to get all the tools you need to develop Tauri apps. The only additional tool you may need is [PNPM](https://pnpm.io/), it is only required if you are developing the Node CLI or API packages (`packages/cli` and `packages/api`).
|
||||
To set up your machine for development, follow the [Tauri setup guide](https://tauri.app/v1/guides/getting-started/prerequisites/) to get all the tools you need to develop Tauri apps. The only additional tool you may need is [Yarn](https://yarnpkg.com/), it is only required if you are developing the Node CLI or API packages (`tooling/cli/node` and `tooling/api`). Next, fork and clone this repo. It is structured as a monorepo, which means that all the various Tauri packages are under the same repository. The development process varies depending on what part of Tauri you are contributing to, see the guides below for per-package instructions.
|
||||
|
||||
Next, [fork](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo) and clone [this repository](https://github.com/tauri-apps).
|
||||
The development process varies depending on what part of Tauri you are contributing to, see the guides below for per-package instructions.
|
||||
Some Tauri packages will be automatically built when running one of the examples. Others, however, will need to be built beforehand. To build these automatically, run the `.scripts/setup.sh` (Linux and macOS) or `.scripts/setup.ps1` (Windows) script. This will install the Rust and Node.js CLI and build the JS API. After that, you should be able to run all the examples. Note that the setup script should be executed from the root folder of the repository in order to run correctly.
|
||||
|
||||
Some Tauri packages will be automatically built when running one of the examples. Others, however, will need to be built beforehand. To initialize, execute these commands in the repository root:
|
||||
### Packages Overview
|
||||
|
||||
```bash
|
||||
pnpm install
|
||||
pnpm build
|
||||
```
|
||||
|
||||
### Overview
|
||||
|
||||
See [Architecture](../ARCHITECTURE.md#major-components) for an overview of the packages in this repository.
|
||||
|
||||
### Developing Tauri Core and Related Components (Rust API, Macros, Codegen, and Utils)
|
||||
|
||||
The code for the Rust crates, including the Core, Macros, Utils, WRY runtime, and a few more are located in the [main Tauri repository](https://github.com/tauri-apps/tauri/tree/dev/crates).
|
||||
|
||||
The easiest way to test your changes is to use the [helloworld](https://github.com/tauri-apps/tauri/tree/dev/examples/helloworld) example app. It automatically rebuilds and uses your local copy of the Tauri core packages. Just run `cargo run --example helloworld` after making changes to test them out.
|
||||
|
||||
To test local changes against your own application simply point the Tauri create to your local repository. In `src-tauri/Cargo.toml` file change:
|
||||
|
||||
`tauri = { version = "2.1.1" }`
|
||||
|
||||
to:
|
||||
|
||||
`tauri = { path = "path/to/local/tauri/crates/tauri" }`
|
||||
|
||||
If any other crates depend on Tauri you will have to point them to the local repo as well.
|
||||
- Tauri Core (`/core/tauri`) is the heart of Tauri. It contains the code that starts the app, configures communication between Rust and the Webview, and ties all the other packages together.
|
||||
- The Macros (`/core/tauri-macros`) are used by Tauri Core for various functions.
|
||||
- Tauri Bundler (`/tooling/bundler`) is used by the Rust CLI to package executables into installers.
|
||||
- The Rust CLI aka `tauri-cli` (`/tooling/cli`) is the primary CLI for creating and developing Tauri apps.
|
||||
- The JS CLI aka `@tauri-apps/cli` (`/tooling/cli/node`) is a Node.js CLI wrapper for `tauri-cli`.
|
||||
- The JS API aka `@tauri-apps/api` (`/tooling/api`) contains JS bindings to the builtin Rust functions in the Rust API.
|
||||
|
||||
### Developing Tauri Bundler and Rust CLI
|
||||
|
||||
The code for the bundler is located in [crates/tauri-bundler](https://github.com/tauri-apps/tauri/tree/dev/crates/tauri-bundler), and the code for the Rust CLI is located in [tauri-cli](https://github.com/tauri-apps/tauri/tree/dev/crates/tauri-cli).
|
||||
Running `cargo install --path .` in the Rust CLI directory will allow you to run `cargo tauri build` and `cargo tauri dev` anywhere, using the updated copy of the bundler and cli. You will have to run this command each time you make a change in either package.
|
||||
You can use `cargo install --path . --debug` to speed up test builds.
|
||||
The code for the bundler is located in `[Tauri repo root]/tooling/bundler`, and the code for the Rust CLI is located in `[Tauri repo root]/tooling/cli`. If you are using your local copy of `@tauri-apps/cli` (see above), any changes you make to the bundler and CLI will be automatically built and applied when running the build or dev command. Otherwise, running `cargo install --path .` in the Rust CLI directory will allow you to run `cargo tauri build` and `cargo tauri dev` anywhere, using the updated copy of the bundler and cli. You will have to run this command each time you make a change in either package.
|
||||
|
||||
### Developing The Node.js CLI (`@tauri-apps/cli`)
|
||||
|
||||
[`@tauri-apps/cli`](https://github.com/tauri-apps/tauri/tree/dev/packages/cli) is a small wrapper around `tauri-cli` so most changes should be happen in the Rust CLI (see above).
|
||||
`@tauri-apps/cli` is a wrapper to `tauri-cli` so most changes should be written on the Rust CLI. The `[Tauri repo root]/tooling/cli/node` folder contains only packaging scripts to properly publish the Rust CLI binaries to NPM.
|
||||
|
||||
### Developing Tauri Core and Related Components (Rust API, Macros, Codegen, and Utils)
|
||||
|
||||
The code for Tauri Core is located in `[Tauri repo root]/core/tauri`, and the Rust API, Macros, and Utils are in `[Tauri repo root]/core/tauri-(api/macros/utils)`. The easiest way to test your changes is to use the `[Tauri repo root]/examples/helloworld` app. It automatically rebuilds and uses your local copy of the Tauri core packages. Just run `yarn tauri build` or `yarn tauri dev` in the helloworld app directory after making changes to test them out. To use your local changes in another project, edit its `src-tauri/Cargo.toml` file so that the `tauri` key looks like `tauri = { path = "PATH", features = [ "api-all", "cli" ] }`, where `PATH` is the relative path to `[Tauri repo root]/core/tauri`. Then, your local copy of the Tauri core packages will be rebuilt and used whenever you build that project.
|
||||
|
||||
#### Building the documentation locally
|
||||
|
||||
You can build the Rust documentation locally running the following script:
|
||||
|
||||
```bash
|
||||
$ cargo +nightly doc --all-features --open
|
||||
$ RUSTDOCFLAGS="--cfg doc_cfg" cargo +nightly doc --all-features --open
|
||||
```
|
||||
|
||||
### Developing the JS API
|
||||
|
||||
The JS API provides bindings between the developer's JS in the Webview and the built-in Tauri APIs, written in Rust. Its code is located in [/packages/api](https://github.com/tauri-apps/tauri/tree/dev/packages/api).
|
||||
After making changes to the code, run `pnpm build` to build it. To test your changes, we recommend using the API example app, located in [/examples/api](https://github.com/tauri-apps/tauri/tree/dev/examples/api). It will automatically use your local copy of the JS API and provides a helpful UI to test the various commands.
|
||||
The JS API provides bindings between the developer's JS in the Webview and the builtin Tauri APIs, written in Rust. Its code is located in `[Tauri repo root]/tooling/api`. After making changes to the code, run `yarn build` to build it. To test your changes, we recommend using the API example app, located in `[Tauri repo root]/examples/api`. It will automatically use your local copy of the JS API and provides a helpful UI to test the various commands.
|
||||
|
||||
## Financial Contribution
|
||||
|
||||
Tauri is an MIT-licensed open source project. Its ongoing development can be supported via [GitHub Sponsors](https://github.com/sponsors/tauri-apps) or [Open Collective](https://opencollective.com/tauri). We prefer GitHub Sponsors as donations made are doubled through the matching fund program.
|
||||
Tauri is an MIT-licensed open source project. Its ongoing development can be supported via [GitHub Sponsors](https://github.com/sponsors/nothingismagick) or [Open Collective](https://opencollective.com/tauri). We prefer GitHub Sponsors as donations made are doubled through the matching fund program.
|
||||
|
||||
2
.github/FUNDING.yml
vendored
2
.github/FUNDING.yml
vendored
@@ -1,4 +1,4 @@
|
||||
# Copyright 2019-2024 Tauri Programme within The Commons Conservancy
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
|
||||
6
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
6
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
@@ -1,4 +1,4 @@
|
||||
# Copyright 2019-2024 Tauri Programme within The Commons Conservancy
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
@@ -44,8 +44,8 @@ body:
|
||||
- type: textarea
|
||||
id: info
|
||||
attributes:
|
||||
label: Full `tauri info` output
|
||||
description: 'Output of `npm run tauri info` or `cargo tauri info`'
|
||||
label: Platform and versions
|
||||
description: "Output of `npm run tauri info` or `cargo tauri info`"
|
||||
render: text
|
||||
validations:
|
||||
required: true
|
||||
|
||||
2
.github/ISSUE_TEMPLATE/config.yml
vendored
2
.github/ISSUE_TEMPLATE/config.yml
vendored
@@ -1,4 +1,4 @@
|
||||
# Copyright 2019-2024 Tauri Programme within The Commons Conservancy
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
|
||||
3
.github/ISSUE_TEMPLATE/docs_report.md
vendored
3
.github/ISSUE_TEMPLATE/docs_report.md
vendored
@@ -1,7 +1,8 @@
|
||||
---
|
||||
name: 📚 Docs Report
|
||||
about: Create a report to help us improve the docs
|
||||
title: '[docs] '
|
||||
title: "[docs] "
|
||||
labels: 'type: documentation'
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
8
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
8
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
@@ -1,11 +1,11 @@
|
||||
# Copyright 2019-2024 Tauri Programme within The Commons Conservancy
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
name: 💡 Feature Request
|
||||
title: '[feat] '
|
||||
description: Suggest an idea
|
||||
labels: ['type: feature request']
|
||||
labels: 'type: feature request'
|
||||
|
||||
body:
|
||||
- type: textarea
|
||||
@@ -22,7 +22,7 @@ body:
|
||||
attributes:
|
||||
label: "Describe the solution you'd like"
|
||||
description: A clear description of what change you would like
|
||||
placeholder: 'I would like to...'
|
||||
placeholder: "I would like to..."
|
||||
validations:
|
||||
required: true
|
||||
|
||||
@@ -31,7 +31,7 @@ body:
|
||||
attributes:
|
||||
label: Alternatives considered
|
||||
description: "Any alternative solutions you've considered"
|
||||
|
||||
|
||||
- type: textarea
|
||||
id: context
|
||||
attributes:
|
||||
|
||||
45
.github/PULL_REQUEST_TEMPLATE.md
vendored
45
.github/PULL_REQUEST_TEMPLATE.md
vendored
@@ -1,21 +1,30 @@
|
||||
<!--
|
||||
Before submitting a PR, please read https://github.com/tauri-apps/tauri/blob/dev/.github/CONTRIBUTING.md#pull-request-guidelines
|
||||
Update "[ ]" to "[x]" to check a box
|
||||
|
||||
1. Give the PR a descriptive title.
|
||||
|
||||
Examples of good title:
|
||||
- fix(windows): fix race condition in event loop
|
||||
- docs: update example for `App::show`
|
||||
- feat: add `Window::set_fullscreen`
|
||||
|
||||
Examples of bad title:
|
||||
- fix #7123
|
||||
- update docs
|
||||
- fix bugs
|
||||
|
||||
2. If there is a related issue, reference it in the PR text, e.g. closes #123.
|
||||
3. If this change requires a new version, then add a change file in `.changes` directory with the appropriate bump, see https://github.com/tauri-apps/tauri/blob/dev/.changes/README.md
|
||||
4. Ensure that all your commits are signed https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits
|
||||
5. Ensure `cargo test` and `cargo clippy` passes.
|
||||
6. Propose your changes as a draft PR if your work is still in progress.
|
||||
Please make sure to read the Pull Request Guidelines: https://github.com/tauri-apps/tauri/blob/dev/.github/CONTRIBUTING.md#pull-request-guidelines
|
||||
-->
|
||||
|
||||
### What kind of change does this PR introduce?
|
||||
<!-- Check at least one. If you are introducing a new binding, you must reference an issue where this binding has been proposed, discussed and approved by the maintainers. -->
|
||||
|
||||
- [ ] Bugfix
|
||||
- [ ] Feature
|
||||
- [ ] Docs
|
||||
- [ ] New Binding issue #___
|
||||
- [ ] Code style update
|
||||
- [ ] Refactor
|
||||
- [ ] Build-related changes
|
||||
- [ ] Other, please describe:
|
||||
|
||||
### Does this PR introduce a breaking change?
|
||||
<!-- If yes, please describe the impact and migration path for existing applications in an attached issue. -->
|
||||
|
||||
- [ ] Yes, and the changes were approved in issue #___
|
||||
- [ ] No
|
||||
|
||||
### Checklist
|
||||
- [ ] When resolving issues, they are referenced in the PR's title (e.g `fix: remove a typo, closes #___, #___`)
|
||||
- [ ] A change file is added if any packages will require a version bump due to this PR per [the instructions in the readme](https://github.com/tauri-apps/tauri/blob/dev/.changes/readme.md).
|
||||
- [ ] I have added a convincing reason for adding this feature, if necessary
|
||||
|
||||
### Other information
|
||||
|
||||
57
.github/RELEASING.md
vendored
57
.github/RELEASING.md
vendored
@@ -1,57 +0,0 @@
|
||||
# Tauri Releasing Handbook
|
||||
|
||||
This handbook contains information about our release pipeline and how to deal with common issues.
|
||||
This document is mainly intended for team members responsible for maintaining the project.
|
||||
|
||||
- [Covector](#covector)
|
||||
- [Version Pull Request](#version-pull-request)
|
||||
- [Releasing and Publishing](#releasing-and-publishing)
|
||||
- [Publishing failed, what to do?](#publishing-failed-what-to-do)
|
||||
|
||||
## Covector
|
||||
|
||||
We use [`covector`](https://github.com/jbolda/covector) to manage our version bumps and release pipeline.
|
||||
It can be configured in [`.changes/config.json`](../.changes/config.json) which includes how each package should be published step by step.
|
||||
|
||||
Some packages can't be published directly using `covector` as it requires to be built on a matrix of platforms
|
||||
such as `tauri-cli` prebuilt binaries which is published using [publish-cli-rs.yml](./workflows/publish-cli-rs.yml)
|
||||
and `@tauri-apps/cli` native Node.js modules which is published using using [publish-cli-js.yml](./workflows/publish-cli-js.yml)
|
||||
both of which are triggered after `covector` has created a github release for both of them, see `Trigger @tauri-apps/cli publishing workflow`
|
||||
and `Trigger tauri-cli publishing workflow` steps in [covector-version-or-publish.yml](./workflows/covector-version-or-publish.yml)
|
||||
|
||||
## Version Pull Request
|
||||
|
||||
On each pull request merged, [covector-version-or-publish.yml](./workflows/covector-version-or-publish.yml) workflow will run, and:
|
||||
|
||||
When there're change files inside `.changes` folder and they're not all included in `pre.json` (usually this is only when we are in `-alpha` to `-rc` phase), it will open/update an `Apply Version Updates From Current Changes` PR (https://github.com/tauri-apps/tauri/pull/11029 for example) that bumps all packages based on current existing change files and generate `CHANGELOG.md` entries. see `Create Pull Request With Versions Bumped` step in [covector-version-or-publish.yml](./workflows/covector-version-or-publish.yml).
|
||||
|
||||
Otherwise, covector will start to publish packages configured in [`.changes/config.json`](../.changes/config.json).
|
||||
|
||||
## Releasing and Publishing
|
||||
|
||||
Releasing can be as easy as merging the version pull request but here is a checklist to follow:
|
||||
|
||||
- [ ] Double check that every package is bumped correctly and there are no accidental major or minor being released unless that is indeed the intention.
|
||||
- [ ] Make sure that there are no pending or unfinished [covector-version-or-publish.yml](./workflows/covector-version-or-publish.yml) workflow runs.
|
||||
- [ ] Approve and merge the version pull request
|
||||
|
||||
## Publishing failed, what to do?
|
||||
|
||||
It is possible and due to many factors that one or many packages release can fail to release, there is no reason to panic, we can fix this.
|
||||
|
||||
Did all of the packages fail to release?
|
||||
|
||||
- yes?
|
||||
- [ ] `git checkout -b revert-branch`
|
||||
- [ ] `git revert HEAD~1`
|
||||
- no?
|
||||
- [ ] `git checkout -b revert-branch`
|
||||
- [ ] `git revert HEAD~1 --no-commit`
|
||||
- [ ] Edit the commit and revert only changes related to packages that failed to publish
|
||||
- [ ] `git revert --continue`
|
||||
|
||||
Then:
|
||||
|
||||
- [ ] Make a pull request with reverted changes, get it approved and merged
|
||||
- [ ] Fix the issue that caused releases to fail in another PR, get it approved and merged
|
||||
- [ ] Repeat the release process again.
|
||||
3
.github/config.yml
vendored
Normal file
3
.github/config.yml
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
31
.github/sponsors/crabnebula.svg
vendored
31
.github/sponsors/crabnebula.svg
vendored
@@ -1,31 +0,0 @@
|
||||
<svg class="crabnebula-logo" width="100%" height="100%" viewBox="0 0 1204 210" version="1.1"
|
||||
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xml:space="preserve" xmlns:serif="http://www.serif.com/"
|
||||
style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
|
||||
<style>
|
||||
.crabnebula-logo path,
|
||||
.crabnebula-logo rect {
|
||||
fill: #001e42;
|
||||
}
|
||||
@media (prefers-color-scheme: dark) {
|
||||
.crabnebula-logo path, .crabnebula-logo rect {
|
||||
fill: #fff;
|
||||
}
|
||||
}
|
||||
html[data-color-mode="dark"] .crabnebula-logo path,
|
||||
html[data-color-mode="dark"] .crabnebula-logo rect {
|
||||
fill: #fff;
|
||||
}
|
||||
</style>
|
||||
<path d="M351.903,162.334C344.288,162.334 337.123,160.881 330.41,157.975C323.696,155.069 317.834,151.11 312.824,146.099C307.914,141.089 304.006,135.276 301.101,128.662C298.195,121.948 296.742,114.783 296.742,107.167C296.742,99.55 298.195,92.435 301.101,85.821C304.006,79.107 307.914,73.244 312.824,68.234C317.834,63.223 323.696,59.265 330.41,56.358C337.123,53.452 344.288,51.999 351.903,51.999C357.414,51.999 362.675,52.701 367.685,54.103C372.795,55.507 377.455,57.511 381.663,60.116C385.972,62.622 389.83,65.678 393.237,69.286C396.644,72.793 399.499,76.752 401.804,81.161L380.762,92.586C377.756,87.174 373.848,82.915 369.038,79.808C364.328,76.702 358.617,75.148 351.903,75.148C347.494,75.148 343.386,76 339.578,77.704C335.871,79.407 332.614,81.762 329.809,84.769C327.003,87.675 324.798,91.082 323.195,94.991C321.592,98.799 320.79,102.857 320.79,107.167C320.79,111.476 321.592,115.584 323.195,119.493C324.798,123.301 327.003,126.708 329.809,129.715C332.614,132.621 335.871,134.926 339.578,136.629C343.386,138.333 347.494,139.185 351.903,139.185C358.617,139.185 364.328,137.631 369.038,134.525C373.848,131.418 377.756,127.159 380.762,121.748L401.804,133.172C399.499,137.581 396.644,141.59 393.237,145.198C389.83,148.705 385.972,151.762 381.663,154.367C377.455,156.872 372.795,158.827 367.685,160.23C362.675,161.633 357.414,162.334 351.903,162.334Z" style="fill-rule:nonzero;stroke:black;stroke-width:0.55px;"/>
|
||||
<path d="M413.821,85.37L436.517,85.37L436.517,96.644C437.72,93.337 439.924,90.481 443.131,88.076C446.437,85.671 450.195,84.468 454.403,84.468C455.506,84.468 456.658,84.518 457.86,84.619C459.063,84.719 460.366,84.969 461.768,85.37L461.768,108.369C460.065,107.768 458.412,107.317 456.808,107.016C455.205,106.716 453.502,106.565 451.698,106.565C446.788,106.565 443.03,108.269 440.425,111.676C437.82,115.083 436.517,119.493 436.517,124.904L436.517,160.53L413.821,160.53L413.821,85.37Z" style="fill-rule:nonzero;stroke:black;stroke-width:0.55px;"/>
|
||||
<path d="M502.161,162.184C497.251,162.184 492.642,161.132 488.333,159.027C484.125,156.923 480.467,154.117 477.361,150.609C474.255,147.001 471.8,142.843 469.996,138.133C468.193,133.322 467.291,128.261 467.291,122.95C467.291,117.639 468.193,112.628 469.996,107.918C471.8,103.108 474.255,98.949 477.361,95.442C480.467,91.834 484.125,88.978 488.333,86.873C492.642,84.769 497.251,83.717 502.161,83.717C504.666,83.717 506.971,84.017 509.075,84.619C511.28,85.12 513.234,85.821 514.937,86.723C516.741,87.625 518.244,88.627 519.446,89.729C520.749,90.832 521.801,91.884 522.603,92.886L522.603,85.37L545.299,85.37L545.299,160.53L522.603,160.53L522.603,153.014C521.801,154.016 520.749,155.069 519.446,156.171C518.244,157.273 516.741,158.275 514.937,159.177C513.234,160.079 511.28,160.781 509.075,161.282C506.971,161.883 504.666,162.184 502.161,162.184ZM507.272,141.59C512.382,141.59 516.49,139.836 519.597,136.329C522.803,132.821 524.406,128.362 524.406,122.95C524.406,117.539 522.803,113.079 519.597,109.572C516.49,106.064 512.382,104.31 507.272,104.31C502.161,104.31 498.003,106.064 494.796,109.572C491.69,113.079 490.137,117.539 490.137,122.95C490.137,128.362 491.69,132.821 494.796,136.329C498.003,139.836 502.161,141.59 507.272,141.59Z" style="fill-rule:nonzero;stroke:black;stroke-width:0.55px;"/>
|
||||
<path d="M607.116,162.184C604.611,162.184 602.256,161.883 600.051,161.282C597.947,160.781 595.993,160.079 594.19,159.177C592.486,158.275 590.983,157.273 589.681,156.171C588.378,155.069 587.376,154.016 586.674,153.014L586.674,160.53L563.979,160.53L563.979,47.79L586.674,47.79L586.674,92.886C587.376,91.884 588.378,90.832 589.681,89.729C590.983,88.627 592.486,87.625 594.19,86.723C595.993,85.821 597.947,85.12 600.051,84.619C602.256,84.017 604.611,83.717 607.116,83.717C612.026,83.717 616.585,84.769 620.793,86.873C625.102,88.978 628.81,91.834 631.916,95.442C635.022,98.949 637.477,103.108 639.281,107.918C641.084,112.628 641.986,117.639 641.986,122.95C641.986,128.261 641.084,133.322 639.281,138.133C637.477,142.843 635.022,147.001 631.916,150.609C628.81,154.117 625.102,156.923 620.793,159.027C616.585,161.132 612.026,162.184 607.116,162.184ZM602.005,141.59C607.116,141.59 611.224,139.836 614.33,136.329C617.537,132.821 619.14,128.362 619.14,122.95C619.14,117.539 617.537,113.079 614.33,109.572C611.224,106.064 607.116,104.31 602.005,104.31C596.895,104.31 592.737,106.064 589.53,109.572C586.424,113.079 584.871,117.539 584.871,122.95C584.871,128.362 586.424,132.821 589.53,136.329C592.737,139.836 596.895,141.59 602.005,141.59Z" style="fill-rule:nonzero;stroke:black;stroke-width:0.55px;"/>
|
||||
<path d="M732.106,160.53L680.101,94.54L680.101,160.53L656.203,160.53L656.203,53.803L676.795,53.803L728.649,119.793L728.649,53.803L752.698,53.803L752.698,160.53L732.106,160.53Z" style="fill-rule:nonzero;stroke:black;stroke-width:0.55px;"/>
|
||||
<path d="M806.852,162.184C801.341,162.184 796.13,161.282 791.22,159.478C786.411,157.674 782.202,155.069 778.595,151.661C774.988,148.254 772.132,144.145 770.028,139.335C767.923,134.425 766.871,128.963 766.871,122.95C766.871,117.338 767.823,112.177 769.727,107.467C771.731,102.657 774.487,98.498 777.994,94.991C781.601,91.483 785.809,88.727 790.619,86.723C795.429,84.719 800.69,83.717 806.401,83.717C811.311,83.717 816.021,84.518 820.53,86.122C825.139,87.625 829.147,89.93 832.554,93.036C835.961,96.043 838.666,99.851 840.67,104.461C842.775,108.97 843.827,114.282 843.827,120.395C843.827,121.397 843.777,122.549 843.677,123.852C843.677,125.055 843.576,126.558 843.376,128.362L788.816,128.362C789.517,132.871 791.671,136.228 795.279,138.433C798.886,140.538 802.844,141.59 807.153,141.59C811.562,141.59 815.319,140.738 818.425,139.034C821.632,137.231 823.937,135.226 825.339,133.022L842.173,145.649C838.666,150.659 833.857,154.668 827.744,157.674C821.732,160.681 814.768,162.184 806.852,162.184ZM821.281,113.48C820.279,109.471 818.275,106.615 815.269,104.912C812.263,103.108 809.107,102.206 805.8,102.206C804.096,102.206 802.393,102.406 800.69,102.807C798.986,103.208 797.383,103.859 795.88,104.761C794.377,105.663 793.024,106.816 791.822,108.219C790.719,109.622 789.918,111.376 789.417,113.48L821.281,113.48Z" style="fill-rule:nonzero;stroke:black;stroke-width:0.55px;"/>
|
||||
<path d="M901.265,162.184C898.76,162.184 896.405,161.883 894.201,161.282C892.097,160.781 890.143,160.079 888.339,159.177C886.636,158.275 885.133,157.273 883.83,156.171C882.527,155.069 881.525,154.016 880.824,153.014L880.824,160.53L858.128,160.53L858.128,47.79L880.824,47.79L880.824,92.886C881.525,91.884 882.527,90.832 883.83,89.729C885.133,88.627 886.636,87.625 888.339,86.723C890.143,85.821 892.097,85.12 894.201,84.619C896.405,84.017 898.76,83.717 901.265,83.717C906.175,83.717 910.734,84.769 914.943,86.873C919.252,88.978 922.959,91.834 926.065,95.442C929.172,98.949 931.627,103.108 933.43,107.918C935.234,112.628 936.136,117.639 936.136,122.95C936.136,128.261 935.234,133.322 933.43,138.133C931.627,142.843 929.172,147.001 926.065,150.609C922.959,154.117 919.252,156.923 914.943,159.027C910.734,161.132 906.175,162.184 901.265,162.184ZM896.155,141.59C901.265,141.59 905.374,139.836 908.48,136.329C911.686,132.821 913.29,128.362 913.29,122.95C913.29,117.539 911.686,113.079 908.48,109.572C905.374,106.064 901.265,104.31 896.155,104.31C891.045,104.31 886.886,106.064 883.68,109.572C880.573,113.079 879.02,117.539 879.02,122.95C879.02,128.362 880.573,132.821 883.68,136.329C886.886,139.836 891.045,141.59 896.155,141.59Z" style="fill-rule:nonzero;stroke:black;stroke-width:0.55px;"/>
|
||||
<path d="M977.812,162.184C968.493,162.184 961.429,159.077 956.619,152.864C951.81,146.651 949.405,138.433 949.405,128.211L949.405,85.37L972.101,85.37L972.101,124.303C972.101,129.815 972.952,134.074 974.656,137.08C976.459,140.087 979.466,141.59 983.674,141.59C987.983,141.59 991.39,140.037 993.895,136.93C996.5,133.823 997.803,128.813 997.803,121.898L997.803,85.37L1020.5,85.37L1020.5,160.53L997.803,160.53L997.803,152.864C995.999,155.469 993.444,157.674 990.137,159.478C986.83,161.282 982.722,162.184 977.812,162.184Z" style="fill-rule:nonzero;stroke:black;stroke-width:0.55px;"/>
|
||||
<rect x="1039.11" y="47.79" width="22.701" height="112.74" style="fill-rule:nonzero;stroke:black;stroke-width:0.55px;"/>
|
||||
<path d="M1110.86,162.184C1105.95,162.184 1101.34,161.132 1097.03,159.027C1092.83,156.923 1089.17,154.117 1086.06,150.609C1082.96,147.001 1080.5,142.843 1078.7,138.133C1076.89,133.322 1075.99,128.261 1075.99,122.95C1075.99,117.639 1076.89,112.628 1078.7,107.918C1080.5,103.108 1082.96,98.949 1086.06,95.442C1089.17,91.834 1092.83,88.978 1097.03,86.873C1101.34,84.769 1105.95,83.717 1110.86,83.717C1113.37,83.717 1115.67,84.017 1117.78,84.619C1119.98,85.12 1121.94,85.821 1123.64,86.723C1125.44,87.625 1126.95,88.627 1128.15,89.729C1129.45,90.832 1130.5,91.884 1131.3,92.886L1131.3,85.37L1154,85.37L1154,160.53L1131.3,160.53L1131.3,153.014C1130.5,154.016 1129.45,155.069 1128.15,156.171C1126.95,157.273 1125.44,158.275 1123.64,159.177C1121.94,160.079 1119.98,160.781 1117.78,161.282C1115.67,161.883 1113.37,162.184 1110.86,162.184ZM1115.97,141.59C1121.08,141.59 1125.19,139.836 1128.3,136.329C1131.5,132.821 1133.11,128.362 1133.11,122.95C1133.11,117.539 1131.5,113.079 1128.3,109.572C1125.19,106.064 1121.08,104.31 1115.97,104.31C1110.86,104.31 1106.7,106.064 1103.5,109.572C1100.39,113.079 1098.84,117.539 1098.84,122.95C1098.84,128.362 1100.39,132.821 1103.5,136.329C1106.7,139.836 1110.86,141.59 1115.97,141.59Z" style="fill-rule:nonzero;stroke:black;stroke-width:0.55px;"/>
|
||||
<path d="M146.48,54.585C119.724,89.866 119.878,134.941 146.826,155.264C153.908,160.605 162.136,163.705 170.903,164.732C146.032,184.934 117.382,191.203 98.037,178.045C71.507,160 72.524,112.249 100.309,71.391C123.51,37.273 158.039,18.749 184.247,24.072C170.404,30.195 157.116,40.561 146.48,54.585ZM181.638,99.643C169.141,111.453 154.859,119.304 142.801,121.916C149.921,147.367 177.29,149.323 177.29,149.323C177.29,149.323 193.578,145.578 205.877,117.941C216.005,95.183 215.122,71.668 204.914,59.7C204.065,71.267 195.731,86.324 181.638,99.643Z" style="stroke:black;stroke-width:0.55px;"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 11 KiB |
23
.github/workflows/audit.yml
vendored
23
.github/workflows/audit.yml
vendored
@@ -1,4 +1,4 @@
|
||||
# Copyright 2019-2024 Tauri Programme within The Commons Conservancy
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
@@ -14,7 +14,7 @@ on:
|
||||
- '**/Cargo.lock'
|
||||
- '**/Cargo.toml'
|
||||
- '**/package.json'
|
||||
- '**/pnpm-lock.yaml'
|
||||
- '**/yarn.lock'
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
@@ -24,18 +24,21 @@ jobs:
|
||||
audit-rust:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v2
|
||||
- name: rust audit
|
||||
uses: rustsec/audit-check@v1
|
||||
uses: actions-rs/audit-check@v1
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
audit-js:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- run: npm i -g --force corepack
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 'lts/*'
|
||||
- run: pnpm audit
|
||||
- uses: actions/checkout@v2
|
||||
- name: audit workspace
|
||||
run: yarn audit
|
||||
- name: audit @tauri-apps/api
|
||||
working-directory: tooling/api
|
||||
run: yarn audit
|
||||
- name: audit @tauri-apps/cli
|
||||
working-directory: tooling/cli/node
|
||||
run: yarn audit
|
||||
|
||||
47
.github/workflows/bench.yml
vendored
47
.github/workflows/bench.yml
vendored
@@ -1,4 +1,4 @@
|
||||
# Copyright 2019-2024 Tauri Programme within The Commons Conservancy
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
@@ -8,16 +8,13 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- dev
|
||||
- 1.x
|
||||
workflow_dispatch:
|
||||
pull_request:
|
||||
paths:
|
||||
- '.github/workflows/bench.yml'
|
||||
- 'bench/**'
|
||||
|
||||
env:
|
||||
RUST_BACKTRACE: 1
|
||||
CARGO_PROFILE_DEV_DEBUG: 0 # This would add unnecessary bloat to the target folder, decreasing cache efficiency.
|
||||
LC_ALL: en_US.UTF-8 # This prevents strace from changing its number format to use commas.
|
||||
LC_ALL: en_US.UTF-8 # This prevents strace from changing it's number format to use commas.
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
@@ -30,22 +27,23 @@ jobs:
|
||||
matrix:
|
||||
rust: [nightly]
|
||||
platform:
|
||||
- { target: x86_64-unknown-linux-gnu, os: ubuntu-latest }
|
||||
- { target: x86_64-unknown-linux-gnu, os: ubuntu-20.04 }
|
||||
|
||||
runs-on: ${{ matrix.platform.os }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: install Rust ${{ matrix.rust }}
|
||||
uses: dtolnay/rust-toolchain@master
|
||||
- uses: actions/checkout@v2
|
||||
- name: install ${{ matrix.rust }}
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: ${{ matrix.rust }}
|
||||
override: true
|
||||
default: true
|
||||
components: rust-src
|
||||
targets: ${{ matrix.platform.target }}
|
||||
target: ${{ matrix.platform.target }}
|
||||
|
||||
- name: setup python
|
||||
uses: actions/setup-python@v5
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: '3.10'
|
||||
architecture: x64
|
||||
@@ -54,26 +52,25 @@ jobs:
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y --no-install-recommends \
|
||||
webkit2gtk-4.1 libayatana-appindicator3-dev \
|
||||
xvfb \
|
||||
at-spi2-core
|
||||
wget https://github.com/sharkdp/hyperfine/releases/download/v1.18.0/hyperfine_1.18.0_amd64.deb
|
||||
sudo dpkg -i hyperfine_1.18.0_amd64.deb
|
||||
sudo apt-get install -y webkit2gtk-4.0 libayatana-appindicator3-dev xvfb
|
||||
wget https://github.com/sharkdp/hyperfine/releases/download/v1.11.0/hyperfine_1.11.0_amd64.deb
|
||||
sudo dpkg -i hyperfine_1.11.0_amd64.deb
|
||||
pip install memory_profiler
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
workspaces: |
|
||||
core -> ../target
|
||||
tooling/bench/tests
|
||||
|
||||
- name: run benchmarks
|
||||
run: |
|
||||
cargo build --manifest-path bench/tests/cpu_intensive/src-tauri/Cargo.toml --release -Z build-std=std,panic_abort -Z build-std-features=panic_immediate_abort --target ${{ matrix.platform.target }}
|
||||
cargo build --manifest-path bench/tests/files_transfer/src-tauri/Cargo.toml --release -Z build-std=std,panic_abort -Z build-std-features=panic_immediate_abort --target ${{ matrix.platform.target }}
|
||||
cargo build --manifest-path bench/tests/helloworld/src-tauri/Cargo.toml --release -Z build-std=std,panic_abort -Z build-std-features=panic_immediate_abort --target ${{ matrix.platform.target }}
|
||||
xvfb-run --auto-servernum cargo run --manifest-path bench/Cargo.toml --bin run_benchmark
|
||||
cargo build --release -Z build-std=std,panic_abort -Z build-std-features=panic_immediate_abort --target ${{ matrix.platform.target }} --manifest-path tooling/bench/tests/Cargo.toml
|
||||
xvfb-run --auto-servernum cargo run --manifest-path tooling/bench/Cargo.toml --bin run_benchmark
|
||||
|
||||
- name: clone benchmarks_results
|
||||
if: github.repository == 'tauri-apps/tauri' && github.ref == 'refs/heads/dev'
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
token: ${{ secrets.BENCH_PAT }}
|
||||
path: gh-pages
|
||||
@@ -82,7 +79,7 @@ jobs:
|
||||
- name: push new benchmarks
|
||||
if: github.repository == 'tauri-apps/tauri' && github.ref == 'refs/heads/dev'
|
||||
run: |
|
||||
cargo run --manifest-path bench/Cargo.toml --bin build_benchmark_jsons
|
||||
cargo run --manifest-path tooling/bench/Cargo.toml --bin build_benchmark_jsons
|
||||
cd gh-pages
|
||||
git pull
|
||||
git config user.name "tauri-bench"
|
||||
|
||||
18
.github/workflows/check-change-tags.yml
vendored
18
.github/workflows/check-change-tags.yml
vendored
@@ -1,4 +1,4 @@
|
||||
# Copyright 2019-2024 Tauri Programme within The Commons Conservancy
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
@@ -17,21 +17,9 @@ jobs:
|
||||
check:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: check change files end with .md
|
||||
run: |
|
||||
for file in .changes/*
|
||||
do
|
||||
if [[ ! "$file" =~ \.(md|json)$ ]]; then
|
||||
echo ".changes directory should only contain files that end with .md"
|
||||
echo "found an invalid file in .changes directory:"
|
||||
echo "$file"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
- uses: dorny/paths-filter@v3
|
||||
- uses: dorny/paths-filter@v2
|
||||
id: filter
|
||||
with:
|
||||
list-files: shell
|
||||
|
||||
59
.github/workflows/check-generated-files.yml
vendored
59
.github/workflows/check-generated-files.yml
vendored
@@ -1,4 +1,4 @@
|
||||
# Copyright 2019-2024 Tauri Programme within The Commons Conservancy
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
@@ -8,12 +8,11 @@ on:
|
||||
pull_request:
|
||||
paths:
|
||||
- '.github/workflows/check-generated-files.yml'
|
||||
- 'pnpm-lock.yaml'
|
||||
- 'packages/api/src/**'
|
||||
- 'crates/tauri/scripts/bundle.global.js'
|
||||
- 'crates/tauri-utils/src/config.rs'
|
||||
- 'crates/tauri-cli/config.schema.json'
|
||||
- 'crates/tauri-schema-generator/schemas/*.json'
|
||||
- 'tooling/api/src/**'
|
||||
- 'core/tauri/scripts/bundle.global.js'
|
||||
- 'core/tauri-utils/src/config.rs'
|
||||
- 'tooling/cli/schema.json'
|
||||
- 'core/tauri-config-schema/schema.json'
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
@@ -26,37 +25,29 @@ jobs:
|
||||
api: ${{ steps.filter.outputs.api }}
|
||||
schema: ${{ steps.filter.outputs.schema }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: dorny/paths-filter@v3
|
||||
- uses: actions/checkout@v3
|
||||
- uses: dorny/paths-filter@v2
|
||||
id: filter
|
||||
with:
|
||||
filters: |
|
||||
api:
|
||||
- 'pnpm-lock.yaml'
|
||||
- 'packages/api/src/**'
|
||||
- 'crates/tauri/scripts/bundle.global.js'
|
||||
- 'tooling/api/src/**'
|
||||
- 'core/tauri/scripts/bundle.global.js'
|
||||
schema:
|
||||
- 'crates/tauri-utils/src/config.rs'
|
||||
- 'crates/tauri-cli/config.schema.json'
|
||||
- 'crates/tauri-schema-generator/schemas/*.json'
|
||||
- 'core/tauri-utils/src/config.rs'
|
||||
- 'tooling/cli/schema.json'
|
||||
- 'core/tauri-config-schema/schema.json'
|
||||
|
||||
api:
|
||||
runs-on: ubuntu-latest
|
||||
needs: changes
|
||||
if: needs.changes.outputs.api == 'true'
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- run: npm i -g --force corepack
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 'lts/*'
|
||||
cache: 'pnpm'
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: install deps
|
||||
run: pnpm i --frozen-lockfile
|
||||
- name: build api
|
||||
run: pnpm build
|
||||
working-directory: packages/api
|
||||
working-directory: tooling/api
|
||||
run: yarn && yarn build
|
||||
- name: check api
|
||||
run: ./.scripts/ci/has-diff.sh
|
||||
|
||||
@@ -65,10 +56,13 @@ jobs:
|
||||
needs: changes
|
||||
if: needs.changes.outputs.schema == 'true'
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: install stable
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
override: true
|
||||
|
||||
- name: install Linux dependencies
|
||||
run: |
|
||||
@@ -76,9 +70,14 @@ jobs:
|
||||
sudo apt-get install -y libgtk-3-dev
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
workspaces: core -> ../target
|
||||
|
||||
- name: generate schemas
|
||||
run: cargo build --manifest-path ./crates/tauri-schema-generator/Cargo.toml
|
||||
- name: generate schema.json
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: build
|
||||
args: --manifest-path ./core/tauri-config-schema/Cargo.toml
|
||||
|
||||
- name: check schemas
|
||||
- name: check schema
|
||||
run: ./.scripts/ci/has-diff.sh
|
||||
|
||||
6
.github/workflows/check-license-header.yml
vendored
6
.github/workflows/check-license-header.yml
vendored
@@ -1,4 +1,4 @@
|
||||
# Copyright 2019-2024 Tauri Programme within The Commons Conservancy
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
@@ -15,8 +15,8 @@ jobs:
|
||||
check:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: dorny/paths-filter@v3
|
||||
- uses: actions/checkout@v2
|
||||
- uses: dorny/paths-filter@v2
|
||||
id: filter
|
||||
with:
|
||||
list-files: shell
|
||||
|
||||
30
.github/workflows/covector-comment-on-fork.yml
vendored
30
.github/workflows/covector-comment-on-fork.yml
vendored
@@ -1,30 +0,0 @@
|
||||
# Copyright 2019-2024 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
name: covector comment
|
||||
on:
|
||||
workflow_run:
|
||||
workflows: [covector status] # the `name` of the workflow run on `pull_request` running `status` with `comment: true`
|
||||
types:
|
||||
- completed
|
||||
|
||||
# note all other permissions are set to none if not specified
|
||||
# and these set the permissions for `secrets.GITHUB_TOKEN`
|
||||
permissions:
|
||||
# to read the action artifacts on `covector status` workflows
|
||||
actions: read
|
||||
# to write the comment
|
||||
pull-requests: write
|
||||
|
||||
jobs:
|
||||
comment:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event.workflow_run.conclusion == 'success' &&
|
||||
(github.event.workflow_run.head_repository.full_name != github.repository || github.actor == 'dependabot[bot]')
|
||||
steps:
|
||||
- name: covector status
|
||||
uses: jbolda/covector/packages/action@covector-v0
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
command: 'status'
|
||||
6
.github/workflows/covector-status.yml
vendored
6
.github/workflows/covector-status.yml
vendored
@@ -1,4 +1,4 @@
|
||||
# Copyright 2019-2024 Tauri Programme within The Commons Conservancy
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
@@ -10,7 +10,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: covector status
|
||||
@@ -18,5 +18,3 @@ jobs:
|
||||
id: covector
|
||||
with:
|
||||
command: 'status'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
comment: true
|
||||
|
||||
227
.github/workflows/covector-version-or-publish-v1.yml
vendored
Normal file
227
.github/workflows/covector-version-or-publish-v1.yml
vendored
Normal file
@@ -0,0 +1,227 @@
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
name: covector version or publish
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 1.x
|
||||
|
||||
jobs:
|
||||
msrv-list:
|
||||
runs-on: ${{ matrix.platform.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
platform:
|
||||
- {
|
||||
target: x86_64-pc-windows-msvc,
|
||||
os: windows-latest,
|
||||
toolchain: '1.61.0'
|
||||
}
|
||||
- {
|
||||
target: x86_64-unknown-linux-gnu,
|
||||
os: ubuntu-latest,
|
||||
toolchain: '1.60.0'
|
||||
}
|
||||
- {
|
||||
target: x86_64-apple-darwin,
|
||||
os: macos-latest,
|
||||
toolchain: '1.60.0'
|
||||
}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: install rust ${{ matrix.platform.toolchain }}
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: ${{ matrix.platform.toolchain }}
|
||||
target: ${{ matrix.platform.target }}
|
||||
override: true
|
||||
default: true
|
||||
|
||||
- name: install Linux dependencies
|
||||
if: contains(matrix.platform.target, 'unknown-linux')
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y webkit2gtk-4.0 libayatana-appindicator3-dev
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
|
||||
- name: delete lockfile
|
||||
run: rm Cargo.lock
|
||||
|
||||
- name: Downgrade crates with MSRV conflict
|
||||
# The --precise flag can only be used once per invocation.
|
||||
run: |
|
||||
cargo update -p system-deps:6.2.0 --precise 6.1.1
|
||||
cargo update -p toml:0.7.8 --precise 0.7.3
|
||||
cargo update -p toml_edit:0.19.15 --precise 0.19.8
|
||||
cargo update -p embed-resource --precise 2.3.0
|
||||
cargo update -p toml_datetime --precise 0.6.1
|
||||
cargo update -p serde_spanned --precise 0.6.1
|
||||
cargo update -p winnow --precise 0.4.1
|
||||
cargo update -p plist --precise 1.5.1
|
||||
cargo update -p time --precise 0.3.15
|
||||
cargo update -p ignore --precise 0.4.18
|
||||
cargo update -p raw-window-handle --precise 0.5.0
|
||||
cargo update -p cargo_toml:0.15.3 --precise 0.15.2
|
||||
cargo update -p zbus --precise 3.13.0
|
||||
cargo update -p zbus_names --precise 2.5.0
|
||||
cargo update -p colored --precise 2.0.2
|
||||
cargo update -p tempfile --precise 3.6.0
|
||||
cargo update -p serde_with:3.4.0 --precise 3.0.0
|
||||
cargo update -p tokio --precise 1.29.0
|
||||
cargo update -p flate2 --precise 1.0.26
|
||||
cargo update -p h2 --precise 0.3.20
|
||||
cargo update -p reqwest --precise 0.11.18
|
||||
cargo update -p bstr --precise 1.6.2
|
||||
cargo update -p cfg-expr:0.15.6 --precise 0.15.4
|
||||
cargo update -p memchr --precise 2.6.2
|
||||
cargo update -p async-executor --precise 1.5.1
|
||||
cargo update -p proptest --precise 1.2.0
|
||||
cargo update -p regex --precise 1.9.6
|
||||
cargo update -p bstr --precise 1.6.2
|
||||
cargo update -p backtrace --precise 0.3.68
|
||||
cargo update -p blocking --precise 1.4.1
|
||||
cargo update -p ignore --precise 0.4.18
|
||||
cargo update -p regex --precise 1.9.6
|
||||
cargo update -p globset --precise 0.4.13
|
||||
cargo update -p crossbeam-channel --precise 0.5.8
|
||||
cargo update -p crossbeam-utils --precise 0.8.16
|
||||
cargo update -p image --precise 0.24.4
|
||||
cargo update -p async-process --precise 1.7.0
|
||||
cargo update -p is-terminal --precise 0.4.7
|
||||
cargo update -p tar --precise 0.4.39
|
||||
cargo update -p serde_json --precise 1.0.97
|
||||
cargo update -p arboard --precise 3.2.1
|
||||
cargo update -p petgraph --precise 0.6.3
|
||||
|
||||
- name: test build
|
||||
run: cargo check --target ${{ matrix.platform.target }} --features tracing,compression,wry,linux-protocol-headers,isolation,custom-protocol,api-all,cli,updater,system-tray,windows7-compat,http-multipart,test,
|
||||
|
||||
run-integration-tests:
|
||||
runs-on: ${{ matrix.platform }}
|
||||
needs: msrv-list
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
platform: [ubuntu-latest, macos-latest, windows-latest]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: install stable
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
- name: install Linux dependencies
|
||||
if: matrix.platform == 'ubuntu-latest'
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y webkit2gtk-4.0 libayatana-appindicator3-dev libfuse2
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
workspaces: |
|
||||
core -> ../target
|
||||
tooling/cli
|
||||
|
||||
- name: build CLI
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: build
|
||||
args: --manifest-path ./tooling/cli/Cargo.toml
|
||||
|
||||
- name: run integration tests
|
||||
run: cargo test --test '*' -- --ignored
|
||||
|
||||
- name: run CLI tests
|
||||
timeout-minutes: 30
|
||||
run: |
|
||||
cd ./tooling/cli/node
|
||||
yarn
|
||||
yarn build
|
||||
yarn test
|
||||
|
||||
version-or-publish:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 65
|
||||
outputs:
|
||||
change: ${{ steps.covector.outputs.change }}
|
||||
commandRan: ${{ steps.covector.outputs.commandRan }}
|
||||
successfulPublish: ${{ steps.covector.outputs.successfulPublish }}
|
||||
needs:
|
||||
- run-integration-tests
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 14
|
||||
registry-url: 'https://registry.npmjs.org'
|
||||
cache: yarn
|
||||
cache-dependency-path: tooling/*/yarn.lock
|
||||
|
||||
- name: cargo login
|
||||
run: cargo login ${{ secrets.ORG_CRATES_IO_TOKEN }}
|
||||
- name: git config
|
||||
run: |
|
||||
git config --global user.name "${{ github.event.pusher.name }}"
|
||||
git config --global user.email "${{ github.event.pusher.email }}"
|
||||
|
||||
- name: covector version or publish (publish when no change files present)
|
||||
uses: jbolda/covector/packages/action@covector-v0
|
||||
id: covector
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.ORG_NPM_TOKEN }}
|
||||
CARGO_AUDIT_OPTIONS: ${{ secrets.CARGO_AUDIT_OPTIONS }}
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
command: 'version-or-publish'
|
||||
createRelease: true
|
||||
|
||||
- name: Create Pull Request With Versions Bumped
|
||||
if: steps.covector.outputs.commandRan == 'version'
|
||||
uses: tauri-apps/create-pull-request@v3
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
branch: release/version-updates-v1
|
||||
title: Apply Version Updates From Current Changes (v1)
|
||||
commit-message: 'apply version updates'
|
||||
labels: 'version updates'
|
||||
body: ${{ steps.covector.outputs.change }}
|
||||
|
||||
- name: Trigger doc update
|
||||
if: |
|
||||
steps.covector.outputs.successfulPublish == 'true' &&
|
||||
steps.covector.outputs.packagesPublished != ''
|
||||
uses: peter-evans/repository-dispatch@v1
|
||||
with:
|
||||
token: ${{ secrets.ORG_TAURI_BOT_PAT }}
|
||||
repository: tauri-apps/tauri-docs
|
||||
event-type: update-docs
|
||||
|
||||
- name: Trigger `@tauri-apps/cli` publishing workflow
|
||||
if: |
|
||||
steps.covector.outputs.successfulPublish == 'true' &&
|
||||
contains(steps.covector.outputs.packagesPublished, '@tauri-apps/cli')
|
||||
uses: peter-evans/repository-dispatch@v1
|
||||
with:
|
||||
event-type: publish-js-cli
|
||||
client-payload: >-
|
||||
{"releaseId": "${{ steps.covector.outputs['-tauri-apps-cli-releaseId'] }}" }
|
||||
|
||||
- name: Trigger `tauri-cli` publishing workflow
|
||||
if: |
|
||||
steps.covector.outputs.successfulPublish == 'true' &&
|
||||
contains(steps.covector.outputs.packagesPublished, 'tauri-cli')
|
||||
uses: peter-evans/repository-dispatch@v1
|
||||
with:
|
||||
event-type: publish-clirs
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2019-2024 Tauri Programme within The Commons Conservancy
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
@@ -19,29 +19,30 @@ jobs:
|
||||
platform: [ubuntu-latest, macos-latest, windows-latest]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- run: npm i -g --force corepack
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20
|
||||
cache: 'pnpm'
|
||||
|
||||
- name: install stable
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
- name: install Linux dependencies
|
||||
if: matrix.platform == 'ubuntu-latest'
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y webkit2gtk-4.1 libayatana-appindicator3-dev libfuse2 librsvg2-dev
|
||||
sudo apt-get install -y webkit2gtk-4.0 libayatana-appindicator3-dev libfuse2
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
workspaces: |
|
||||
core -> ../target
|
||||
tooling/cli
|
||||
|
||||
- name: build CLI
|
||||
run: cargo build --manifest-path ./crates/tauri-cli/Cargo.toml
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: build
|
||||
args: --manifest-path ./tooling/cli/Cargo.toml
|
||||
|
||||
- name: run integration tests
|
||||
run: cargo test --test '*' -- --ignored
|
||||
@@ -49,19 +50,14 @@ jobs:
|
||||
- name: run CLI tests
|
||||
timeout-minutes: 30
|
||||
run: |
|
||||
cd ./packages/cli
|
||||
pnpm i --frozen-lockfile
|
||||
pnpm build
|
||||
pnpm test
|
||||
cd ./tooling/cli/node
|
||||
yarn
|
||||
yarn build
|
||||
yarn test
|
||||
|
||||
version-or-publish:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 65
|
||||
permissions:
|
||||
actions: write # required for workflow_dispatch
|
||||
contents: write # required to create new releases
|
||||
pull-requests: write # required to open version update pr
|
||||
id-token: write # pnpm provenance
|
||||
outputs:
|
||||
change: ${{ steps.covector.outputs.change }}
|
||||
commandRan: ${{ steps.covector.outputs.commandRan }}
|
||||
@@ -70,14 +66,15 @@ jobs:
|
||||
- run-integration-tests
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- run: npm i -g --force corepack
|
||||
- uses: actions/setup-node@v4
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 20
|
||||
node-version: 14
|
||||
registry-url: 'https://registry.npmjs.org'
|
||||
cache: yarn
|
||||
cache-dependency-path: tooling/*/yarn.lock
|
||||
|
||||
- name: cargo login
|
||||
run: cargo login ${{ secrets.ORG_CRATES_IO_TOKEN }}
|
||||
@@ -86,31 +83,20 @@ jobs:
|
||||
git config --global user.name "${{ github.event.pusher.name }}"
|
||||
git config --global user.email "${{ github.event.pusher.email }}"
|
||||
|
||||
- name: install Linux dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y webkit2gtk-4.1 libayatana-appindicator3-dev librsvg2-dev
|
||||
|
||||
- name: covector version or publish (publish when no change files present)
|
||||
uses: jbolda/covector/packages/action@covector-v0
|
||||
id: covector
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.ORG_NPM_TOKEN }}
|
||||
CARGO_AUDIT_OPTIONS: ${{ secrets.CARGO_AUDIT_OPTIONS }}
|
||||
NPM_CONFIG_PROVENANCE: true
|
||||
with:
|
||||
command: 'version-or-publish'
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
command: 'version-or-publish'
|
||||
createRelease: true
|
||||
recognizeContributors: true
|
||||
|
||||
- name: Sync Cargo.lock
|
||||
if: steps.covector.outputs.commandRan == 'version'
|
||||
run: cargo tree --depth 0
|
||||
|
||||
- name: Create Pull Request With Versions Bumped
|
||||
if: steps.covector.outputs.commandRan == 'version'
|
||||
uses: peter-evans/create-pull-request@67ccf781d68cd99b580ae25a5c18a1cc84ffff1f # 7.0.6
|
||||
uses: tauri-apps/create-pull-request@v3
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
branch: release/version-updates
|
||||
@@ -118,13 +104,12 @@ jobs:
|
||||
commit-message: 'apply version updates'
|
||||
labels: 'version updates'
|
||||
body: ${{ steps.covector.outputs.change }}
|
||||
sign-commits: true
|
||||
|
||||
- name: Trigger doc update
|
||||
if: |
|
||||
steps.covector.outputs.successfulPublish == 'true' &&
|
||||
steps.covector.outputs.packagesPublished != ''
|
||||
uses: peter-evans/repository-dispatch@ff45666b9427631e3450c54a1bcbee4d9ff4d7c0 # 3.0.0
|
||||
uses: peter-evans/repository-dispatch@v1
|
||||
with:
|
||||
token: ${{ secrets.ORG_TAURI_BOT_PAT }}
|
||||
repository: tauri-apps/tauri-docs
|
||||
@@ -134,14 +119,16 @@ jobs:
|
||||
if: |
|
||||
steps.covector.outputs.successfulPublish == 'true' &&
|
||||
contains(steps.covector.outputs.packagesPublished, '@tauri-apps/cli')
|
||||
run: gh workflow run 31554138 -r dev -f releaseId=${{ steps.covector.outputs['-tauri-apps-cli-releaseId'] }}
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
uses: peter-evans/repository-dispatch@v1
|
||||
with:
|
||||
event-type: publish-js-cli
|
||||
client-payload: >-
|
||||
{"releaseId": "${{ steps.covector.outputs['-tauri-apps-cli-releaseId'] }}" }
|
||||
|
||||
- name: Trigger `tauri-cli` publishing workflow
|
||||
if: |
|
||||
steps.covector.outputs.successfulPublish == 'true' &&
|
||||
contains(steps.covector.outputs.packagesPublished, 'tauri-cli')
|
||||
run: gh workflow run 31554139 -r dev
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
uses: peter-evans/repository-dispatch@v1
|
||||
with:
|
||||
event-type: publish-clirs
|
||||
|
||||
25
.github/workflows/deploy-schema-worker.yml
vendored
25
.github/workflows/deploy-schema-worker.yml
vendored
@@ -1,25 +0,0 @@
|
||||
# Copyright 2019-2024 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
name: deploy schema worker
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- dev
|
||||
paths:
|
||||
- '.github/workflows/deploy-schema-worker.yml'
|
||||
- 'crates/tauri-schema-worker/**'
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: cloudflare/wrangler-action@v3
|
||||
with:
|
||||
command: deploy
|
||||
workingDirectory: 'crates/tauri-schema-worker'
|
||||
apiToken: ${{ secrets.SCHEMA_WORKER_CLOUDFLARE_API_TOKEN }}
|
||||
accountId: ${{ secrets.SCHEMA_WORKER_CLOUDFLARE_ACCOUNT_ID }}
|
||||
45
.github/workflows/docker.yml
vendored
45
.github/workflows/docker.yml
vendored
@@ -1,4 +1,4 @@
|
||||
# Copyright 2019-2024 Tauri Programme within The Commons Conservancy
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
@@ -17,10 +17,12 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: install stable
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
|
||||
- name: install Linux dependencies
|
||||
run: |
|
||||
@@ -31,20 +33,23 @@ jobs:
|
||||
run: cargo install cross --git https://github.com/cross-rs/cross
|
||||
|
||||
- name: Upload cross
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: cross
|
||||
path: '~/.cargo/bin/cross'
|
||||
if-no-files-found: error
|
||||
|
||||
- name: build CLI
|
||||
run: cargo build --manifest-path ./crates/tauri-cli/Cargo.toml
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: build
|
||||
args: --manifest-path ./tooling/cli/Cargo.toml
|
||||
|
||||
- name: Upload CLI
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: cargo-tauri
|
||||
path: crates/tauri-cli/target/debug/cargo-tauri
|
||||
path: tooling/cli/target/debug/cargo-tauri
|
||||
if-no-files-found: error
|
||||
|
||||
docker:
|
||||
@@ -59,27 +64,29 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: install stable
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
targets: ${{ matrix.target.name }}
|
||||
toolchain: stable
|
||||
override: true
|
||||
default: true
|
||||
target: ${{ matrix.target.name }}
|
||||
|
||||
- run: npm i -g --force corepack
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@v4
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 'lts/*'
|
||||
node-version: 16
|
||||
|
||||
- name: Download cross
|
||||
uses: actions/download-artifact@v4.1.7
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: cross
|
||||
path: '~/.cargo/bin'
|
||||
|
||||
- name: Download CLI
|
||||
uses: actions/download-artifact@v4.1.7
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: cargo-tauri
|
||||
path: 'examples/api'
|
||||
@@ -108,14 +115,14 @@ jobs:
|
||||
- name: install dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y webkit2gtk-4.1 libayatana-appindicator3-dev
|
||||
sudo apt-get install -y webkit2gtk-4.0 libayatana-appindicator3-dev
|
||||
|
||||
- name: Test
|
||||
run: |
|
||||
cd packages/api
|
||||
pnpm i --frozen-lockfile && pnpm build
|
||||
cd tooling/api
|
||||
yarn && yarn build
|
||||
cd ../../examples/api
|
||||
pnpm i --frozen-lockfile
|
||||
yarn
|
||||
. .setup-cross.sh
|
||||
chmod +x cargo-tauri
|
||||
chmod +x $HOME/.cargo/bin/cross
|
||||
|
||||
51
.github/workflows/fmt.yml
vendored
51
.github/workflows/fmt.yml
vendored
@@ -1,51 +0,0 @@
|
||||
# Copyright 2019-2024 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
name: check formatting
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
rustfmt:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: install Rust stable and rustfmt
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
components: rustfmt
|
||||
|
||||
- name: run cargo fmt
|
||||
run: cargo fmt --all -- --check
|
||||
|
||||
prettier:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- run: npm i -g --force corepack
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 'lts/*'
|
||||
cache: 'pnpm'
|
||||
- run: pnpm i --frozen-lockfile
|
||||
- run: pnpm format:check
|
||||
|
||||
taplo:
|
||||
name: taplo (.toml files)
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: install Rust stable
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
|
||||
- name: install taplo-cli
|
||||
uses: taiki-e/install-action@v2
|
||||
with:
|
||||
tool: taplo-cli
|
||||
|
||||
- run: taplo fmt --check --diff
|
||||
70
.github/workflows/lint-cli.yml
vendored
Normal file
70
.github/workflows/lint-cli.yml
vendored
Normal file
@@ -0,0 +1,70 @@
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
name: lint cli
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- dev
|
||||
- 1.x
|
||||
pull_request:
|
||||
paths:
|
||||
- '.github/workflows/lint-cli.yml'
|
||||
- 'tooling/cli/**'
|
||||
|
||||
env:
|
||||
RUST_BACKTRACE: 1
|
||||
CARGO_PROFILE_DEV_DEBUG: 0 # This would add unnecessary bloat to the target folder, decreasing cache efficiency.
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
fmt:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: minimal
|
||||
toolchain: stable
|
||||
override: true
|
||||
components: rustfmt
|
||||
|
||||
- uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: fmt
|
||||
args: --manifest-path ./tooling/cli/Cargo.toml --all -- --check
|
||||
|
||||
clippy:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: minimal
|
||||
toolchain: stable
|
||||
override: true
|
||||
components: clippy
|
||||
|
||||
- name: install dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y libgtk-3-dev
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
workspaces: tooling/cli
|
||||
|
||||
- uses: actions-rs/clippy-check@v1
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
args: --manifest-path ./tooling/cli/Cargo.toml --all-targets --all-features -- -D warnings
|
||||
name: cli
|
||||
83
.github/workflows/lint-core.yml
vendored
Normal file
83
.github/workflows/lint-core.yml
vendored
Normal file
@@ -0,0 +1,83 @@
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
name: lint core
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- dev
|
||||
- 1.x
|
||||
pull_request:
|
||||
paths:
|
||||
- '.github/workflows/lint-core.yml'
|
||||
- 'core/**'
|
||||
- '!core/tauri/scripts/**'
|
||||
- 'examples/**'
|
||||
|
||||
env:
|
||||
RUST_BACKTRACE: 1
|
||||
CARGO_PROFILE_DEV_DEBUG: 0 # This would add unnecessary bloat to the target folder, decreasing cache efficiency.
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
fmt:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: minimal
|
||||
toolchain: stable
|
||||
override: true
|
||||
components: rustfmt
|
||||
|
||||
- uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: fmt
|
||||
args: --all -- --check
|
||||
|
||||
clippy:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
clippy:
|
||||
- { args: '', key: 'empty' }
|
||||
- {
|
||||
args: '--features compression,wry,linux-protocol-headers,isolation,custom-protocol,api-all,cli,updater,system-tray,windows7-compat,http-multipart,test',
|
||||
key: 'all'
|
||||
}
|
||||
- { args: '--features custom-protocol', key: 'custom-protocol' }
|
||||
- { args: '--features api-all', key: 'api-all' }
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: install dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y webkit2gtk-4.0 libayatana-appindicator3-dev
|
||||
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: minimal
|
||||
toolchain: stable
|
||||
override: true
|
||||
components: clippy
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
workspaces: core -> ../target
|
||||
save-if: ${{ matrix.clippy.key == 'all' }}
|
||||
|
||||
- uses: actions-rs/clippy-check@v1
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
args: --manifest-path ./core/tauri/Cargo.toml --all-targets ${{ matrix.clippy.args }} -- -D warnings
|
||||
name: ${{ matrix.clippy.key }}
|
||||
56
.github/workflows/lint-js.yml
vendored
56
.github/workflows/lint-js.yml
vendored
@@ -1,4 +1,4 @@
|
||||
# Copyright 2019-2024 Tauri Programme within The Commons Conservancy
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
@@ -8,33 +8,53 @@ on:
|
||||
pull_request:
|
||||
paths:
|
||||
- '.github/workflows/lint-js.yml'
|
||||
- 'packages/**'
|
||||
- 'tooling/cli/node/**'
|
||||
- 'tooling/api/**'
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
eslint:
|
||||
eslint-cli:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- run: npm i -g --force corepack
|
||||
- uses: actions/setup-node@v4
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 'lts/*'
|
||||
cache: 'pnpm'
|
||||
- run: pnpm i --frozen-lockfile
|
||||
- run: pnpm eslint:check
|
||||
node-version: '14'
|
||||
cache: yarn
|
||||
cache-dependency-path: tooling/cli/node/yarn.lock
|
||||
- name: install deps via yarn
|
||||
working-directory: ./tooling/cli/node/
|
||||
run: yarn
|
||||
# nothing to lint
|
||||
#- name: run lint
|
||||
# working-directory: ./tooling/cli/node/
|
||||
# run: yarn lint
|
||||
- name: run format
|
||||
working-directory: ./tooling/cli/node/
|
||||
run: yarn format:check
|
||||
|
||||
typescript:
|
||||
eslint-api:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- run: npm i -g --force corepack
|
||||
- uses: actions/setup-node@v4
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 'lts/*'
|
||||
cache: 'pnpm'
|
||||
- run: pnpm i --frozen-lockfile
|
||||
- run: pnpm ts:check
|
||||
node-version: '14'
|
||||
cache: yarn
|
||||
cache-dependency-path: tooling/api/yarn.lock
|
||||
|
||||
- name: install deps via yarn
|
||||
working-directory: ./tooling/api/
|
||||
run: yarn
|
||||
- name: run ts:check
|
||||
working-directory: ./tooling/api/
|
||||
run: yarn ts:check
|
||||
- name: run lint
|
||||
working-directory: ./tooling/api/
|
||||
run: yarn lint
|
||||
- name: run format
|
||||
working-directory: ./tooling/api/
|
||||
run: yarn format:check
|
||||
|
||||
43
.github/workflows/lint-rust.yml
vendored
43
.github/workflows/lint-rust.yml
vendored
@@ -1,43 +0,0 @@
|
||||
# Copyright 2019-2024 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
name: lint rust
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- dev
|
||||
pull_request:
|
||||
paths:
|
||||
- '.github/workflows/lint-rust.yml'
|
||||
- 'crates/**'
|
||||
|
||||
env:
|
||||
RUST_BACKTRACE: 1
|
||||
CARGO_PROFILE_DEV_DEBUG: 0 # This would add unnecessary bloat to the target folder, decreasing cache efficiency.
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
clippy:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: install rust stable and clippy
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
components: clippy
|
||||
|
||||
- name: install dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.1 libayatana-appindicator3-dev
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
|
||||
- run: cargo clippy --all-targets --all-features -- -D warnings
|
||||
215
.github/workflows/publish-cli-js.yml
vendored
215
.github/workflows/publish-cli-js.yml
vendored
@@ -1,4 +1,4 @@
|
||||
# Copyright 2019-2024 Tauri Programme within The Commons Conservancy
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
@@ -18,7 +18,7 @@ on:
|
||||
|
||||
defaults:
|
||||
run:
|
||||
working-directory: packages/cli/
|
||||
working-directory: tooling/cli/node/
|
||||
|
||||
jobs:
|
||||
build:
|
||||
@@ -30,102 +30,96 @@ jobs:
|
||||
target: x86_64-apple-darwin
|
||||
architecture: x64
|
||||
build: |
|
||||
pnpm build --target=x86_64-apple-darwin
|
||||
yarn build:release
|
||||
strip -x *.node
|
||||
- host: windows-latest
|
||||
build: pnpm build
|
||||
build: yarn build:release
|
||||
target: x86_64-pc-windows-msvc
|
||||
architecture: x64
|
||||
- host: windows-latest
|
||||
build: pnpm build --target i686-pc-windows-msvc
|
||||
build: yarn build:release --target i686-pc-windows-msvc
|
||||
target: i686-pc-windows-msvc
|
||||
architecture: x64
|
||||
- host: windows-latest
|
||||
architecture: x64
|
||||
target: aarch64-pc-windows-msvc
|
||||
build: pnpm build --target aarch64-pc-windows-msvc
|
||||
- host: ubuntu-22.04
|
||||
build: yarn build:release --target aarch64-pc-windows-msvc --features native-tls,native-tls-vendored --cargo-flags="--no-default-features"
|
||||
- host: ubuntu-20.04
|
||||
target: x86_64-unknown-linux-gnu
|
||||
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian
|
||||
build: |
|
||||
npm i -g --force corepack
|
||||
cd packages/cli
|
||||
pnpm build --target x86_64-unknown-linux-gnu
|
||||
cd tooling/cli/node
|
||||
yarn build:release --target x86_64-unknown-linux-gnu
|
||||
strip *.node
|
||||
- host: ubuntu-22.04
|
||||
- host: ubuntu-20.04
|
||||
target: x86_64-unknown-linux-musl
|
||||
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
|
||||
build: |
|
||||
cd packages/cli
|
||||
pnpm build
|
||||
cd tooling/cli/node
|
||||
yarn build:release
|
||||
strip *.node
|
||||
- host: macos-latest
|
||||
target: aarch64-apple-darwin
|
||||
build: |
|
||||
pnpm build --features native-tls-vendored --target=aarch64-apple-darwin
|
||||
yarn build:release --target=aarch64-apple-darwin
|
||||
strip -x *.node
|
||||
- host: ubuntu-22.04
|
||||
- host: ubuntu-20.04
|
||||
target: aarch64-unknown-linux-gnu
|
||||
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian-aarch64
|
||||
build: |
|
||||
npm i -g --force corepack
|
||||
cd packages/cli
|
||||
pnpm build --target aarch64-unknown-linux-gnu
|
||||
cd tooling/cli/node
|
||||
yarn build:release --target aarch64-unknown-linux-gnu
|
||||
aarch64-unknown-linux-gnu-strip *.node
|
||||
- host: ubuntu-22.04
|
||||
- host: ubuntu-20.04
|
||||
architecture: x64
|
||||
target: armv7-unknown-linux-gnueabihf
|
||||
setup: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf -y
|
||||
build: |
|
||||
pnpm build --target=armv7-unknown-linux-gnueabihf
|
||||
yarn build:release --target=armv7-unknown-linux-gnueabihf
|
||||
arm-linux-gnueabihf-strip *.node
|
||||
- host: ubuntu-22.04
|
||||
- host: ubuntu-20.04
|
||||
architecture: x64
|
||||
target: aarch64-unknown-linux-musl
|
||||
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
|
||||
build: |
|
||||
cd packages/cli
|
||||
cd tooling/cli/node
|
||||
rustup target add aarch64-unknown-linux-musl
|
||||
pnpm build --target aarch64-unknown-linux-musl
|
||||
yarn build:release --target aarch64-unknown-linux-musl
|
||||
/aarch64-linux-musl-cross/bin/aarch64-linux-musl-strip *.node
|
||||
- host: ubuntu-22.04
|
||||
architecture: x64
|
||||
target: riscv64gc-unknown-linux-gnu
|
||||
setup: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install gcc-riscv64-linux-gnu g++-riscv64-linux-gnu -y
|
||||
build: |
|
||||
pnpm build --target=riscv64gc-unknown-linux-gnu
|
||||
riscv64-linux-gnu-strip *.node
|
||||
name: stable - ${{ matrix.settings.target }} - node@20
|
||||
name: stable - ${{ matrix.settings.target }} - node@16
|
||||
runs-on: ${{ matrix.settings.host }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- run: npm i -g --force corepack
|
||||
- uses: actions/checkout@v3
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@v4
|
||||
uses: actions/setup-node@v3
|
||||
if: ${{ !matrix.settings.docker }}
|
||||
with:
|
||||
node-version: 20
|
||||
cache: 'pnpm'
|
||||
node-version: 16
|
||||
check-latest: true
|
||||
cache: yarn
|
||||
cache-dependency-path: 'tooling/cli/node/yarn.lock'
|
||||
architecture: ${{ matrix.settings.architecture }}
|
||||
- name: Install Rust
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
- name: Install
|
||||
uses: actions-rs/toolchain@v1
|
||||
if: ${{ !matrix.settings.docker }}
|
||||
with:
|
||||
targets: ${{ matrix.settings.target }}
|
||||
profile: minimal
|
||||
override: true
|
||||
toolchain: stable
|
||||
target: ${{ matrix.settings.target }}
|
||||
- uses: Swatinem/rust-cache@v1
|
||||
with:
|
||||
key: ${{ matrix.settings.target }}
|
||||
working-directory: 'tooling/cli/'
|
||||
if: ${{ matrix.settings.docker }}
|
||||
- name: Setup toolchain
|
||||
run: ${{ matrix.settings.setup }}
|
||||
if: ${{ matrix.settings.setup }}
|
||||
shell: bash
|
||||
- name: Install dependencies
|
||||
run: pnpm i --frozen-lockfile --ignore-scripts
|
||||
run: yarn install --ignore-scripts --frozen-lockfile --registry https://registry.npmjs.org --network-timeout 300000
|
||||
|
||||
- name: Build in docker
|
||||
uses: addnab/docker-run-action@v3
|
||||
@@ -141,16 +135,16 @@ jobs:
|
||||
shell: bash
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: bindings-${{ matrix.settings.target }}
|
||||
path: packages/cli/${{ env.APP_NAME }}.*.node
|
||||
path: tooling/cli/node/${{ env.APP_NAME }}.*.node
|
||||
if-no-files-found: error
|
||||
# build-freebsd:
|
||||
# runs-on: macos-10.15
|
||||
# name: Build FreeBSD
|
||||
# steps:
|
||||
# - uses: actions/checkout@v4
|
||||
# - uses: actions/checkout@v3
|
||||
# - name: Build
|
||||
# id: build
|
||||
# uses: vmactions/freebsd-vm@v0.1.6
|
||||
@@ -166,7 +160,7 @@ jobs:
|
||||
# prepare: |
|
||||
# pkg install -y curl node14 python2
|
||||
# curl -qL https://www.npmjs.com/install.sh | sh
|
||||
# npm install -g pnpm
|
||||
# npm install -g yarn
|
||||
# curl https://sh.rustup.rs -sSf --output rustup.sh
|
||||
# sh rustup.sh -y --profile minimal --default-toolchain stable
|
||||
# export PATH="/usr/local/cargo/bin:$PATH"
|
||||
@@ -174,8 +168,8 @@ jobs:
|
||||
# rustc --version
|
||||
# echo "~~~~ node -v ~~~~"
|
||||
# node -v
|
||||
# echo "~~~~ pnpm --version ~~~~"
|
||||
# pnpm --version
|
||||
# echo "~~~~ yarn --version ~~~~"
|
||||
# yarn --version
|
||||
# run: |
|
||||
# export PATH="/usr/local/cargo/bin:$PATH"
|
||||
# pwd
|
||||
@@ -183,17 +177,17 @@ jobs:
|
||||
# whoami
|
||||
# env
|
||||
# freebsd-version
|
||||
# cd ./packages/cli/
|
||||
# pnpm i --frozen-lockfile --ignore-scripts
|
||||
# pnpm build
|
||||
# cd ./tooling/cli/node/
|
||||
# yarn install --ignore-scripts --frozen-lockfile --registry https://registry.npmjs.org --network-timeout 300000
|
||||
# yarn build:release
|
||||
# strip -x *.node
|
||||
# rm -rf node_modules
|
||||
# rm -rf ../../target
|
||||
# rm -rf ../target
|
||||
# - name: Upload artifact
|
||||
# uses: actions/upload-artifact@v4
|
||||
# uses: actions/upload-artifact@v3
|
||||
# with:
|
||||
# name: bindings-freebsd
|
||||
# path: packages/cli/${{ env.APP_NAME }}.*.node
|
||||
# path: tooling/cli/node/${{ env.APP_NAME }}.*.node
|
||||
# if-no-files-found: error
|
||||
test-macOS-windows-binding:
|
||||
name: Test bindings on ${{ matrix.settings.target }} - node@${{ matrix.node }}
|
||||
@@ -204,33 +198,35 @@ jobs:
|
||||
matrix:
|
||||
settings:
|
||||
- host: macos-latest
|
||||
target: aarch64-apple-darwin
|
||||
target: 'x86_64-apple-darwin'
|
||||
- host: windows-latest
|
||||
target: x86_64-pc-windows-msvc
|
||||
node:
|
||||
- '14'
|
||||
- '16'
|
||||
- '18'
|
||||
- '20'
|
||||
runs-on: ${{ matrix.settings.host }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- run: npm i -g --force corepack
|
||||
- uses: actions/checkout@v3
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@v4
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: ${{ matrix.node }}
|
||||
cache: 'pnpm'
|
||||
check-latest: true
|
||||
cache: yarn
|
||||
cache-dependency-path: 'tooling/cli/node/yarn.lock'
|
||||
- name: Install dependencies
|
||||
run: pnpm i --frozen-lockfile --ignore-scripts
|
||||
run: yarn install --ignore-scripts --frozen-lockfile --registry https://registry.npmjs.org --network-timeout 300000
|
||||
- name: Download artifacts
|
||||
uses: actions/download-artifact@v4.1.7
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: bindings-${{ matrix.settings.target }}
|
||||
path: 'packages/cli/'
|
||||
path: 'tooling/cli/node/'
|
||||
- name: List packages
|
||||
run: ls -R .
|
||||
shell: bash
|
||||
- name: Test bindings
|
||||
run: pnpm test
|
||||
run: yarn test
|
||||
test-linux-x64-gnu-binding:
|
||||
name: Test bindings on Linux-x64-gnu - node@${{ matrix.node }}
|
||||
needs:
|
||||
@@ -239,33 +235,35 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
node:
|
||||
- '14'
|
||||
- '16'
|
||||
- '18'
|
||||
- '20'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- run: npm i -g --force corepack
|
||||
- uses: actions/checkout@v3
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@v4
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: ${{ matrix.node }}
|
||||
cache: 'pnpm'
|
||||
check-latest: true
|
||||
cache: yarn
|
||||
cache-dependency-path: 'tooling/cli/node/yarn.lock'
|
||||
- name: Install dependencies
|
||||
run: pnpm i --frozen-lockfile --ignore-scripts
|
||||
run: yarn install --ignore-scripts --frozen-lockfile --registry https://registry.npmjs.org --network-timeout 300000
|
||||
- name: Download artifacts
|
||||
uses: actions/download-artifact@v4.1.7
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: bindings-x86_64-unknown-linux-gnu
|
||||
path: 'packages/cli'
|
||||
path: 'tooling/cli/node/'
|
||||
- name: List packages
|
||||
run: ls -R .
|
||||
shell: bash
|
||||
- name: install system dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y webkit2gtk-4.1 libayatana-appindicator3-dev librsvg2-dev
|
||||
sudo apt-get install -y webkit2gtk-4.0 libayatana-appindicator3-dev
|
||||
- name: Test bindings
|
||||
run: pnpm test
|
||||
run: yarn test
|
||||
test-linux-x64-musl-binding:
|
||||
name: Test bindings on x86_64-unknown-linux-musl - node@${{ matrix.node }}
|
||||
needs:
|
||||
@@ -274,38 +272,40 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
node:
|
||||
- '14'
|
||||
- '16'
|
||||
- '18'
|
||||
- '20'
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- run: npm i -g --force corepack
|
||||
- uses: actions/checkout@v3
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@v4
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: ${{ matrix.node }}
|
||||
cache: 'pnpm'
|
||||
check-latest: true
|
||||
cache: yarn
|
||||
cache-dependency-path: 'tooling/cli/node/yarn.lock'
|
||||
- name: Install dependencies
|
||||
run: pnpm i --frozen-lockfile --ignore-scripts
|
||||
run: yarn install --ignore-scripts --frozen-lockfile --registry https://registry.npmjs.org --network-timeout 300000
|
||||
- name: Download artifacts
|
||||
uses: actions/download-artifact@v4.1.7
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: bindings-x86_64-unknown-linux-musl
|
||||
path: 'packages/cli/'
|
||||
path: 'tooling/cli/node/'
|
||||
- name: List packages
|
||||
run: ls -R .
|
||||
shell: bash
|
||||
- name: Setup and run tests
|
||||
run: |
|
||||
pnpm tauri --help
|
||||
yarn tauri --help
|
||||
ls -la
|
||||
#- name: Setup and run tests
|
||||
# run: |
|
||||
# rustup install stable
|
||||
# rustup default stable
|
||||
# pnpm test
|
||||
# yarn test
|
||||
# ls -la
|
||||
test-linux-arm-bindings:
|
||||
name: Test bindings on ${{ matrix.image }} - node@${{ matrix.node }}
|
||||
@@ -315,28 +315,32 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
node:
|
||||
- '14'
|
||||
- '16'
|
||||
- '18'
|
||||
- '20'
|
||||
image:
|
||||
- ghcr.io/napi-rs/napi-rs/nodejs:aarch64-16
|
||||
- ghcr.io/napi-rs/napi-rs/nodejs:armhf-16
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- run: docker run --rm --privileged multiarch/qemu-user-static:register --reset
|
||||
working-directory: ${{ github.workspace }}
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v3
|
||||
- name: List packages
|
||||
run: ls -R .
|
||||
shell: bash
|
||||
- name: Install dependencies
|
||||
run: yarn install --ignore-scripts --ignore-platform --frozen-lockfile --registry https://registry.npmjs.org --network-timeout 300000
|
||||
- name: Download aarch64-gnu artifacts
|
||||
uses: actions/download-artifact@v4.1.7
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: bindings-aarch64-unknown-linux-gnu
|
||||
path: 'packages/cli'
|
||||
path: 'tooling/cli/node/'
|
||||
- name: Download armv7-gnueabihf artifacts
|
||||
uses: actions/download-artifact@v4.1.7
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: bindings-armv7-unknown-linux-gnueabihf
|
||||
path: 'packages/cli/'
|
||||
path: 'tooling/cli/node/'
|
||||
# TODO: actually run test, blocked by https://github.com/rust-lang/cargo/issues/8719
|
||||
- uses: addnab/docker-run-action@v3
|
||||
with:
|
||||
@@ -347,15 +351,15 @@ jobs:
|
||||
set -e
|
||||
export PATH=/usr/local/cargo/bin/:/usr/local/fnm:$PATH
|
||||
apt-get update
|
||||
DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get install --no-install-recommends -y unzip libayatana-appindicator3-dev
|
||||
DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get install --no-install-recommends -y unzip webkit2gtk-4.0 libayatana-appindicator3-dev
|
||||
bash
|
||||
curl https://sh.rustup.rs -sSf | bash -s -- -y
|
||||
curl -fsSL https://fnm.vercel.app/install | bash -s -- --install-dir "/usr/local/fnm" --skip-shell
|
||||
eval "$(fnm env --use-on-cd)"
|
||||
fnm install ${{ matrix.node }}
|
||||
fnm use ${{ matrix.node }}
|
||||
cd packages/cli
|
||||
node tauri.js --help
|
||||
cd tooling/cli/node
|
||||
yarn tauri --help
|
||||
ls -la
|
||||
publish:
|
||||
name: Publish
|
||||
@@ -366,25 +370,23 @@ jobs:
|
||||
- test-linux-x64-gnu-binding
|
||||
- test-linux-x64-musl-binding
|
||||
#- test-linux-arm-bindings
|
||||
permissions:
|
||||
contents: write # update release
|
||||
id-token: write # npm provenance
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- run: npm i -g --force corepack
|
||||
- uses: actions/checkout@v3
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@v4
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 20
|
||||
cache: 'pnpm'
|
||||
node-version: 16
|
||||
check-latest: true
|
||||
cache: yarn
|
||||
cache-dependency-path: 'tooling/cli/node/yarn.lock'
|
||||
- name: Install dependencies
|
||||
run: pnpm i --frozen-lockfile --ignore-scripts
|
||||
run: yarn install --ignore-scripts --frozen-lockfile --registry https://registry.npmjs.org --network-timeout 300000
|
||||
- name: Download all artifacts
|
||||
uses: actions/download-artifact@v4.1.7
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
path: packages/cli/artifacts
|
||||
path: tooling/cli/node/artifacts
|
||||
- name: Move artifacts
|
||||
run: pnpm artifacts
|
||||
run: yarn artifacts
|
||||
- name: List packages
|
||||
run: ls -R ./npm
|
||||
shell: bash
|
||||
@@ -395,5 +397,4 @@ jobs:
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
NPM_TOKEN: ${{ secrets.ORG_NPM_TOKEN }}
|
||||
RELEASE_ID: ${{ github.event.client_payload.releaseId || inputs.releaseId }}
|
||||
NPM_CONFIG_PROVENANCE: true
|
||||
RELEASE_ID: ${{ github.event.client_payload.releaseId || github.event.inputs.releaseId }}
|
||||
|
||||
24
.github/workflows/publish-cli-rs.yml
vendored
24
.github/workflows/publish-cli-rs.yml
vendored
@@ -1,4 +1,4 @@
|
||||
# Copyright 2019-2024 Tauri Programme within The Commons Conservancy
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
@@ -18,7 +18,7 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
config:
|
||||
- os: ubuntu-22.04
|
||||
- os: ubuntu-20.04
|
||||
rust_target: x86_64-unknown-linux-gnu
|
||||
ext: ''
|
||||
args: ''
|
||||
@@ -37,10 +37,11 @@ jobs:
|
||||
- os: windows-latest
|
||||
rust_target: aarch64-pc-windows-msvc
|
||||
ext: '.exe'
|
||||
args: ''
|
||||
args: '--no-default-features --features native-tls,native-tls-vendored'
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: 'Setup Rust'
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
@@ -58,13 +59,16 @@ jobs:
|
||||
sudo apt-get install -y libgtk-3-dev
|
||||
|
||||
- name: Build CLI
|
||||
run: cargo build --manifest-path ./crates/tauri-cli/Cargo.toml --profile release-size-optimized ${{ matrix.config.args }}
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: build
|
||||
args: --manifest-path ./tooling/cli/Cargo.toml --release ${{ matrix.config.args }}
|
||||
|
||||
- name: Upload CLI
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: cargo-tauri-${{ matrix.config.rust_target }}${{ matrix.config.ext }}
|
||||
path: target/release-size-optimized/cargo-tauri${{ matrix.config.ext }}
|
||||
path: tooling/cli/target/release/cargo-tauri${{ matrix.config.ext }}
|
||||
if-no-files-found: error
|
||||
|
||||
upload:
|
||||
@@ -73,10 +77,10 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Download built CLIs
|
||||
uses: actions/download-artifact@v4.1.7
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
path: outputs
|
||||
|
||||
@@ -84,7 +88,7 @@ jobs:
|
||||
run: ./.scripts/ci/pack-cli.sh
|
||||
|
||||
- name: Get CLI version
|
||||
run: echo "CLI_VERSION=$(cat crates/tauri-cli/metadata-v2.json | jq '."cli.js".version' -r)" >> $GITHUB_ENV
|
||||
run: echo "CLI_VERSION=$(cat tooling/cli/metadata.json | jq '."cli.js".version' -r)" >> $GITHUB_ENV
|
||||
|
||||
- name: Publish release
|
||||
uses: softprops/action-gh-release@50195ba7f6f93d1ac97ba8332a178e008ad176aa
|
||||
|
||||
44
.github/workflows/supply-chain.yml
vendored
44
.github/workflows/supply-chain.yml
vendored
@@ -1,44 +0,0 @@
|
||||
# Copyright 2019-2024 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
name: supply chain health status
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: '0 0 * * *'
|
||||
push:
|
||||
branches:
|
||||
- dev
|
||||
paths:
|
||||
- '.github/workflows/supply-chain.yml'
|
||||
- '**/Cargo.lock'
|
||||
- '**/Cargo.toml'
|
||||
jobs:
|
||||
cargo-vet:
|
||||
name: check rust dependencies with cargo vet
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CARGO_VET_VERSION: 0.9.1
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
- name: Install Rust
|
||||
run: rustup update stable && rustup default stable
|
||||
|
||||
- uses: actions/cache@v4
|
||||
with:
|
||||
path: ${{ runner.tool_cache }}/cargo-vet
|
||||
key: cargo-vet-bin-${{ env.CARGO_VET_VERSION }}
|
||||
|
||||
- name: Add the tool cache directory to the search path
|
||||
run: echo "${{ runner.tool_cache }}/cargo-vet/bin" >> $GITHUB_PATH
|
||||
|
||||
- name: Ensure that the tool cache is populated with the cargo-vet binary
|
||||
run: cargo install --root ${{ runner.tool_cache }}/cargo-vet --version ${{ env.CARGO_VET_VERSION }} cargo-vet
|
||||
|
||||
# Enable this again to break the workflow once we have a reasonable amount of suggestions to get to a clean base line
|
||||
# - name: Invoke cargo-vet
|
||||
# run: cargo vet --locked
|
||||
|
||||
- name: Provide audit suggestions
|
||||
run: cargo vet suggest
|
||||
106
.github/workflows/test-android.yml
vendored
106
.github/workflows/test-android.yml
vendored
@@ -1,106 +0,0 @@
|
||||
# Copyright 2019-2024 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
name: test android
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- '.github/workflows/test-android.yml'
|
||||
- 'crates/tauri-cli/templates/mobile/android/**'
|
||||
- 'crates/tauri-cli/src/mobile/**'
|
||||
- '!crates/tauri-cli/src/mobile/ios.rs'
|
||||
- '!crates/tauri-cli/src/mobile/ios/**'
|
||||
- 'crates/tauri-build/src/mobile.rs'
|
||||
- 'crates/tauri/mobile/android/**'
|
||||
- 'crates/tauri/mobile/android-codegen/**'
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ${{ matrix.platform }}
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
platform: [ubuntu-latest, macos-latest, windows-latest]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: install Rust 1.77.2
|
||||
uses: dtolnay/rust-toolchain@1.77.2
|
||||
|
||||
- name: install Linux dependencies
|
||||
if: matrix.platform == 'ubuntu-latest'
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.1
|
||||
|
||||
- run: npm i -g --force corepack
|
||||
- name: setup node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: lts/*
|
||||
cache: 'pnpm'
|
||||
|
||||
- uses: actions/setup-java@v3
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: 17
|
||||
cache: 'gradle'
|
||||
|
||||
- name: Setup NDK
|
||||
uses: nttld/setup-ndk@v1
|
||||
id: setup-ndk
|
||||
with:
|
||||
ndk-version: r25b
|
||||
local-cache: true
|
||||
|
||||
# TODO check after https://github.com/nttld/setup-ndk/issues/518 is fixed
|
||||
- name: Restore Android Symlinks
|
||||
if: matrix.platform == 'ubuntu-latest' || matrix.platform == 'macos-latest'
|
||||
run: |
|
||||
directory="${{ steps.setup-ndk.outputs.ndk-path }}/toolchains/llvm/prebuilt/linux-x86_64/bin"
|
||||
find "$directory" -type l | while read link; do
|
||||
current_target=$(readlink "$link")
|
||||
new_target="$directory/$(basename "$current_target")"
|
||||
ln -sf "$new_target" "$link"
|
||||
echo "Changed $(basename "$link") from $current_target to $new_target"
|
||||
done
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
|
||||
- name: build CLI
|
||||
run: cargo build --manifest-path ./crates/tauri-cli/Cargo.toml
|
||||
|
||||
- name: move CLI to cargo bin dir
|
||||
if: matrix.platform != 'windows-latest'
|
||||
run: mv ./target/debug/cargo-tauri $HOME/.cargo/bin
|
||||
|
||||
- name: move CLI to cargo bin dir
|
||||
if: matrix.platform == 'windows-latest'
|
||||
run: mv ./target/debug/cargo-tauri.exe $HOME/.cargo/bin
|
||||
|
||||
- run: pnpm i --frozen-lockfile
|
||||
|
||||
- name: build Tauri API
|
||||
working-directory: ./packages/api
|
||||
run: pnpm build
|
||||
|
||||
- name: init Android Studio project
|
||||
working-directory: ./examples/api
|
||||
run: cargo tauri android init
|
||||
env:
|
||||
NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
|
||||
|
||||
- name: build APK
|
||||
working-directory: ./examples/api
|
||||
run: cargo tauri android build
|
||||
env:
|
||||
NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
|
||||
38
.github/workflows/test-cli-js.yml
vendored
38
.github/workflows/test-cli-js.yml
vendored
@@ -1,4 +1,4 @@
|
||||
# Copyright 2019-2024 Tauri Programme within The Commons Conservancy
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
@@ -8,12 +8,12 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- dev
|
||||
- 1.x
|
||||
pull_request:
|
||||
paths:
|
||||
- '.github/workflows/test-cli-js.yml'
|
||||
- 'packages/cli/**'
|
||||
# currently` @tauri-apps/cli` only tests the template
|
||||
- 'crates/tauri-cli/templates/app/**'
|
||||
- 'tooling/cli/templates/app/**'
|
||||
|
||||
env:
|
||||
RUST_BACKTRACE: 1
|
||||
@@ -33,30 +33,36 @@ jobs:
|
||||
platform: [ubuntu-latest, macos-latest, windows-latest]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: install Rust stable
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
|
||||
- run: npm i -g --force corepack
|
||||
- name: setup node
|
||||
uses: actions/setup-node@v4
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
node-version: 'lts/*'
|
||||
cache: 'pnpm'
|
||||
toolchain: stable
|
||||
override: true
|
||||
- name: setup node
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 14
|
||||
cache: yarn
|
||||
cache-dependency-path: tooling/cli/node/yarn.lock
|
||||
|
||||
- name: install Linux dependencies
|
||||
if: matrix.platform == 'ubuntu-latest'
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y webkit2gtk-4.1 libayatana-appindicator3-dev librsvg2-dev
|
||||
sudo apt-get install -y webkit2gtk-4.0 libayatana-appindicator3-dev
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
workspaces: |
|
||||
tooling/cli
|
||||
tooling/cli/node/test/jest/fixtures/empty/src-tauri
|
||||
|
||||
- name: test
|
||||
timeout-minutes: 30
|
||||
run: |
|
||||
cd ./packages/cli
|
||||
pnpm i --frozen-lockfile
|
||||
pnpm build
|
||||
pnpm test
|
||||
cd ./tooling/cli/node
|
||||
yarn
|
||||
yarn build
|
||||
yarn test
|
||||
|
||||
39
.github/workflows/test-cli-rs.yml
vendored
39
.github/workflows/test-cli-rs.yml
vendored
@@ -1,4 +1,4 @@
|
||||
# Copyright 2019-2024 Tauri Programme within The Commons Conservancy
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
@@ -8,12 +8,11 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- dev
|
||||
- 1.x
|
||||
pull_request:
|
||||
paths:
|
||||
- '.github/workflows/test-cli-rs.yml'
|
||||
- 'crates/tauri-utils/**'
|
||||
- 'crates/tauri-bundler/**'
|
||||
- 'crates/tauri-cli/**'
|
||||
- 'tooling/cli/**'
|
||||
|
||||
env:
|
||||
RUST_BACKTRACE: 1
|
||||
@@ -25,36 +24,34 @@ concurrency:
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ${{ matrix.platform.os }}
|
||||
runs-on: ${{ matrix.platform }}
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
platform:
|
||||
- { target: x86_64-pc-windows-msvc, os: windows-latest }
|
||||
- {
|
||||
target: aarch64-pc-windows-msvc,
|
||||
os: windows-latest,
|
||||
args: --no-default-features --features native-tls-vendored
|
||||
}
|
||||
- { target: x86_64-unknown-linux-gnu, os: ubuntu-latest }
|
||||
- { target: x86_64-apple-darwin, os: macos-latest }
|
||||
platform: [ubuntu-latest, macos-latest, windows-latest]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: 'Setup Rust'
|
||||
uses: dtolnay/rust-toolchain@1.77.2
|
||||
- name: install stable
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
targets: ${{ matrix.platform.target }}
|
||||
toolchain: stable
|
||||
override: true
|
||||
|
||||
- name: install Linux dependencies
|
||||
if: matrix.platform.os == 'ubuntu-latest'
|
||||
if: matrix.platform == 'ubuntu-latest'
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.1 libayatana-appindicator3-dev librsvg2-dev
|
||||
sudo apt-get install -y libgtk-3-dev
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
workspaces: tooling/cli
|
||||
|
||||
- name: test CLI
|
||||
run: cargo test --manifest-path ./crates/tauri-cli/Cargo.toml ${{ matrix.platform.args }}
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: test
|
||||
args: --manifest-path ./tooling/cli/Cargo.toml
|
||||
|
||||
76
.github/workflows/test-core.yml
vendored
76
.github/workflows/test-core.yml
vendored
@@ -1,4 +1,4 @@
|
||||
# Copyright 2019-2024 Tauri Programme within The Commons Conservancy
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
@@ -8,15 +8,12 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- dev
|
||||
- 1.x
|
||||
pull_request:
|
||||
paths:
|
||||
- '.github/workflows/test-core.yml'
|
||||
- 'crates/**'
|
||||
- '!crates/tauri/scripts/**'
|
||||
- '!crates/tauri-cli/**'
|
||||
- '!crates/tauri-bundler/**'
|
||||
- '!crates/tauri-macos-sign/**'
|
||||
- '!crates/tauri-schema-generator/**'
|
||||
- 'core/**'
|
||||
- '!core/tauri/scripts/**'
|
||||
|
||||
env:
|
||||
RUST_BACKTRACE: 1
|
||||
@@ -37,68 +34,53 @@ jobs:
|
||||
- {
|
||||
target: x86_64-pc-windows-msvc,
|
||||
os: windows-latest,
|
||||
toolchain: '1.77.2',
|
||||
cross: false,
|
||||
command: 'test'
|
||||
toolchain: '1.61.0'
|
||||
}
|
||||
- {
|
||||
target: x86_64-unknown-linux-gnu,
|
||||
os: ubuntu-latest,
|
||||
toolchain: '1.77.2',
|
||||
cross: false,
|
||||
command: 'test'
|
||||
toolchain: '1.60.0'
|
||||
}
|
||||
- {
|
||||
target: aarch64-apple-darwin,
|
||||
os: macos-14,
|
||||
toolchain: '1.77.2',
|
||||
cross: false,
|
||||
command: 'test'
|
||||
}
|
||||
- {
|
||||
target: aarch64-apple-ios,
|
||||
target: x86_64-apple-darwin,
|
||||
os: macos-latest,
|
||||
toolchain: '1.77.2',
|
||||
cross: false,
|
||||
command: 'build'
|
||||
}
|
||||
- {
|
||||
target: aarch64-linux-android,
|
||||
os: ubuntu-latest,
|
||||
toolchain: '1.77.2',
|
||||
cross: true,
|
||||
command: 'build'
|
||||
toolchain: '1.60.0'
|
||||
}
|
||||
features:
|
||||
- { args: --no-default-features, key: no-default }
|
||||
- { args: --all-features, key: all }
|
||||
- {
|
||||
args: --no-default-features,
|
||||
key: no-default
|
||||
}
|
||||
- {
|
||||
args: --features api-all,
|
||||
key: api-all
|
||||
}
|
||||
- {
|
||||
args: --features tracing,compression,wry,linux-protocol-headers,isolation,custom-protocol,api-all,cli,updater,system-tray,windows7-compat,http-multipart,test,
|
||||
key: all
|
||||
}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: install Rust
|
||||
uses: dtolnay/rust-toolchain@master
|
||||
- name: install stable
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: ${{ matrix.platform.toolchain }}
|
||||
targets: ${{ matrix.platform.target }}
|
||||
target: ${{ matrix.platform.target }}
|
||||
override: true
|
||||
default: true
|
||||
|
||||
- name: install Linux dependencies
|
||||
if: contains(matrix.platform.target, 'unknown-linux')
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y webkit2gtk-4.1 libxdo-dev libayatana-appindicator3-dev
|
||||
sudo apt-get install -y webkit2gtk-4.0 libayatana-appindicator3-dev
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
prefix-key: v3
|
||||
workspaces: core -> ../target
|
||||
save-if: ${{ matrix.features.key == 'all' }}
|
||||
|
||||
- name: test
|
||||
if: ${{ !matrix.platform.cross }}
|
||||
run: cargo ${{ matrix.features.key == 'no-default' && 'check' || matrix.platform.command }} --target ${{ matrix.platform.target }} ${{ matrix.features.args }} --manifest-path crates/tauri/Cargo.toml
|
||||
|
||||
- name: test (using cross)
|
||||
if: ${{ matrix.platform.cross }}
|
||||
run: |
|
||||
cargo install cross --git https://github.com/cross-rs/cross --rev 51f46f296253d8122c927c5bb933e3c4f27cc317 --locked
|
||||
cross ${{ matrix.features.key == 'no-default' && 'check' || matrix.platform.command }} --target ${{ matrix.platform.target }} ${{ matrix.features.args }} --manifest-path crates/tauri/Cargo.toml
|
||||
run: cargo test --target ${{ matrix.platform.target }} ${{ matrix.features.args }}
|
||||
|
||||
93
.github/workflows/test-lint-bundler.yml
vendored
Normal file
93
.github/workflows/test-lint-bundler.yml
vendored
Normal file
@@ -0,0 +1,93 @@
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
name: test and lint bundler
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- dev
|
||||
- 1.x
|
||||
pull_request:
|
||||
paths:
|
||||
- '.github/workflows/test-bundler.yml'
|
||||
- 'tooling/bundler/**'
|
||||
|
||||
env:
|
||||
RUST_BACKTRACE: 1
|
||||
CARGO_PROFILE_DEV_DEBUG: 0 # This would add unnecessary bloat to the target folder, decreasing cache efficiency.
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ${{ matrix.platform }}
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
platform: [ubuntu-latest, macos-latest, windows-latest]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: install stable
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
workspaces: tooling/bundler
|
||||
|
||||
- name: test
|
||||
run: |
|
||||
cd ./tooling/bundler
|
||||
cargo test
|
||||
|
||||
fmt:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: minimal
|
||||
toolchain: stable
|
||||
override: true
|
||||
components: rustfmt
|
||||
|
||||
- uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: fmt
|
||||
args: --manifest-path ./tooling/bundler/Cargo.toml --all -- --check
|
||||
|
||||
clippy:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: install minimal stable with clippy and rustfmt
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: minimal
|
||||
toolchain: stable
|
||||
override: true
|
||||
default: true
|
||||
components: rustfmt, clippy
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
workspaces: tooling/bundler
|
||||
|
||||
- name: clippy check
|
||||
uses: actions-rs/clippy-check@v1
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
args: --manifest-path ./tooling/bundler/Cargo.toml --all-targets -- -D warnings
|
||||
name: bundler
|
||||
107
.github/workflows/test-updater-artifacts.yml
vendored
Normal file
107
.github/workflows/test-updater-artifacts.yml
vendored
Normal file
@@ -0,0 +1,107 @@
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
name: test updater artifacts
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 0 * * *'
|
||||
pull_request:
|
||||
paths:
|
||||
- '.github/workflows/test-updater-artifacts.yml'
|
||||
- 'examples/updater/**'
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
RUST_BACKTRACE: 1
|
||||
CARGO_PROFILE_DEV_DEBUG: 0 # This would add unnecessary bloat to the target folder, decreasing cache efficiency.
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ${{ matrix.platform }}
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
platform: [ubuntu-latest, macos-latest, windows-latest]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: install stable
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
|
||||
- name: install Linux dependencies
|
||||
if: matrix.platform == 'ubuntu-latest'
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y webkit2gtk-4.0 libayatana-appindicator3-dev
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
workspaces: |
|
||||
core -> ../target
|
||||
tooling/cli
|
||||
|
||||
- name: build and install `tauri-cli`
|
||||
run: cargo install --path tooling/cli --force
|
||||
- name: Check whether code signing should be enabled
|
||||
id: enablecodesigning
|
||||
env:
|
||||
ENABLE_CODE_SIGNING: ${{ secrets.APPLE_CERTIFICATE }}
|
||||
run: |
|
||||
echo "Enable code signing: ${{ env.ENABLE_CODE_SIGNING != '' }}"
|
||||
echo "::set-output name=enabled::${{ env.ENABLE_CODE_SIGNING != '' }}"
|
||||
|
||||
# run only on tauri-apps/tauri repo (require secrets)
|
||||
- name: build sample artifacts + code signing (updater)
|
||||
if: steps.enablecodesigning.outputs.enabled == 'true'
|
||||
working-directory: ./examples/updater
|
||||
run: |
|
||||
yarn install
|
||||
cargo tauri build --verbose
|
||||
env:
|
||||
# Notarization (disabled)
|
||||
# FIXME: enable only on `dev` push maybe? as it take some times...
|
||||
#
|
||||
# APPLE_ID: ${{ secrets.APPLE_ID }}
|
||||
# APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
|
||||
|
||||
# Apple code signing testing
|
||||
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
|
||||
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
|
||||
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
|
||||
# Updater signature is exposed here to make sure it works in PR's
|
||||
TAURI_PRIVATE_KEY: dW50cnVzdGVkIGNvbW1lbnQ6IHJzaWduIGVuY3J5cHRlZCBzZWNyZXQga2V5ClJXUlRZMEl5YTBGV3JiTy9lRDZVd3NkL0RoQ1htZmExNDd3RmJaNmRMT1ZGVjczWTBKZ0FBQkFBQUFBQUFBQUFBQUlBQUFBQWdMekUzVkE4K0tWQ1hjeGt1Vkx2QnRUR3pzQjVuV0ZpM2czWXNkRm9hVUxrVnB6TUN3K1NheHJMREhQbUVWVFZRK3NIL1VsMDBHNW5ET1EzQno0UStSb21nRW4vZlpTaXIwZFh5ZmRlL1lSN0dKcHdyOUVPclVvdzFhVkxDVnZrbHM2T1o4Tk1NWEU9Cg==
|
||||
TAURI_KEY_PASSWORD:
|
||||
# run on PRs and forks
|
||||
- name: build sample artifacts (updater)
|
||||
if: steps.enablecodesigning.outputs.enabled != 'true'
|
||||
working-directory: ./examples/updater
|
||||
run: |
|
||||
yarn install
|
||||
cargo tauri build --verbose
|
||||
env:
|
||||
TAURI_PRIVATE_KEY: dW50cnVzdGVkIGNvbW1lbnQ6IHJzaWduIGVuY3J5cHRlZCBzZWNyZXQga2V5ClJXUlRZMEl5YTBGV3JiTy9lRDZVd3NkL0RoQ1htZmExNDd3RmJaNmRMT1ZGVjczWTBKZ0FBQkFBQUFBQUFBQUFBQUlBQUFBQWdMekUzVkE4K0tWQ1hjeGt1Vkx2QnRUR3pzQjVuV0ZpM2czWXNkRm9hVUxrVnB6TUN3K1NheHJMREhQbUVWVFZRK3NIL1VsMDBHNW5ET1EzQno0UStSb21nRW4vZlpTaXIwZFh5ZmRlL1lSN0dKcHdyOUVPclVvdzFhVkxDVnZrbHM2T1o4Tk1NWEU9Cg==
|
||||
TAURI_KEY_PASSWORD:
|
||||
# upload assets
|
||||
- uses: actions/upload-artifact@v2
|
||||
if: matrix.platform == 'ubuntu-latest'
|
||||
with:
|
||||
name: linux-updater-artifacts
|
||||
path: ./examples/updater/src-tauri/target/release/bundle/appimage/updater-example_*.AppImage.*
|
||||
- uses: actions/upload-artifact@v2
|
||||
if: matrix.platform == 'windows-latest'
|
||||
with:
|
||||
name: windows-updater-artifacts
|
||||
path: ./examples/updater/src-tauri/target/release/bundle/msi/*
|
||||
- uses: actions/upload-artifact@v2
|
||||
if: matrix.platform == 'macos-latest'
|
||||
with:
|
||||
name: macos-updater-artifacts
|
||||
path: ./examples/updater/src-tauri/target/release/bundle/macos/updater-example.app.tar.*
|
||||
95
.github/workflows/udeps.yml
vendored
95
.github/workflows/udeps.yml
vendored
@@ -1,4 +1,4 @@
|
||||
# Copyright 2019-2024 Tauri Programme within The Commons Conservancy
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
@@ -8,6 +8,7 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- dev
|
||||
- 1.x
|
||||
|
||||
env:
|
||||
RUST_BACKTRACE: 1
|
||||
@@ -31,32 +32,30 @@ jobs:
|
||||
bundler: ${{ steps.filter.outputs.bundler }}
|
||||
cli: ${{ steps.filter.outputs.cli }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: dorny/paths-filter@v3
|
||||
- uses: actions/checkout@v2
|
||||
- uses: dorny/paths-filter@v2
|
||||
id: filter
|
||||
with:
|
||||
filters: |
|
||||
tauri:
|
||||
- 'crates/tauri/**'
|
||||
- '!crates/tauri/scripts/**'
|
||||
- 'core/tauri/**'
|
||||
- '!core/tauri/scripts/**'
|
||||
build:
|
||||
- 'crates/tauri-build/**'
|
||||
- 'core/tauri-build/**'
|
||||
codegen:
|
||||
- 'crates/tauri-codegen/**'
|
||||
- 'core/tauri-codegen/**'
|
||||
macros:
|
||||
- 'crates/tauri-macros/**'
|
||||
- 'core/tauri-macros/**'
|
||||
runtime:
|
||||
- 'crates/tauri-runtime/**'
|
||||
- 'core/tauri-runtime/**'
|
||||
wry:
|
||||
- 'crates/tauri-runtime-wry/**'
|
||||
- 'core/tauri-runtime-wry/**'
|
||||
utils:
|
||||
- 'crates/tauri-utils/**'
|
||||
- 'core/tauri-utils/**'
|
||||
bundler:
|
||||
- 'crates/tauri-bundler/**'
|
||||
- 'tooling/bundler/**'
|
||||
cli:
|
||||
- 'crates/tauri-cli/**'
|
||||
macossign:
|
||||
- 'crates/tauri-macos-sign/**'
|
||||
- 'tooling/cli/**'
|
||||
|
||||
setup:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -70,20 +69,24 @@ jobs:
|
||||
needs.changes.outputs.wry == 'true' ||
|
||||
needs.changes.outputs.utils == 'true' ||
|
||||
needs.changes.outputs.bundler == 'true' ||
|
||||
needs.changes.outputs.cli == 'true' ||
|
||||
needs.changes.outputs.macossign == 'true'
|
||||
needs.changes.outputs.cli == 'true'
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Install Rust nightly
|
||||
uses: dtolnay/rust-toolchain@nightly
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: minimal
|
||||
toolchain: nightly
|
||||
override: true
|
||||
|
||||
- name: Install udeps
|
||||
run: cargo install cargo-udeps --locked --force
|
||||
- uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: install
|
||||
args: cargo-udeps --locked --force
|
||||
|
||||
- name: Upload udeps
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: udeps
|
||||
path: '~/.cargo/bin/cargo-udeps'
|
||||
@@ -101,20 +104,18 @@ jobs:
|
||||
UTILS: ${{ needs.changes.outputs.utils == 'true' }}
|
||||
BUNDLER: ${{ needs.changes.outputs.bundler == 'true' }}
|
||||
CLI: ${{ needs.changes.outputs.cli == 'true' }}
|
||||
MACOSSIGN: ${{ needs.changes.outputs.macossign == 'true' }}
|
||||
run: |
|
||||
crates=()
|
||||
if [ "${TAURI}" == "true" ]; then crates[${#crates[@]}]="\"./crates/tauri\""; fi
|
||||
if [ "${BUILD}" == "true" ]; then crates[${#crates[@]}]="\"./crates/tauri-build\""; fi
|
||||
if [ "${CODEGEN}" == "true" ]; then crates[${#crates[@]}]="\"./crates/tauri-codegen\""; fi
|
||||
if [ "${MACROS}" == "true" ]; then crates[${#crates[@]}]="\"./crates/tauri-macros\""; fi
|
||||
if [ "${RUNTIME}" == "true" ]; then crates[${#crates[@]}]="\"./crates/tauri-runtime\""; fi
|
||||
if [ "${WRY}" == "true" ]; then crates[${#crates[@]}]="\"./crates/tauri-runtime-wry\""; fi
|
||||
if [ "${UTILS}" == "true" ]; then crates[${#crates[@]}]="\"./crates/tauri-utils\""; fi
|
||||
if [ "${BUNDLER}" == "true" ]; then crates[${#crates[@]}]="\"./crates/tauri-bundler\""; fi
|
||||
if [ "${CLI}" == "true" ]; then crates[${#crates[@]}]="\"./crates/tauri-cli\""; fi
|
||||
if [ "${MACOSSIGN}" == "true" ]; then crates[${#crates[@]}]="\"./crates/tauri-macos-sign\""; fi
|
||||
echo "matrix=[$crates]" >> "$GITHUB_OUTPUT"
|
||||
if [ "${TAURI}" == "true" ]; then crates[${#crates[@]}]="\"./core/tauri\""; fi
|
||||
if [ "${BUILD}" == "true" ]; then crates[${#crates[@]}]="\"./core/tauri-build\""; fi
|
||||
if [ "${CODEGEN}" == "true" ]; then crates[${#crates[@]}]="\"./core/tauri-codegen\""; fi
|
||||
if [ "${MACROS}" == "true" ]; then crates[${#crates[@]}]="\"./core/tauri-macros\""; fi
|
||||
if [ "${RUNTIME}" == "true" ]; then crates[${#crates[@]}]="\"./core/tauri-runtime\""; fi
|
||||
if [ "${WRY}" == "true" ]; then crates[${#crates[@]}]="\"./core/tauri-runtime-wry\""; fi
|
||||
if [ "${UTILS}" == "true" ]; then crates[${#crates[@]}]="\"./core/tauri-utils\""; fi
|
||||
if [ "${BUNDLER}" == "true" ]; then crates[${#crates[@]}]="\"./tooling/bundler\""; fi
|
||||
if [ "${CLI}" == "true" ]; then crates[${#crates[@]}]="\"./tooling/cli\""; fi
|
||||
echo ::set-output name=matrix::[$crates]
|
||||
outputs:
|
||||
matrix: ${{ steps.create-matrix.outputs.matrix }}
|
||||
|
||||
@@ -125,10 +126,13 @@ jobs:
|
||||
matrix:
|
||||
path: ${{ fromJson(needs.setup.outputs.matrix) }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Install Rust nightly
|
||||
uses: dtolnay/rust-toolchain@nightly
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: minimal
|
||||
toolchain: nightly
|
||||
override: true
|
||||
|
||||
- name: install dependencies
|
||||
run: |
|
||||
@@ -136,9 +140,14 @@ jobs:
|
||||
sudo apt-get install -y libgtk-3-dev
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
workspaces: |
|
||||
core -> ../target
|
||||
tooling/cli
|
||||
tooling/bundler
|
||||
|
||||
- name: Download udeps
|
||||
uses: actions/download-artifact@v4.1.7
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: udeps
|
||||
path: '~/.cargo/bin'
|
||||
@@ -148,7 +157,9 @@ jobs:
|
||||
- name: Install required packages
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y webkit2gtk-4.1 libayatana-appindicator3-dev
|
||||
sudo apt-get install -y webkit2gtk-4.0 libayatana-appindicator3-dev
|
||||
|
||||
- name: Run udeps
|
||||
run: cargo udeps --manifest-path ${{ matrix.path }}/Cargo.toml --all-targets --all-features
|
||||
- uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: udeps
|
||||
args: --manifest-path ${{ matrix.path }}/Cargo.toml --all-targets --all-features
|
||||
|
||||
144
.gitignore
vendored
144
.gitignore
vendored
@@ -1,55 +1,89 @@
|
||||
# dependency directories
|
||||
node_modules/
|
||||
|
||||
# Optional npm and yarn cache directory
|
||||
.npm/
|
||||
.yarn/
|
||||
|
||||
# Output of 'npm pack'
|
||||
*.tgz
|
||||
|
||||
# dotenv environment variables file
|
||||
.env
|
||||
|
||||
# .vscode workspace settings file
|
||||
.vscode/settings.json
|
||||
.vscode/launch.json
|
||||
.vscode/tasks.json
|
||||
|
||||
# npm, yarn and bun lock files
|
||||
package-lock.json
|
||||
yarn.lock
|
||||
bun.lockb
|
||||
|
||||
# rust compiled folders
|
||||
target/
|
||||
|
||||
# test video for streaming example
|
||||
streaming_example_test_video.mp4
|
||||
|
||||
# examples /gen directory
|
||||
/examples/**/src-tauri/gen/
|
||||
/bench/**/src-tauri/gen/
|
||||
|
||||
# logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
|
||||
# runtime data
|
||||
pids
|
||||
*.pid
|
||||
*.seed
|
||||
*.pid.lock
|
||||
|
||||
# miscellaneous
|
||||
/.vs
|
||||
.DS_Store
|
||||
.Thumbs.db
|
||||
*.sublime*
|
||||
.idea
|
||||
debug.log
|
||||
TODO.md
|
||||
.aider*
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
|
||||
# smoke-tests repo
|
||||
/smoke-tests
|
||||
|
||||
# Runtime data
|
||||
pids
|
||||
*.pid
|
||||
*.seed
|
||||
*.pid.lock
|
||||
|
||||
# Directory for instrumented libs generated by jscoverage/JSCover
|
||||
lib-cov
|
||||
|
||||
# Coverage directory used by tools like istanbul
|
||||
coverage
|
||||
|
||||
# nyc test coverage
|
||||
.nyc_output
|
||||
|
||||
# node-waf configuration
|
||||
.lock-wscript
|
||||
|
||||
# Compiled binary addons (http://nodejs.org/api/addons.html)
|
||||
build/Release
|
||||
|
||||
# Dependency directories
|
||||
node_modules/
|
||||
jspm_packages/
|
||||
|
||||
# Typescript v1 declaration files
|
||||
typings/
|
||||
|
||||
# Optional npm cache directory
|
||||
.npm
|
||||
|
||||
# Optional yarn cache directory
|
||||
.yarn
|
||||
|
||||
# Optional eslint cache
|
||||
.eslintcache
|
||||
|
||||
# Optional REPL history
|
||||
.node_repl_history
|
||||
|
||||
# Output of 'npm pack'
|
||||
*.tgz
|
||||
|
||||
# Yarn Integrity file
|
||||
.yarn-integrity
|
||||
|
||||
# dotenv environment variables file
|
||||
.env
|
||||
|
||||
/.vs
|
||||
.DS_Store
|
||||
.Thumbs.db
|
||||
*.sublime*
|
||||
.idea
|
||||
debug.log
|
||||
package-lock.json
|
||||
.vscode/settings.json
|
||||
*/.vscode/
|
||||
proptest-regressions/
|
||||
TODO.md
|
||||
|
||||
# rust compiled folders
|
||||
target
|
||||
|
||||
# lock for libs
|
||||
#/Cargo.lock Committed to prevent msrv checks from failing
|
||||
/tooling/bench/tests/Cargo.lock
|
||||
/yarn.lock
|
||||
|
||||
# ignore frida handlers
|
||||
__handlers__/
|
||||
|
||||
# benches
|
||||
gh-pages
|
||||
test_video.mp4
|
||||
|
||||
# old cli directories
|
||||
/tooling/cli.js
|
||||
/tooling/cli.rs
|
||||
|
||||
1
.husky/.gitignore
vendored
Normal file
1
.husky/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
_
|
||||
24
.husky/pre-commit
Executable file
24
.husky/pre-commit
Executable file
@@ -0,0 +1,24 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
. "$(dirname "$0")/_/husky.sh"
|
||||
|
||||
if [ -z "$(git diff --name-only tooling/api)" ]; then
|
||||
echo "skipping api - no changes detected"
|
||||
else
|
||||
cd tooling/api
|
||||
yarn format
|
||||
yarn lint:fix
|
||||
cd ../..
|
||||
fi
|
||||
|
||||
if [ -z "$(git diff --name-only tooling/cli/node)" ]; then
|
||||
echo "skipping \`@tauri-apps/cli\` - no changes detected"
|
||||
else
|
||||
cd tooling/cli/node
|
||||
yarn format
|
||||
cd ../../..
|
||||
fi
|
||||
@@ -1,40 +1,12 @@
|
||||
/audits
|
||||
/.github
|
||||
/.husky
|
||||
/.vscode
|
||||
|
||||
# change files are hand-written and shouldn't be formatted
|
||||
/.changes/*
|
||||
!/.changes/config.json
|
||||
|
||||
# dependcies and artifacts directories
|
||||
node_modules/
|
||||
target/
|
||||
dist/
|
||||
|
||||
# lock files
|
||||
pnpm-lock.yaml
|
||||
|
||||
# autogenerated and minimized js file
|
||||
crates/tauri/scripts/bundle.global.js
|
||||
|
||||
# this file is an IIFE, shouldn't be formatted
|
||||
crates/tauri/scripts/process-ipc-message-fn.js
|
||||
|
||||
# cli templates should be formatted manually
|
||||
# it also includes invalid json files that
|
||||
# prettier can't handle
|
||||
crates/tauri-cli/templates
|
||||
|
||||
# autogenerated files
|
||||
**/autogenerated/**/*.md
|
||||
packages/cli/index.js
|
||||
packages/cli/index.d.ts
|
||||
crates/tauri-schema-worker/.wrangler
|
||||
CHANGELOG.md
|
||||
*schema.json
|
||||
|
||||
# WiX templates
|
||||
*.wxs
|
||||
|
||||
# examples /gen directory
|
||||
examples/**/src-tauri/gen
|
||||
bench/**/src-tauri/gen
|
||||
/audits
|
||||
node_modules
|
||||
target
|
||||
dist
|
||||
/core/tauri/scripts
|
||||
/tooling/cli/templates
|
||||
/tooling/cli/node
|
||||
/tooling/cli/schema.json
|
||||
/core/tauri-config-schema/schema.json
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
{
|
||||
"singleQuote": true,
|
||||
"semi": false,
|
||||
"trailingComma": "none",
|
||||
"experimentalOperatorPosition": "start"
|
||||
"trailingComma": "none"
|
||||
}
|
||||
|
||||
55
.scripts/cargo-check.ps1
Executable file
55
.scripts/cargo-check.ps1
Executable file
@@ -0,0 +1,55 @@
|
||||
#!/usr/bin/env pwsh
|
||||
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
# note: you can pass in the cargo sub-commands used to check manually.
|
||||
# allowed commands: check, clippy, fmt, test
|
||||
# default: clippy, fmt, test
|
||||
|
||||
# set the script arguments if none are found
|
||||
if(-Not $args) {
|
||||
$args=@("clippy","fmt","test")
|
||||
}
|
||||
|
||||
# exit the script early if the last command returned an error
|
||||
function check_error {
|
||||
if($LASTEXITCODE -ne 0 ) {
|
||||
Exit $LASTEXITCODE
|
||||
}
|
||||
}
|
||||
|
||||
function run {
|
||||
$command, $_args = $args
|
||||
|
||||
Write-Output "[$command]"
|
||||
cargo $command --workspace --all-targets --all-features $_args
|
||||
check_error
|
||||
}
|
||||
|
||||
foreach ($command in $args) {
|
||||
Switch ($command) {
|
||||
"check" {
|
||||
run check
|
||||
break
|
||||
}
|
||||
"test" {
|
||||
run test
|
||||
break
|
||||
}
|
||||
"clippy" {
|
||||
run clippy "--" -D warnings
|
||||
break
|
||||
}
|
||||
"fmt" {
|
||||
Write-Output "[$command] checking formatting"
|
||||
cargo +nightly fmt "--" --check
|
||||
check_error
|
||||
}
|
||||
default {
|
||||
Write-Output "[cargo-check.ps1] Unknown cargo sub-command: $command"
|
||||
Exit 1
|
||||
}
|
||||
}
|
||||
}
|
||||
45
.scripts/cargo-check.sh
Executable file
45
.scripts/cargo-check.sh
Executable file
@@ -0,0 +1,45 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
# note: you can pass in the cargo sub-commands used to check manually.
|
||||
# allowed commands: check, clippy, fmt, test
|
||||
# default: clippy, fmt, test
|
||||
|
||||
# exit the script early if any of the commands return an error
|
||||
set -e
|
||||
|
||||
# set the script arguments if none are found
|
||||
if [ -z "$*" ]; then
|
||||
set -- "clippy" "fmt" "test"
|
||||
fi
|
||||
|
||||
# run n+1 times, where n is the amount of mutually exclusive features.
|
||||
# the extra run is for all the crates without mutually exclusive features.
|
||||
# as many features as possible are enabled at for each command
|
||||
run() {
|
||||
command=$1
|
||||
shift 1
|
||||
cargo "$command" --workspace --all-targets --all-features "$@"
|
||||
}
|
||||
|
||||
for command in "$@"; do
|
||||
case "$command" in
|
||||
check | test)
|
||||
run "$command"
|
||||
;;
|
||||
clippy)
|
||||
run clippy -- -D warnings
|
||||
;;
|
||||
fmt)
|
||||
echo "[$command] checking formatting"
|
||||
cargo +nightly fmt -- --check
|
||||
;;
|
||||
*)
|
||||
echo "[cargo-check.sh] Unknown cargo sub-command: $command"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy
|
||||
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
@@ -57,7 +57,7 @@ function checkChangeFiles(changeFiles) {
|
||||
for (const [file, packages] of unknownTagsEntries) {
|
||||
for (const { package, tag } of packages) {
|
||||
console.error(
|
||||
`Package \`${package}\` has an unknown change tag ${tag} in ${file} `
|
||||
`Package \`${package}\` has an uknown change tag ${tag} in ${file} `
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -69,9 +69,7 @@ function checkChangeFiles(changeFiles) {
|
||||
const [_bin, _script, ...files] = process.argv
|
||||
|
||||
if (files.length > 0) {
|
||||
checkChangeFiles(
|
||||
files.filter((f) => f.toLowerCase() !== '.changes/readme.md')
|
||||
)
|
||||
checkChangeFiles(files.filter((f) => f.toLowerCase() !== 'readme.md'))
|
||||
} else {
|
||||
const changeFiles = fs
|
||||
.readdirSync('.changes')
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy
|
||||
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
@@ -8,29 +8,25 @@ const fs = require('fs')
|
||||
const path = require('path')
|
||||
const readline = require('readline')
|
||||
|
||||
const header = `Copyright 2019-2024 Tauri Programme within The Commons Conservancy
|
||||
const header = `Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
SPDX-License-Identifier: Apache-2.0
|
||||
SPDX-License-Identifier: MIT`
|
||||
const bundlerLicense =
|
||||
'// Copyright 2016-2019 Cargo-Bundle developers <https://github.com/burtonageo/cargo-bundle>'
|
||||
const denoLicense =
|
||||
'// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.'
|
||||
|
||||
const extensions = ['.rs', '.js', '.ts', '.yml', '.swift', '.kt']
|
||||
const extensions = ['.rs', '.js', '.ts', '.yml']
|
||||
const ignore = [
|
||||
'target',
|
||||
'templates',
|
||||
'node_modules',
|
||||
'gen',
|
||||
'dist',
|
||||
'bundle.js',
|
||||
'bundle.global.js'
|
||||
]
|
||||
|
||||
async function checkFile(file) {
|
||||
if (
|
||||
extensions.some((e) => file.endsWith(e))
|
||||
&& !ignore.some((i) => file.includes(`/${i}/`) || path.basename(file) === i)
|
||||
) {
|
||||
if (extensions.some((e) => file.endsWith(e))) {
|
||||
const fileStream = fs.createReadStream(file)
|
||||
const rl = readline.createInterface({
|
||||
input: fileStream,
|
||||
@@ -42,11 +38,9 @@ async function checkFile(file) {
|
||||
for await (let line of rl) {
|
||||
// ignore empty lines, allow shebang and bundler license
|
||||
if (
|
||||
line.length === 0
|
||||
|| line.startsWith('#!')
|
||||
|| line.startsWith('// swift-tools-version:')
|
||||
|| line === bundlerLicense
|
||||
|| line === denoLicense
|
||||
line.length === 0 ||
|
||||
line.startsWith('#!') ||
|
||||
line === bundlerLicense
|
||||
) {
|
||||
continue
|
||||
}
|
||||
|
||||
@@ -1,15 +1,13 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Copyright 2019-2024 Tauri Programme within The Commons Conservancy
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
git_output=$(git diff --ignore-submodules --name-only HEAD)
|
||||
if [ -z "$git_output" ];
|
||||
if git diff --quiet --ignore-submodules HEAD
|
||||
then
|
||||
echo "✔ working directory is clean"
|
||||
echo "working directory is clean"
|
||||
else
|
||||
echo "✘ found diff:"
|
||||
echo "$git_output"
|
||||
echo "found diff"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Copyright 2019-2024 Tauri Programme within The Commons Conservancy
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
@@ -10,7 +10,7 @@ for o in outputs/*; do
|
||||
pushd "$o"
|
||||
|
||||
chmod +x cargo-tauri*
|
||||
cp ../../crates/tauri-cli/LICENSE* ../../crates/tauri-cli/README.md .
|
||||
cp ../../tooling/cli/LICENSE* ../../tooling/cli/README.md .
|
||||
|
||||
target=$(basename "$o" | cut -d. -f1)
|
||||
if grep -qE '(apple|windows)' <<< "$target"; then
|
||||
|
||||
57
.scripts/covector/package-latest-version.js
Normal file
57
.scripts/covector/package-latest-version.js
Normal file
@@ -0,0 +1,57 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
/*
|
||||
This script is solely intended to be run as part of the `covector publish` step to
|
||||
check the latest version of a crate, considering the current minor version.
|
||||
*/
|
||||
|
||||
const https = require('https')
|
||||
|
||||
const kind = process.argv[2]
|
||||
const packageName = process.argv[3]
|
||||
const packageVersion = process.argv[4]
|
||||
const target = packageVersion.substring(0, packageVersion.lastIndexOf('.'))
|
||||
|
||||
let url = null
|
||||
switch (kind) {
|
||||
case 'cargo':
|
||||
url = `https://crates.io/api/v1/crates/${packageName}`
|
||||
break
|
||||
case 'npm':
|
||||
url = `https://registry.npmjs.org/${packageName}`
|
||||
break
|
||||
default:
|
||||
throw new Error('unexpected kind ' + kind)
|
||||
}
|
||||
|
||||
const options = {
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
Accept: 'application/json',
|
||||
'User-Agent': 'tauri (https://github.com/tauri-apps/tauri)'
|
||||
}
|
||||
}
|
||||
|
||||
https.get(url, options, (response) => {
|
||||
let chunks = []
|
||||
response.on('data', function (chunk) {
|
||||
chunks.push(chunk)
|
||||
})
|
||||
|
||||
response.on('end', function () {
|
||||
const data = JSON.parse(chunks.join(''))
|
||||
if (kind === 'cargo') {
|
||||
const versions = data.versions.filter((v) => v.num.startsWith(target))
|
||||
console.log(versions.length ? versions[0].num : '0.0.0')
|
||||
} else if (kind === 'npm') {
|
||||
const versions = Object.keys(data.versions).filter((v) =>
|
||||
v.startsWith(target)
|
||||
)
|
||||
console.log(versions[versions.length - 1] || '0.0.0')
|
||||
}
|
||||
})
|
||||
})
|
||||
@@ -1,27 +1,28 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy
|
||||
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
/*
|
||||
This script is solely intended to be run as part of the `covector version` step to
|
||||
keep the `../../crates/tauri-cli/metadata-v2.json` up to date with other version bumps. Long term
|
||||
keep the `../tooling/cli/metadata.json` up to date with other version bumps. Long term
|
||||
we should look to find a more "rusty way" to import / "pin" a version value in our tauri-cli
|
||||
rust binaries.
|
||||
*/
|
||||
|
||||
const { readFileSync, writeFileSync } = require('fs')
|
||||
const { resolve } = require('path')
|
||||
|
||||
const packageNickname = process.argv[2]
|
||||
const filePath = resolve(__dirname, '../../crates/tauri-cli/metadata-v2.json')
|
||||
const filePath =
|
||||
packageNickname === '@tauri-apps/cli'
|
||||
? `../../../tooling/cli/metadata.json`
|
||||
: `../../tooling/cli/metadata.json`
|
||||
const bump = process.argv[3]
|
||||
let index = null
|
||||
|
||||
switch (bump) {
|
||||
case 'major':
|
||||
case 'premajor':
|
||||
index = 0
|
||||
break
|
||||
case 'minor':
|
||||
@@ -30,10 +31,6 @@ switch (bump) {
|
||||
case 'patch':
|
||||
index = 2
|
||||
break
|
||||
case 'prerelease':
|
||||
case 'prepatch':
|
||||
index = 3
|
||||
break
|
||||
default:
|
||||
throw new Error('unexpected bump ' + bump)
|
||||
}
|
||||
@@ -47,12 +44,6 @@ const inc = (version) => {
|
||||
v[i] = 0
|
||||
}
|
||||
}
|
||||
if (bump === 'premajor') {
|
||||
const pre = JSON.parse(
|
||||
readFileSync(resolve(__dirname, '../../.changes/pre.json'), 'utf-8')
|
||||
)
|
||||
return `${v.join('.')}-${pre.tag}.0`
|
||||
}
|
||||
return v.join('.')
|
||||
}
|
||||
|
||||
@@ -70,5 +61,5 @@ if (packageNickname === '@tauri-apps/cli') {
|
||||
}
|
||||
|
||||
writeFileSync(filePath, JSON.stringify(metadata, null, 2) + '\n')
|
||||
console.log(`wrote ${version} for ${packageNickname} into metadata-v2.json`)
|
||||
console.log(`wrote ${version} for ${packageNickname} into metadata.json`)
|
||||
console.dir(metadata)
|
||||
7
.scripts/docker/build.sh
Executable file
7
.scripts/docker/build.sh
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
docker build -t aarch64-unknown-linux-gnu:latest --file .docker/cross/aarch64.Dockerfile .docker/cross
|
||||
30
.scripts/setup.ps1
Normal file
30
.scripts/setup.ps1
Normal file
@@ -0,0 +1,30 @@
|
||||
#!/usr/bin/env pwsh
|
||||
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
echo "Building API definitions..."
|
||||
cd tooling\api
|
||||
yarn; yarn build
|
||||
cd ..\..
|
||||
|
||||
echo "Installing the Tauri Rust CLI..."
|
||||
cd tooling\cli
|
||||
cargo install --path .
|
||||
cd ..\..
|
||||
echo "Tauri Rust CLI installed. Run it with '$ cargo tauri [COMMAND]'."
|
||||
|
||||
$yes = New-Object System.Management.Automation.Host.ChoiceDescription "&Yes"
|
||||
$no = New-Object System.Management.Automation.Host.ChoiceDescription "&No"
|
||||
$options = [System.Management.Automation.Host.ChoiceDescription[]]($yes, $no)
|
||||
|
||||
$result = $host.ui.PromptForChoice("Node.js CLI", "Do you want to install the Node.js CLI?", $options, 1)
|
||||
switch ($result) {
|
||||
0{
|
||||
cd tooling\cli\node
|
||||
yarn; yarn build; yarn link
|
||||
cd ..\..
|
||||
echo "Tauri Node.js CLI installed. use `yarn link @tauri-apps/cli` and run it with '$ yarn tauri [COMMAND]'."
|
||||
}
|
||||
}
|
||||
29
.scripts/setup.sh
Executable file
29
.scripts/setup.sh
Executable file
@@ -0,0 +1,29 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
echo "Building API definitions..."
|
||||
cd tooling/api
|
||||
yarn && yarn build
|
||||
cd ../..
|
||||
|
||||
echo "Building the Tauri Rust CLI..."
|
||||
cd tooling/cli
|
||||
cargo install --path .
|
||||
cd ../..
|
||||
echo "Tauri Rust CLI installed. Run it with '$ cargo tauri [COMMAND]'."
|
||||
|
||||
echo "Do you want to install the Node.js CLI?"
|
||||
select yn in "Yes" "No"; do
|
||||
case $yn in
|
||||
Yes )
|
||||
cd tooling/cli/node
|
||||
yarn && yarn build && yarn link
|
||||
cd ../../..
|
||||
echo "Tauri Node.js CLI installed. use `yarn link @tauri-apps/cli` and run it with '$ yarn tauri [COMMAND]'."
|
||||
break;;
|
||||
No ) break;;
|
||||
esac
|
||||
done
|
||||
24
.scripts/update-lockfiles.sh
Executable file
24
.scripts/update-lockfiles.sh
Executable file
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
# Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
declare -a examples=("api" "sidecar" "updater" "resources" "tauri-dynamic-lib" "workspace")
|
||||
declare -a tooling=("bench" "cli" "webdriver")
|
||||
|
||||
for example in "${examples[@]}"
|
||||
do
|
||||
cd examples/$example/src-tauri
|
||||
cargo update
|
||||
cargo build
|
||||
cd ../../..
|
||||
done
|
||||
|
||||
for tooling in "${tooling[@]}"
|
||||
do
|
||||
cd tooling/$tooling
|
||||
cargo update
|
||||
cargo build
|
||||
cd ../..
|
||||
done
|
||||
66
.scripts/utils/batch_to_exe.cmd
Normal file
66
.scripts/utils/batch_to_exe.cmd
Normal file
@@ -0,0 +1,66 @@
|
||||
: Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
: SPDX-License-Identifier: Apache-2.0
|
||||
: SPDX-License-Identifier: MIT
|
||||
|
||||
@ECHO OFF
|
||||
|
||||
REM Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
||||
REM SPDX-License-Identifier: Apache-2.0
|
||||
REM SPDX-License-Identifier: MIT
|
||||
|
||||
ECHO Make EXE From BAT
|
||||
ECHO.
|
||||
ECHO.
|
||||
|
||||
REM Usage:
|
||||
REM MakeExeFromBat BatFileToConvert [IncludeFile1] [IncludeFile2] [...]
|
||||
REM
|
||||
REM Required Parameters:
|
||||
REM BatFileToConvert
|
||||
REM Source batch file to use to produce the output Exe file.
|
||||
REM
|
||||
REM Optional Parameters:
|
||||
REM IncludeFile
|
||||
REM Additional files to include in the Exe file.
|
||||
REM You can include external tools used by the batch file so they are available on the executing machine.
|
||||
|
||||
SETLOCAL
|
||||
|
||||
REM Configuration (no quotes needed):
|
||||
SET PathTo7Zip=
|
||||
|
||||
|
||||
REM ---- Do not modify anything below this line ----
|
||||
|
||||
SET OutputFile="%~n1.exe"
|
||||
SET SourceFiles="%TEMP%MakeEXE_files.txt"
|
||||
SET Config="%TEMP%MakeEXE_config.txt"
|
||||
SET Source7ZFile="%Temp%MakeEXE.7z"
|
||||
|
||||
REM Remove existing files
|
||||
IF EXIST %OutputFile% DEL %OutputFile%
|
||||
|
||||
REM Build source archive
|
||||
ECHO "%~dpnx1" > %SourceFiles%
|
||||
:AddInclude
|
||||
IF {%2}=={} GOTO EndInclude
|
||||
ECHO "%~dpnx2" >> %SourceFiles%
|
||||
SHIFT /2
|
||||
GOTO AddInclude
|
||||
:EndInclude
|
||||
"%PathTo7Zip%7za.exe" a %Source7ZFile% @%SourceFiles%
|
||||
|
||||
REM Build config file
|
||||
ECHO ;!@Install@!UTF-8! > %Config%
|
||||
ECHO RunProgram="%~nx1" >> %Config%
|
||||
ECHO ;!@InstallEnd@! >> %Config%
|
||||
|
||||
REM Build EXE
|
||||
COPY /B "%PathTo7Zip%7zsd.sfx" + %Config% + %Source7ZFile% %OutputFile%
|
||||
|
||||
REM Clean up
|
||||
IF EXIST %SourceFiles% DEL %SourceFiles%
|
||||
IF EXIST %Config% DEL %Config%
|
||||
IF EXIST %Source7ZFile% DEL %Source7ZFile%
|
||||
|
||||
ENDLOCAL
|
||||
16
.taurignore
16
.taurignore
@@ -1,16 +0,0 @@
|
||||
.changes
|
||||
.devcontainer
|
||||
.docker
|
||||
.github
|
||||
.scripts
|
||||
.vscode
|
||||
audits
|
||||
bench
|
||||
packages/api
|
||||
packages/cli
|
||||
crates/tauri-cli
|
||||
crates/tauri-bundler
|
||||
crates/tauri-driver
|
||||
crates/tauri-macos-sign
|
||||
crates/tauri-schema-generator
|
||||
crates/tests
|
||||
5
.vscode/extensions.json
vendored
5
.vscode/extensions.json
vendored
@@ -1,8 +1,7 @@
|
||||
{
|
||||
"recommendations": [
|
||||
"rust-lang.rust-analyzer",
|
||||
"ms-vscode-remote.vscode-remote-extensionpack",
|
||||
"EditorConfig.EditorConfig",
|
||||
"esbenp.prettier-vscode",
|
||||
"tamasfe.even-better-toml"
|
||||
"esbenp.prettier-vscode"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,134 +1,105 @@
|
||||
# The Tauri Architecture
|
||||
https://tauri.app
|
||||
|
||||
<https://tauri.app>
|
||||
|
||||
<https://github.com/tauri-apps/tauri>
|
||||
https://github.com/tauri-apps/tauri
|
||||
|
||||
## Introduction
|
||||
|
||||
Tauri is a polyglot and generic toolkit that is very composable and allows engineers to make a wide variety of applications. It is used for building applications for Desktop Computers using a combination of Rust tools and HTML rendered in a Webview. Apps built with Tauri can ship with any number of pieces of an optional JS API / Rust API so that webviews can control the system via message passing. In fact, developers can extend the default API with their own functionality and bridge the Webview and Rust-based backend easily.
|
||||
|
||||
Tauri apps can have custom menus and have tray-type interfaces. They can be updated, and are managed by the user's operating system as expected. They are very small, because they use the OS's webview. They do not ship a runtime, since the final binary is compiled from Rust. This makes the reversing of Tauri apps not a trivial task.
|
||||
|
||||
## What Tauri is NOT
|
||||
|
||||
- Tauri is not a lightweight kernel wrapper...instead it directly uses [WRY](#wry) and [TAO](#tao) to do the heavy-lifting in making system calls to the OS.
|
||||
- Tauri is not a VM or virtualized environment...instead it is an application toolkit that allows making Webview OS applications.
|
||||
|
||||
## Major Components
|
||||
|
||||
The following section briefly describes the roles of the various parts of Tauri.
|
||||
|
||||
### Tauri Core [STABLE RUST]
|
||||
|
||||
#### [tauri](https://github.com/tauri-apps/tauri/tree/dev/crates/tauri)
|
||||
|
||||
#### [tauri](https://github.com/tauri-apps/tauri/tree/dev/core/tauri)
|
||||
This is the major crate that holds everything together. It brings the runtimes, macros, utilities and API into one final product. It reads the `tauri.conf.json` file at compile time in order to bring in features and undertake actual configuration of the app (and even the `Cargo.toml` file in the project's folder). It handles script injection (for polyfills / prototype revision) at runtime, hosts the API for systems interaction, and even manages updating.
|
||||
|
||||
#### [tauri-build](https://github.com/tauri-apps/tauri/tree/dev/crates/tauri-build)
|
||||
|
||||
#### [tauri-build](https://github.com/tauri-apps/tauri/tree/dev/core/tauri-build)
|
||||
Apply the macros at build-time in order to rig some special features needed by `cargo`.
|
||||
|
||||
#### [tauri-codegen](https://github.com/tauri-apps/tauri/tree/dev/crates/tauri-codegen)
|
||||
|
||||
#### [tauri-codegen](https://github.com/tauri-apps/tauri/tree/dev/core/tauri-codegen)
|
||||
- Embed, hash, and compress assets, including icons for the app as well as the system-tray.
|
||||
- Parse `tauri.conf.json` at compile time and generate the Config struct.
|
||||
|
||||
#### [tauri-macros](https://github.com/tauri-apps/tauri/tree/dev/crates/tauri-macros)
|
||||
|
||||
#### [tauri-macros](https://github.com/tauri-apps/tauri/tree/dev/core/tauri-macros)
|
||||
Create macros for the context, handler, and commands by leveraging the `tauri-codegen` crate.
|
||||
|
||||
#### [tauri-runtime](https://github.com/tauri-apps/tauri/tree/dev/crates/tauri-runtime)
|
||||
|
||||
#### [tauri-runtime](https://github.com/tauri-apps/tauri/tree/dev/core/tauri-runtime)
|
||||
This is the glue layer between tauri itself and lower level webview libraries.
|
||||
|
||||
#### [tauri-runtime-wry](https://github.com/tauri-apps/tauri/tree/dev/crates/tauri-runtime-wry)
|
||||
|
||||
#### [tauri-runtime-wry](https://github.com/tauri-apps/tauri/tree/dev/core/tauri-runtime-wry)
|
||||
This crate opens up direct systems-level interactions specifically for WRY, such as printing, monitor detection, and other windowing related tasks. `tauri-runtime` implementation for WRY.
|
||||
|
||||
#### [tauri-utils](https://github.com/tauri-apps/tauri/tree/dev/crates/tauri-utils)
|
||||
|
||||
#### [tauri-utils](https://github.com/tauri-apps/tauri/tree/dev/core/tauri-utils)
|
||||
This is common code that is reused in many places and offers useful utilities like parsing configuration files, detecting platform triples, injecting the CSP, and managing assets.
|
||||
|
||||
|
||||
### Tauri Tooling
|
||||
|
||||
#### [@tauri-apps/api](https://github.com/tauri-apps/tauri/tree/dev/packages/api) [TS -> JS]
|
||||
|
||||
#### [@tauri-apps/api](https://github.com/tauri-apps/tauri/tree/dev/tooling/api) [TS -> JS]
|
||||
A TypeScript library that creates `cjs` and `esm` JavaScript endpoints for you to import into your Frontend framework so that the Webview can call and listen to backend activity. We also ship the pure TypeScript, because for some frameworks this is more optimal. It uses the message passing of webviews to their hosts.
|
||||
|
||||
#### [bundler](https://github.com/tauri-apps/tauri/tree/dev/crates/tauri-bundler) [RUST / SHELL]
|
||||
|
||||
#### [bundler](https://github.com/tauri-apps/tauri/tree/dev/tooling/bundler) [RUST / SHELL]
|
||||
The bundler is a library that builds a Tauri App for the platform triple it detects / is told. At the moment it currently supports macOS, Windows and Linux - but in the near future will support mobile platforms as well. May be used outside of Tauri projects.
|
||||
|
||||
#### [@tauri-apps/cli](https://github.com/tauri-apps/tauri/tree/dev/packages/cli) [JS]
|
||||
|
||||
It is a wrapper around [tauri-cli](https://github.com/tauri-apps/tauri/blob/dev/crates/tauri-cli) using [napi-rs](https://github.com/napi-rs/napi-rs) to produce NPM packages for each platform.
|
||||
|
||||
#### [tauri-cli](https://github.com/tauri-apps/tauri/tree/dev/crates/tauri-cli) [RUST]
|
||||
#### [@tauri-apps/cli](https://github.com/tauri-apps/tauri/tree/dev/tooling/cli/node) [JS]
|
||||
It is a wrapper around [tauri-cli](https://github.com/tauri-apps/tauri/blob/dev/tooling/cli) using [napi-rs](https://github.com/napi-rs/napi-rs) to produce NPM packages for each platform.
|
||||
|
||||
#### [tauri-cli](https://github.com/tauri-apps/tauri/tree/dev/tooling/cli) [RUST]
|
||||
This rust executable provides the full interface to all of the required activities for which the CLI is required. It will run on macOS, Windows, and Linux.
|
||||
|
||||
#### [create-tauri-app](https://github.com/tauri-apps/create-tauri-app) [JS]
|
||||
|
||||
This is a toolkit that will enable engineering teams to rapidly scaffold out a new tauri-apps project using the frontend framework of their choice (as long as it has been configured).
|
||||
|
||||
# External Crates
|
||||
|
||||
The Tauri-Apps organisation maintains two "upstream" crates from Tauri, namely TAO for creating and managing application windows, and WRY for interfacing with the Webview that lives within the window.
|
||||
|
||||
## [TAO](https://github.com/tauri-apps/tao)
|
||||
|
||||
Cross-platform application window creation library in Rust that supports all major platforms like Windows, macOS, Linux, iOS and Android. Written in Rust, it is a fork of [winit](https://github.com/rust-windowing/winit) that we have extended for our own needs like menu bar and system tray.
|
||||
|
||||
## [WRY](https://github.com/tauri-apps/wry)
|
||||
|
||||
## [WRY](https://github.com/tauri-apps/wry)
|
||||
WRY is a cross-platform WebView rendering library in Rust that supports all major desktop platforms like Windows, macOS, and Linux.
|
||||
Tauri uses WRY as the abstract layer responsible to determine which webview is used (and how interactions are made).
|
||||
|
||||
# Additional tooling
|
||||
|
||||
## [tauri-action](https://github.com/tauri-apps/tauri-action)
|
||||
|
||||
This is a github workflow that builds tauri binaries for all platforms. It is not the fastest out there, but it gets the job done and is highly configurable. Even allowing you to create a (very basic) tauri app even if tauri is not setup.
|
||||
|
||||
## [create-pull-request](https://github.com/tauri-apps/create-pull-request)
|
||||
|
||||
Because this is a very risky (potentially destructive) github action, we forked it in order to have strong guarantees that the code we think is running is actually the code that is running.
|
||||
|
||||
## [vue-cli-plugin-tauri](https://github.com/tauri-apps/vue-cli-plugin-tauri)
|
||||
|
||||
This plugin allows you to very quickly install tauri in a vue-cli project.
|
||||
|
||||
## [tauri-vscode](https://github.com/tauri-apps/tauri-vscode)
|
||||
|
||||
This project enhances the VS Code interface with several nice-to-have features.
|
||||
|
||||
# Tauri Plugins [documentation](https://v2.tauri.app/develop/plugins/)
|
||||
# Tauri Plugins [documentation](https://tauri.app/v1/guides/features/plugin/)
|
||||
|
||||
Generally speaking, plugins are authored by third parties (even though there may be official, supported plugins). A plugin generally does 3 things:
|
||||
|
||||
1. It provides rust code to do "something".
|
||||
2. It provides interface glue to make it easy to integrate into an app.
|
||||
3. It provides a JS API for interfacing with the rust code.
|
||||
|
||||
Here are several examples of Tauri Plugins:
|
||||
|
||||
- <https://github.com/tauri-apps/tauri-plugin-sql>
|
||||
- <https://github.com/tauri-apps/tauri-plugin-stronghold>
|
||||
- <https://github.com/tauri-apps/tauri-plugin-authenticator>
|
||||
- https://github.com/tauri-apps/tauri-plugin-sql
|
||||
- https://github.com/tauri-apps/tauri-plugin-stronghold
|
||||
- https://github.com/tauri-apps/tauri-plugin-authenticator
|
||||
|
||||
# Workflows
|
||||
|
||||
## What does the Development flow look like?
|
||||
|
||||
A developer must first install the prerequisite toolchains for creating a Tauri app. At the very least this will entail installing rust & cargo, and most likely also a modern version of node.js and potentially another package manager. Some platforms may also require other tooling and libraries, but this has been documented carefully in the respective platform docs.
|
||||
|
||||
Because of the many ways to build front-ends, we will stick with a common node.js based approach for development. (Note: Tauri does not by default ship a node.js runtime.)
|
||||
|
||||
The easiest way to do this is to run the following:
|
||||
|
||||
```
|
||||
npm create tauri-app
|
||||
npx create-tauri-app
|
||||
```
|
||||
|
||||
Which will ask you a bunch of questions about the framework you want to install and then create everything you need in a single folder - some via the placement of template files and some through normal installation procedures of your framework.
|
||||
@@ -136,17 +107,12 @@ Which will ask you a bunch of questions about the framework you want to install
|
||||
> If you don't use this process, you will have to manually install the tauri cli, initialise tauri and manually configure the `tauri.conf.json` file.
|
||||
|
||||
Once everything is installed, you can run:
|
||||
|
||||
```
|
||||
pnpm tauri dev
|
||||
-or-
|
||||
yarn tauri dev
|
||||
-or-
|
||||
npm run tauri dev
|
||||
```
|
||||
|
||||
This will do several things:
|
||||
|
||||
1. start the JS Framework devserver
|
||||
2. begin the long process of downloading and compiling the rust libraries
|
||||
3. open an application window with devtools enabled
|
||||
@@ -159,9 +125,10 @@ If you modify your rust code or anything in the Cargo.toml, the window will clos
|
||||
If you need to get deeper insight into your current project, or triage requires investigation of installed components, just run:
|
||||
|
||||
```
|
||||
pnpm tauri info
|
||||
yarn tauri info
|
||||
```
|
||||
|
||||
|
||||
## What does the Release flow look like?
|
||||
|
||||
The release flow begins with proper configuration in the `tauri.conf.json` file. In this file, the developer can configure not only the basic behaviour of the application (like window size and decoration), they can also provide settings for signing and updating.
|
||||
@@ -169,25 +136,21 @@ The release flow begins with proper configuration in the `tauri.conf.json` file.
|
||||
Depending upon the operating system that the developer (or CI) is building the application on, there will be an app built for them for that system. (Cross compilation is not currently available, however there is an official [GitHub Action](https://github.com/tauri-apps/tauri-action) that can be used to build for all platforms.)
|
||||
|
||||
To kick off this process, just:
|
||||
|
||||
```
|
||||
pnpm tauri build
|
||||
yarn tauri build
|
||||
```
|
||||
|
||||
After some time, the process will end and you can see the results in the `./src-tauri/target/release` folder.
|
||||
|
||||
## What does the End-User flow look like?
|
||||
|
||||
End users will be provided with binaries in ways that are appropriate for their systems. Whether macOS, Linux, or Windows, direct download or store installations - they will be able to follow procedures for installing and removing that they are used to.
|
||||
|
||||
## What does the Updating flow look like?
|
||||
|
||||
When a new version is ready, the developer publishes the new signed artifacts to a server (that they have configured within `tauri.conf.json`).
|
||||
|
||||
The application can poll this server to see if there is a new release. When there is a new release, the user is prompted to update. The application update is downloaded, verified (checksum & signature), updated, closed, and restarted.
|
||||
|
||||
## License
|
||||
|
||||
Tauri itself is licensed under MIT or Apache-2.0. If you repackage it and modify any source code, it is your responsibility to verify that you are complying with all upstream licenses. Tauri is provided AS-IS with no explicit claim for suitability for any purpose.
|
||||
|
||||
Here you may peruse our [Software Bill of Materials](https://app.fossa.com/projects/git%2Bgithub.com%2Ftauri-apps%2Ftauri).
|
||||
|
||||
9487
Cargo.lock
generated
9487
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
81
Cargo.toml
81
Cargo.toml
@@ -1,49 +1,30 @@
|
||||
[workspace]
|
||||
resolver = "2"
|
||||
members = [
|
||||
"crates/tauri",
|
||||
"crates/tauri-runtime",
|
||||
"crates/tauri-runtime-wry",
|
||||
"crates/tauri-macros",
|
||||
"crates/tauri-utils",
|
||||
"crates/tauri-build",
|
||||
"crates/tauri-codegen",
|
||||
"crates/tauri-plugin",
|
||||
"crates/tauri-schema-generator",
|
||||
"crates/tauri-schema-worker",
|
||||
"crates/tauri-cli",
|
||||
"crates/tauri-bundler",
|
||||
"crates/tauri-macos-sign",
|
||||
"crates/tauri-driver",
|
||||
|
||||
# @tauri-apps/cli rust project
|
||||
"packages/cli",
|
||||
# core
|
||||
"core/tauri",
|
||||
"core/tauri-runtime",
|
||||
"core/tauri-runtime-wry",
|
||||
"core/tauri-macros",
|
||||
"core/tauri-utils",
|
||||
"core/tauri-build",
|
||||
"core/tauri-codegen",
|
||||
"core/tauri-config-schema",
|
||||
|
||||
# integration tests
|
||||
"crates/tests/restart",
|
||||
"crates/tests/acl",
|
||||
|
||||
# bench
|
||||
"bench",
|
||||
"bench/tests/cpu_intensive/src-tauri",
|
||||
"bench/tests/files_transfer/src-tauri",
|
||||
"bench/tests/helloworld/src-tauri",
|
||||
|
||||
# examples
|
||||
"examples/file-associations/src-tauri",
|
||||
"examples/resources/src-tauri",
|
||||
"examples/api/src-tauri",
|
||||
"examples/api/src-tauri/tauri-plugin-sample",
|
||||
"core/tests/restart",
|
||||
"core/tests/app-updater",
|
||||
]
|
||||
resolver = "2"
|
||||
|
||||
[workspace.package]
|
||||
authors = ["Tauri Programme within The Commons Conservancy"]
|
||||
homepage = "https://tauri.app/"
|
||||
repository = "https://github.com/tauri-apps/tauri"
|
||||
categories = ["gui", "web-programming"]
|
||||
license = "Apache-2.0 OR MIT"
|
||||
edition = "2021"
|
||||
rust-version = "1.77.2"
|
||||
exclude = [
|
||||
# examples that can be compiled with the tauri CLI
|
||||
"examples/api/src-tauri",
|
||||
"examples/updater/src-tauri",
|
||||
"examples/resources/src-tauri",
|
||||
"examples/sidecar/src-tauri",
|
||||
"examples/web/core",
|
||||
"examples/workspace",
|
||||
]
|
||||
|
||||
# default to small, optimized workspace release binaries
|
||||
[profile.release]
|
||||
@@ -52,23 +33,3 @@ codegen-units = 1
|
||||
lto = true
|
||||
incremental = false
|
||||
opt-level = "s"
|
||||
strip = true
|
||||
|
||||
# profiles for tauri-cli
|
||||
[profile.dev.package.miniz_oxide]
|
||||
opt-level = 3
|
||||
|
||||
[profile.release-size-optimized]
|
||||
inherits = "release"
|
||||
codegen-units = 1
|
||||
lto = true
|
||||
incremental = false
|
||||
opt-level = "s"
|
||||
|
||||
# Temporary patch to schemars to preserve newlines in docstrings for our reference docs schemas
|
||||
# See https://github.com/GREsau/schemars/issues/120 for reference
|
||||
[patch.crates-io]
|
||||
schemars_derive = { git = 'https://github.com/tauri-apps/schemars.git', branch = 'feat/preserve-description-newlines' }
|
||||
tauri = { path = "./crates/tauri" }
|
||||
tauri-plugin = { path = "./crates/tauri-plugin" }
|
||||
tauri-utils = { path = "./crates/tauri-utils" }
|
||||
|
||||
@@ -6,7 +6,7 @@ PackageSupplier: Organization: The Tauri Programme in the Commons Conservancy
|
||||
PackageHomePage: https://tauri.app
|
||||
PackageLicenseDeclared: Apache-2.0
|
||||
PackageLicenseDeclared: MIT
|
||||
PackageCopyrightText: 2019-2025, The Tauri Programme in the Commons Conservancy
|
||||
PackageCopyrightText: 2019-2022, The Tauri Programme in the Commons Conservancy
|
||||
PackageSummary: <text>Tauri is a rust project that enables developers to make secure
|
||||
and small desktop applications using a web frontend.
|
||||
</text>
|
||||
|
||||
165
README.md
165
README.md
@@ -4,54 +4,126 @@
|
||||
[](https://opencollective.com/tauri)
|
||||
[](https://github.com/tauri-apps/tauri/actions/workflows/test-core.yml)
|
||||
[](https://app.fossa.com/projects/git%2Bgithub.com%2Ftauri-apps%2Ftauri?ref=badge_shield)
|
||||
[](https://discord.com/invite/tauri)
|
||||
[](https://discord.gg/SpmNs4S)
|
||||
[](https://tauri.app)
|
||||
[](https://good-labs.github.io/greater-good-affirmation)
|
||||
[](https://opencollective.com/tauri)
|
||||
|
||||
## Current Releases
|
||||
|
||||
### Core
|
||||
|
||||
| Component | Description | Version | Lin | Win | Mac |
|
||||
| -------------------------------------------------------------------------------------------- | ----------------------------------------- | -------------------------------------------------------------------------------------------------------- | --- | --- | --- |
|
||||
| [**tauri**](https://github.com/tauri-apps/tauri/tree/dev/core/tauri) | runtime core | [](https://crates.io/crates/tauri) | ✅ | ✅ | ✅ |
|
||||
| [**tauri-build**](https://github.com/tauri-apps/tauri/tree/dev/core/tauri-build) | applies macros at build-time | [](https://crates.io/crates/tauri-build) | ✅ | ✅ | ✅ |
|
||||
| [**tauri-codegen**](https://github.com/tauri-apps/tauri/tree/dev/core/tauri-codegen) | handles assets, parses tauri.conf.json | [](https://crates.io/crates/tauri-codegen) | ✅ | ✅ | ✅ |
|
||||
| [**tauri-macros**](https://github.com/tauri-apps/tauri/tree/dev/core/tauri-macros) | creates macros using tauri-codegen | [](https://crates.io/crates/tauri-macros) | ✅ | ✅ | ✅ |
|
||||
| [**tauri-runtime**](https://github.com/tauri-apps/tauri/tree/dev/core/tauri-runtime) | layer between Tauri and webview libraries | [](https://crates.io/crates/tauri-runtime) | ✅ | ✅ | ✅ |
|
||||
| [**tauri-runtime-wry**](https://github.com/tauri-apps/tauri/tree/dev/core/tauri-runtime-wry) | enables system-level interaction via WRY | [](https://crates.io/crates/tauri-runtime-wry) | ✅ | ✅ | ✅ |
|
||||
| [**tauri-utils**](https://github.com/tauri-apps/tauri/tree/dev/core/tauri-utils) | common code used across the tauri crates | [](https://crates.io/crates/tauri-utils) | ✅ | ✅ | ✅ |
|
||||
|
||||
### Tooling
|
||||
|
||||
| Component | Description | Version | Lin | Win | Mac |
|
||||
| ------------------------------------------------------------------------------------ | ---------------------------------------- | ------------------------------------------------------------------------------------------------------ | --- | --- | --- |
|
||||
| [**bundler**](https://github.com/tauri-apps/tauri/tree/dev/tooling/bundler) | manufacture the final binaries | [](https://crates.io/crates/tauri-bundler) | ✅ | ✅ | ✅ |
|
||||
| [**tauri-cli**](https://github.com/tauri-apps/tauri/tree/dev/tooling/cli) | create, develop and build apps | [](https://crates.io/crates/tauri-cli) | ✅ | ✅ | ✅ |
|
||||
| [**@tauri-apps/cli**](https://github.com/tauri-apps/tauri/tree/dev/tooling/cli/node) | Node.js CLI wrapper for `tauri-cli` | [](https://www.npmjs.com/package/@tauri-apps/cli) | ✅ | ✅ | ✅ |
|
||||
| [**@tauri-apps/api**](https://github.com/tauri-apps/tauri/tree/dev/tooling/api) | JS API for interaction with Rust backend | [](https://www.npmjs.com/package/@tauri-apps/api) | ✅ | ✅ | ✅ |
|
||||
|
||||
### Utilities and Plugins
|
||||
|
||||
| Component | Description | Version | Lin | Win | Mac |
|
||||
| ------------------------------------------------------------------------------- | ------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | --- | --- | --- |
|
||||
| [**create-tauri-app**](https://github.com/tauri-apps/create-tauri-app) | Get started with your first Tauri app | [](https://www.npmjs.com/package/create-tauri-app) | ✅ | ✅ | ✅ |
|
||||
| [**vue-cli-plugin-tauri**](https://github.com/tauri-apps/vue-cli-plugin-tauri/) | Vue CLI plugin for Tauri | [](https://www.npmjs.com/package/vue-cli-plugin-tauri) | ✅ | ✅ | ✅ |
|
||||
|
||||
## Introduction
|
||||
|
||||
Tauri is a framework for building tiny, blazingly fast binaries for all major desktop platforms. Developers can integrate any front-end framework that compiles to HTML, JS and CSS for building their user interface. The backend of the application is a rust-sourced binary with an API that the front-end can interact with.
|
||||
|
||||
The user interface in Tauri apps currently leverages [`tao`](https://docs.rs/tao) as a window handling library on macOS, Windows, Linux, Android and iOS. To render your application, Tauri uses [WRY](https://github.com/tauri-apps/wry), a library which provides a unified interface to the system webview, leveraging WKWebView on macOS & iOS, WebView2 on Windows, WebKitGTK on Linux and Android System WebView on Android.
|
||||
The user interface in Tauri apps currently leverages [`tao`](https://docs.rs/tao) as a window handling library on macOS and Windows, and [`gtk`](https://gtk-rs.org/docs/gtk/) on Linux via the **Tauri-team** incubated and maintained [WRY](https://github.com/tauri-apps/wry), which creates a unified interface to the system webview (and other goodies like Menu and Taskbar), leveraging WebKit on macOS, WebView2 on Windows and WebKitGTK on Linux.
|
||||
|
||||
To learn more about the details of how all of these pieces fit together, please consult this [ARCHITECTURE.md](https://github.com/tauri-apps/tauri/blob/dev/ARCHITECTURE.md) document.
|
||||
|
||||
## Getting Started
|
||||
## Get Started
|
||||
|
||||
If you are interested in making a tauri app, please visit the [documentation website](https://tauri.app).
|
||||
|
||||
The quickest way to get started is to install the [prerequisites](https://v2.tauri.app/start/prerequisites/) for your system and create a new project with [`create-tauri-app`](https://github.com/tauri-apps/create-tauri-app/#usage). For example with `npm`:
|
||||
|
||||
```sh
|
||||
npm create tauri-app@latest
|
||||
```
|
||||
|
||||
## Features
|
||||
|
||||
The list of Tauri's features includes, but is not limited to:
|
||||
|
||||
- Built-in app bundler to create app bundles in formats like `.app`, `.dmg`, `.deb`, `.rpm`, `.AppImage` and Windows installers like `.exe` (via NSIS) and `.msi` (via WiX).
|
||||
- Built-in self updater (desktop only)
|
||||
- System tray icons
|
||||
- Native notifications
|
||||
- Native WebView Protocol (tauri doesn't create a localhost http(s) server to serve the WebView contents)
|
||||
- GitHub action for streamlined CI
|
||||
- VS Code extension
|
||||
If you are interested in making a tauri app, please visit the [documentation website](https://tauri.app). This README is directed towards those who are interested in contributing to the core library. But if you just want a quick overview about where `tauri` is at in its development, here's a quick burndown:
|
||||
|
||||
### Platforms
|
||||
|
||||
Tauri currently supports development and distribution on the following platforms:
|
||||
|
||||
| Platform | Versions |
|
||||
| :--------- | :-------------------------------------------------------------------------------------------------------------- |
|
||||
| Windows | 7 and above |
|
||||
| macOS | 10.15 and above |
|
||||
| Linux | webkit2gtk 4.0 for Tauri v1 (for example Ubuntu 18.04). webkit2gtk 4.1 for Tauri v2 (for example Ubuntu 22.04). |
|
||||
| iOS/iPadOS | 9 and above |
|
||||
| Android | 7 and above (currently 8 and above) |
|
||||
| Platform | Versions |
|
||||
| :----------------------- | :-------------- |
|
||||
| Windows | 7 and above |
|
||||
| macOS | 10.15 and above |
|
||||
| Linux | See below |
|
||||
| iOS/iPadOS (coming soon) | |
|
||||
| Android (coming soon) | |
|
||||
|
||||
## Contributing
|
||||
**Linux Support**
|
||||
|
||||
For **developing** Tauri apps refer to the [Getting Started guide on tauri.app](https://tauri.app/v1/guides/getting-started/prerequisites#setting-up-linux).
|
||||
|
||||
For **running** Tauri apps we support the below configurations (these are automatically added as dependencies for .deb and are bundled for AppImage so that your users don't need to manually install them):
|
||||
|
||||
- Debian (Ubuntu 18.04 and above or equivalent) with the following packages installed:
|
||||
- `libwebkit2gtk-4.0-37`, `libgtk-3-0`, `libayatana-appindicator3-1`<sup>1</sup>
|
||||
- Arch with the following packages installed:
|
||||
- `webkit2gtk`, `gtk3`, `libayatana-appindicator`<sup>1</sup>
|
||||
- Fedora (latest 2 versions) with the following packages installed:
|
||||
- `webkit2gtk3`, `gtk3`, `libappindicator-gtk3`<sup>1</sup>
|
||||
- Void with the following packages installed:
|
||||
- `webkit2gtk`, `gtk+3`, `libappindicator`<sup>1</sup>
|
||||
|
||||
<sup>1</sup> `appindicator` is only required if system trays are used
|
||||
|
||||
### Features
|
||||
|
||||
- [x] Desktop Bundler (.app, .dmg, .deb, AppImage, .msi)
|
||||
- [x] Self Updater
|
||||
- [x] App Signing
|
||||
- [x] Native Notifications (toast)
|
||||
- [x] App Tray
|
||||
- [x] Core Plugin System
|
||||
- [x] Scoped Filesystem
|
||||
- [x] Sidecar
|
||||
|
||||
### Security Features
|
||||
|
||||
- [x] localhost-free (:fire:)
|
||||
- [x] custom protocol for secure mode
|
||||
- [x] Dynamic ahead of Time Compilation (dAoT) with functional tree-shaking
|
||||
- [x] functional Address Space Layout Randomization
|
||||
- [x] OTP salting of function names and messages at runtime
|
||||
- [x] CSP Injection
|
||||
|
||||
### Utilities
|
||||
|
||||
- [x] Rust-based CLI
|
||||
- [x] GH Action for creating binaries for all platforms
|
||||
- [x] VS Code Extension
|
||||
|
||||
## Development
|
||||
|
||||
Tauri is a system composed of a number of moving pieces:
|
||||
|
||||
### Infrastructure
|
||||
|
||||
- Git for code management
|
||||
- GitHub for project management
|
||||
- GitHub actions for CI and CD
|
||||
- Discord for discussions
|
||||
- Netlify-hosted documentation website
|
||||
- DigitalOcean Meilisearch instance
|
||||
|
||||
### Operating systems
|
||||
|
||||
Tauri core can be developed on Mac, Linux and Windows, but you are encouraged to use the latest possible operating systems and build tools for your OS.
|
||||
|
||||
### Contributing
|
||||
|
||||
Before you start working on something, it's best to check if there is an existing issue first. It's also a good idea to stop by the Discord server and confirm with the team if it makes sense or if someone else is already working on it.
|
||||
|
||||
@@ -61,31 +133,32 @@ Thank you to everyone contributing to Tauri!
|
||||
|
||||
### Documentation
|
||||
|
||||
Documentation in a polyglot system is a tricky proposition. To this end, we prefer to use inline documentation in the Rust & JS source code as much as possible. Check out the hosting repository for the documentation site for further information: <https://github.com/tauri-apps/tauri-docs>
|
||||
Documentation in a polyglot system is a tricky proposition. To this end, we prefer to use inline documentation of Rust code and at JSDoc in typescript / javascript code. We autocollect these and publish them using Docusaurus v2 and netlify. Here is the hosting repository for the documentation site: https://github.com/tauri-apps/tauri-docs
|
||||
|
||||
## Partners
|
||||
### Testing & Linting
|
||||
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td align="center" valign="middle">
|
||||
<a href="https://crabnebula.dev" target="_blank">
|
||||
<img src=".github/sponsors/crabnebula.svg" alt="CrabNebula" width="283">
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
Test all the things! We have a number of test suites, but are always looking to improve our coverage:
|
||||
|
||||
For the complete list of sponsors please visit our [website](https://tauri.app#sponsors) and [Open Collective](https://opencollective.com/tauri).
|
||||
- Rust (`cargo test`) => sourced via inline `#[cfg(test)]` declarations
|
||||
- Typescript (`jest`) => via spec files
|
||||
- Smoke Tests (run on merges to latest)
|
||||
- eslint, clippy
|
||||
|
||||
### CI/CD
|
||||
|
||||
We recommend you read this article to understand better how we run our pipelines: https://www.jacobbolda.com/setting-up-ci-and-cd-for-tauri/
|
||||
|
||||
## Organization
|
||||
|
||||
Tauri aims to be a sustainable collective based on principles that guide sustainable free and open software communities. To this end it has become a Programme within the [Commons Conservancy](https://commonsconservancy.org/), and you can contribute financially via [Open Collective](https://opencollective.com/tauri).
|
||||
Tauri aims to be a sustainable collective based on principles that guide [sustainable free and open software communities](https://sfosc.org). To this end it has become a Programme within the [Commons Conservancy](https://commonsconservancy.org/), and you can contribute financially via [Open Collective](https://opencollective.com/tauri).
|
||||
|
||||
## Semver
|
||||
|
||||
**tauri** is following [Semantic Versioning 2.0](https://semver.org/).
|
||||
|
||||
## Licenses
|
||||
|
||||
Code: (c) 2015 - Present - The Tauri Programme within The Commons Conservancy.
|
||||
Code: (c) 2015 - 2021 - The Tauri Programme within The Commons Conservancy.
|
||||
|
||||
MIT or MIT/Apache 2.0 where applicable.
|
||||
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
## Reporting a Vulnerability
|
||||
|
||||
If you have found a potential security threat, vulnerability or exploit in Tauri
|
||||
or one of its upstream dependencies, please DON'T create a pull-request, DON'T
|
||||
file an issue on GitHub, DON'T mention it on Discord and DON'T create a forum thread.
|
||||
or one of its upstream dependencies, please DON’T create a pull-request, DON’T
|
||||
file an issue on GitHub, DON’T mention it on Discord and DON’T create a forum thread.
|
||||
|
||||
Please submit your report via the GitHub Private Vulnerability Disclosure functionality.
|
||||
|
||||
@@ -24,5 +24,5 @@ Additionally, we may ask you to independently verify our patch, which will be av
|
||||
|
||||
Depending on your decision to accept or deny credit for the vulnerability, you will be publicly attributed to the vulnerability and may be mentioned in our announcements.
|
||||
|
||||
At the current time we do not have the financial ability to reward bounties,
|
||||
At the current time we do not have the financial ability to reward bounties,
|
||||
but in extreme cases will at our discretion consider a reward.
|
||||
|
||||
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
Binary file not shown.
@@ -1,384 +0,0 @@
|
||||
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
//! This Rust binary runs on CI and provides internal metrics results of Tauri.
|
||||
//! To learn more see [benchmark_results](https://github.com/tauri-apps/benchmark_results) repository.
|
||||
//!
|
||||
//! ***_Internal use only_***
|
||||
|
||||
#![doc(
|
||||
html_logo_url = "https://github.com/tauri-apps/tauri/raw/dev/.github/icon.png",
|
||||
html_favicon_url = "https://github.com/tauri-apps/tauri/raw/dev/.github/icon.png"
|
||||
)]
|
||||
|
||||
use anyhow::{Context, Result};
|
||||
use std::{
|
||||
collections::{HashMap, HashSet},
|
||||
env,
|
||||
path::Path,
|
||||
process::{Command, Stdio},
|
||||
};
|
||||
|
||||
mod utils;
|
||||
|
||||
/// The list of examples for benchmarks
|
||||
fn get_all_benchmarks(target: &str) -> Vec<(String, String)> {
|
||||
vec![
|
||||
(
|
||||
"tauri_hello_world".into(),
|
||||
format!("../target/{target}/release/bench_helloworld"),
|
||||
),
|
||||
(
|
||||
"tauri_cpu_intensive".into(),
|
||||
format!("../target/{target}/release/bench_cpu_intensive"),
|
||||
),
|
||||
(
|
||||
"tauri_3mb_transfer".into(),
|
||||
format!("../target/{target}/release/bench_files_transfer"),
|
||||
),
|
||||
]
|
||||
}
|
||||
|
||||
fn run_strace_benchmarks(new_data: &mut utils::BenchResult, target: &str) -> Result<()> {
|
||||
use std::io::Read;
|
||||
|
||||
let mut thread_count = HashMap::<String, u64>::new();
|
||||
let mut syscall_count = HashMap::<String, u64>::new();
|
||||
|
||||
for (name, example_exe) in get_all_benchmarks(target) {
|
||||
let mut file = tempfile::NamedTempFile::new()
|
||||
.context("failed to create temporary file for strace output")?;
|
||||
|
||||
let exe_path = utils::bench_root_path().join(&example_exe);
|
||||
let exe_path_str = exe_path
|
||||
.to_str()
|
||||
.context("executable path contains invalid UTF-8")?;
|
||||
let temp_path_str = file
|
||||
.path()
|
||||
.to_str()
|
||||
.context("temporary file path contains invalid UTF-8")?;
|
||||
|
||||
Command::new("strace")
|
||||
.args(["-c", "-f", "-o", temp_path_str, exe_path_str])
|
||||
.stdout(Stdio::inherit())
|
||||
.spawn()
|
||||
.context("failed to spawn strace process")?
|
||||
.wait()
|
||||
.context("failed to wait for strace process")?;
|
||||
|
||||
let mut output = String::new();
|
||||
file
|
||||
.as_file_mut()
|
||||
.read_to_string(&mut output)
|
||||
.context("failed to read strace output")?;
|
||||
|
||||
let strace_result = utils::parse_strace_output(&output);
|
||||
// Count clone/clone3 syscalls as thread creation indicators
|
||||
let clone_calls = strace_result.get("clone").map(|d| d.calls).unwrap_or(0)
|
||||
+ strace_result.get("clone3").map(|d| d.calls).unwrap_or(0);
|
||||
|
||||
if let Some(total) = strace_result.get("total") {
|
||||
thread_count.insert(name.clone(), clone_calls);
|
||||
syscall_count.insert(name, total.calls);
|
||||
}
|
||||
}
|
||||
|
||||
new_data.thread_count = thread_count;
|
||||
new_data.syscall_count = syscall_count;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn run_max_mem_benchmark(target: &str) -> Result<HashMap<String, u64>> {
|
||||
let mut results = HashMap::<String, u64>::new();
|
||||
|
||||
for (name, example_exe) in get_all_benchmarks(target) {
|
||||
let benchmark_file = utils::target_dir().join(format!("mprof{name}_.dat"));
|
||||
let benchmark_file_str = benchmark_file
|
||||
.to_str()
|
||||
.context("benchmark file path contains invalid UTF-8")?;
|
||||
|
||||
let exe_path = utils::bench_root_path().join(&example_exe);
|
||||
let exe_path_str = exe_path
|
||||
.to_str()
|
||||
.context("executable path contains invalid UTF-8")?;
|
||||
|
||||
let proc = Command::new("mprof")
|
||||
.args(["run", "-C", "-o", benchmark_file_str, exe_path_str])
|
||||
.stdout(Stdio::null())
|
||||
.stderr(Stdio::piped())
|
||||
.spawn()
|
||||
.with_context(|| format!("failed to spawn mprof for benchmark {name}"))?;
|
||||
|
||||
let proc_result = proc
|
||||
.wait_with_output()
|
||||
.with_context(|| format!("failed to wait for mprof {name}"))?;
|
||||
|
||||
if !proc_result.status.success() {
|
||||
eprintln!(
|
||||
"mprof failed for {name}: {}",
|
||||
String::from_utf8_lossy(&proc_result.stderr)
|
||||
);
|
||||
}
|
||||
|
||||
if let Some(mem) = utils::parse_max_mem(benchmark_file_str)
|
||||
.with_context(|| format!("failed to parse mprof data for {name}"))?
|
||||
{
|
||||
results.insert(name, mem);
|
||||
}
|
||||
|
||||
// Clean up the temporary file
|
||||
if let Err(e) = std::fs::remove_file(&benchmark_file) {
|
||||
eprintln!("Warning: failed to remove temporary file {benchmark_file_str}: {e}");
|
||||
}
|
||||
}
|
||||
|
||||
Ok(results)
|
||||
}
|
||||
|
||||
fn rlib_size(target_dir: &Path, prefix: &str) -> Result<u64> {
|
||||
let mut size = 0;
|
||||
let mut seen = HashSet::new();
|
||||
|
||||
let deps_dir = target_dir.join("deps");
|
||||
for entry in std::fs::read_dir(&deps_dir).with_context(|| {
|
||||
format!(
|
||||
"failed to read target deps directory: {}",
|
||||
deps_dir.display()
|
||||
)
|
||||
})? {
|
||||
let entry = entry.context("failed to read directory entry")?;
|
||||
let name = entry.file_name().to_string_lossy().to_string();
|
||||
|
||||
if name.starts_with(prefix) && name.ends_with(".rlib") {
|
||||
if let Some(start) = name.split('-').next() {
|
||||
if seen.insert(start.to_string()) {
|
||||
size += entry
|
||||
.metadata()
|
||||
.context("failed to read file metadata")?
|
||||
.len();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if size == 0 {
|
||||
anyhow::bail!(
|
||||
"no rlib files found for prefix {prefix} in {}",
|
||||
deps_dir.display()
|
||||
);
|
||||
}
|
||||
|
||||
Ok(size)
|
||||
}
|
||||
|
||||
fn get_binary_sizes(target_dir: &Path, target: &str) -> Result<HashMap<String, u64>> {
|
||||
let mut sizes = HashMap::<String, u64>::new();
|
||||
|
||||
let wry_size = rlib_size(target_dir, "libwry")?;
|
||||
sizes.insert("wry_rlib".to_string(), wry_size);
|
||||
|
||||
for (name, example_exe) in get_all_benchmarks(target) {
|
||||
let exe_path = utils::bench_root_path().join(&example_exe);
|
||||
let meta = std::fs::metadata(&exe_path)
|
||||
.with_context(|| format!("failed to read metadata for {}", exe_path.display()))?;
|
||||
sizes.insert(name, meta.len());
|
||||
}
|
||||
|
||||
Ok(sizes)
|
||||
}
|
||||
|
||||
/// (target OS, target triple)
|
||||
const TARGETS: &[(&str, &[&str])] = &[
|
||||
(
|
||||
"Windows",
|
||||
&[
|
||||
"x86_64-pc-windows-gnu",
|
||||
"i686-pc-windows-gnu",
|
||||
"i686-pc-windows-msvc",
|
||||
"x86_64-pc-windows-msvc",
|
||||
],
|
||||
),
|
||||
(
|
||||
"Linux",
|
||||
&[
|
||||
"x86_64-unknown-linux-gnu",
|
||||
"i686-unknown-linux-gnu",
|
||||
"aarch64-unknown-linux-gnu",
|
||||
],
|
||||
),
|
||||
("macOS", &["x86_64-apple-darwin", "aarch64-apple-darwin"]),
|
||||
];
|
||||
|
||||
fn cargo_deps() -> HashMap<String, usize> {
|
||||
let mut results = HashMap::new();
|
||||
for (os, targets) in TARGETS {
|
||||
for target in *targets {
|
||||
let mut cmd = Command::new("cargo");
|
||||
cmd.arg("tree");
|
||||
cmd.arg("--no-dedupe");
|
||||
cmd.args(["--edges", "normal"]);
|
||||
cmd.args(["--prefix", "none"]);
|
||||
cmd.args(["--target", target]);
|
||||
cmd.current_dir(utils::tauri_root_path());
|
||||
|
||||
match cmd.output() {
|
||||
Ok(output) if output.status.success() => {
|
||||
let full_deps = String::from_utf8_lossy(&output.stdout);
|
||||
let count = full_deps
|
||||
.lines()
|
||||
.collect::<HashSet<_>>()
|
||||
.len()
|
||||
.saturating_sub(1); // output includes wry itself
|
||||
|
||||
// set the count to the highest count seen for this OS
|
||||
let existing = results.entry(os.to_string()).or_default();
|
||||
*existing = count.max(*existing);
|
||||
|
||||
if count <= 10 {
|
||||
eprintln!("Warning: dependency count for {target} seems low: {count}");
|
||||
}
|
||||
}
|
||||
Ok(output) => {
|
||||
eprintln!(
|
||||
"cargo tree failed for {target}: {}",
|
||||
String::from_utf8_lossy(&output.stderr)
|
||||
);
|
||||
}
|
||||
Err(e) => {
|
||||
eprintln!("Failed to run cargo tree for {target}: {e}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
results
|
||||
}
|
||||
|
||||
const RESULT_KEYS: &[&str] = &["mean", "stddev", "user", "system", "min", "max"];
|
||||
|
||||
fn run_exec_time(target: &str) -> Result<HashMap<String, HashMap<String, f64>>> {
|
||||
let target_dir = utils::target_dir();
|
||||
let benchmark_file = target_dir.join("hyperfine_results.json");
|
||||
let benchmark_file_str = benchmark_file
|
||||
.to_str()
|
||||
.context("benchmark file path contains invalid UTF-8")?;
|
||||
|
||||
let mut command = vec![
|
||||
"hyperfine",
|
||||
"--export-json",
|
||||
benchmark_file_str,
|
||||
"--show-output",
|
||||
"--warmup",
|
||||
"3",
|
||||
];
|
||||
|
||||
let benchmarks = get_all_benchmarks(target);
|
||||
let mut benchmark_paths = Vec::new();
|
||||
|
||||
for (_, example_exe) in &benchmarks {
|
||||
let exe_path = utils::bench_root_path().join(example_exe);
|
||||
let exe_path_str = exe_path
|
||||
.to_str()
|
||||
.context("executable path contains invalid UTF-8")?;
|
||||
benchmark_paths.push(exe_path_str.to_string());
|
||||
}
|
||||
|
||||
for path in &benchmark_paths {
|
||||
command.push(path.as_str());
|
||||
}
|
||||
|
||||
utils::run(&command)?;
|
||||
|
||||
let mut results = HashMap::<String, HashMap<String, f64>>::new();
|
||||
let hyperfine_results = utils::read_json(benchmark_file_str)?;
|
||||
|
||||
if let Some(results_array) = hyperfine_results
|
||||
.as_object()
|
||||
.and_then(|obj| obj.get("results"))
|
||||
.and_then(|val| val.as_array())
|
||||
{
|
||||
for ((name, _), data) in benchmarks.iter().zip(results_array.iter()) {
|
||||
if let Some(data_obj) = data.as_object() {
|
||||
let filtered_data: HashMap<String, f64> = data_obj
|
||||
.iter()
|
||||
.filter(|(key, _)| RESULT_KEYS.contains(&key.as_str()))
|
||||
.filter_map(|(key, val)| val.as_f64().map(|v| (key.clone(), v)))
|
||||
.collect();
|
||||
|
||||
results.insert(name.clone(), filtered_data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Ok(results)
|
||||
}
|
||||
|
||||
fn main() -> Result<()> {
|
||||
let json_3mb = utils::home_path().join(".tauri_3mb.json");
|
||||
|
||||
if !json_3mb.exists() {
|
||||
println!("Downloading test data...");
|
||||
utils::download_file(
|
||||
"https://github.com/lemarier/tauri-test/releases/download/v2.0.0/json_3mb.json",
|
||||
json_3mb,
|
||||
)
|
||||
.context("failed to download test data")?;
|
||||
}
|
||||
|
||||
println!("Starting tauri benchmark");
|
||||
|
||||
let target_dir = utils::target_dir();
|
||||
let target = utils::get_target();
|
||||
|
||||
env::set_current_dir(utils::bench_root_path())
|
||||
.context("failed to set working directory to bench root")?;
|
||||
|
||||
let now = std::time::SystemTime::now()
|
||||
.duration_since(std::time::UNIX_EPOCH)
|
||||
.context("failed to get current time")?;
|
||||
let timestamp = format!("{}", now.as_secs());
|
||||
|
||||
println!("Running execution time benchmarks...");
|
||||
let exec_time = run_exec_time(target)?;
|
||||
|
||||
println!("Getting binary sizes...");
|
||||
let binary_size = get_binary_sizes(&target_dir, target)?;
|
||||
|
||||
println!("Analyzing cargo dependencies...");
|
||||
let cargo_deps = cargo_deps();
|
||||
|
||||
let mut new_data = utils::BenchResult {
|
||||
created_at: timestamp,
|
||||
sha1: {
|
||||
let output = utils::run_collect(&["git", "rev-parse", "HEAD"])?;
|
||||
output.0.trim().to_string()
|
||||
},
|
||||
exec_time,
|
||||
binary_size,
|
||||
cargo_deps,
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
if cfg!(target_os = "linux") {
|
||||
println!("Running Linux-specific benchmarks...");
|
||||
run_strace_benchmarks(&mut new_data, target)?;
|
||||
new_data.max_memory = run_max_mem_benchmark(target)?;
|
||||
}
|
||||
|
||||
println!("===== <BENCHMARK RESULTS>");
|
||||
serde_json::to_writer_pretty(std::io::stdout(), &new_data)
|
||||
.context("failed to serialize benchmark results")?;
|
||||
println!("\n===== </BENCHMARK RESULTS>");
|
||||
|
||||
let bench_file = target_dir.join("bench.json");
|
||||
if let Some(filename) = bench_file.to_str() {
|
||||
utils::write_json(filename, &serde_json::to_value(&new_data)?)
|
||||
.context("failed to write benchmark results to file")?;
|
||||
println!("Results written to: {filename}");
|
||||
} else {
|
||||
eprintln!("Cannot write bench.json, path contains invalid UTF-8");
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
@@ -1,275 +0,0 @@
|
||||
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
//! Utility functions for benchmarking tasks in the Tauri project.
|
||||
//!
|
||||
//! This module provides helpers for:
|
||||
//! - Paths to project directories and targets
|
||||
//! - Running and collecting process outputs
|
||||
//! - Parsing memory profiler (`mprof`) and syscall profiler (`strace`) outputs
|
||||
//! - JSON read/write utilities
|
||||
//! - File download utilities (via `curl` or file copy)
|
||||
|
||||
use anyhow::{bail, Context, Result};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use serde_json::Value;
|
||||
use std::{
|
||||
collections::HashMap,
|
||||
fs,
|
||||
io::{BufRead, BufReader},
|
||||
path::PathBuf,
|
||||
process::{Command, Output, Stdio},
|
||||
};
|
||||
|
||||
/// Holds the results of a benchmark run.
|
||||
#[derive(Default, Clone, Serialize, Deserialize, Debug)]
|
||||
pub struct BenchResult {
|
||||
pub created_at: String,
|
||||
pub sha1: String,
|
||||
pub exec_time: HashMap<String, HashMap<String, f64>>,
|
||||
pub binary_size: HashMap<String, u64>,
|
||||
pub max_memory: HashMap<String, u64>,
|
||||
pub thread_count: HashMap<String, u64>,
|
||||
pub syscall_count: HashMap<String, u64>,
|
||||
pub cargo_deps: HashMap<String, usize>,
|
||||
}
|
||||
|
||||
/// Represents a single line of parsed `strace` output.
|
||||
#[derive(Debug, Clone, Serialize)]
|
||||
pub struct StraceOutput {
|
||||
pub percent_time: f64,
|
||||
pub seconds: f64,
|
||||
pub usecs_per_call: Option<u64>,
|
||||
pub calls: u64,
|
||||
pub errors: u64,
|
||||
}
|
||||
|
||||
/// Get the compilation target triple for the current platform.
|
||||
pub fn get_target() -> &'static str {
|
||||
#[cfg(target_os = "macos")]
|
||||
return if cfg!(target_arch = "aarch64") {
|
||||
"aarch64-apple-darwin"
|
||||
} else {
|
||||
"x86_64-apple-darwin"
|
||||
};
|
||||
|
||||
#[cfg(target_os = "ios")]
|
||||
return if cfg!(target_arch = "aarch64") {
|
||||
"aarch64-apple-ios"
|
||||
} else {
|
||||
"x86_64-apple-ios"
|
||||
};
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
return "x86_64-unknown-linux-gnu";
|
||||
|
||||
#[cfg(target_os = "windows")]
|
||||
unimplemented!("Windows target not implemented yet");
|
||||
}
|
||||
|
||||
/// Get the `target/release` directory path for benchmarks.
|
||||
pub fn target_dir() -> PathBuf {
|
||||
bench_root_path()
|
||||
.join("..")
|
||||
.join("target")
|
||||
.join(get_target())
|
||||
.join("release")
|
||||
}
|
||||
|
||||
/// Get the root path of the current benchmark crate.
|
||||
pub fn bench_root_path() -> PathBuf {
|
||||
PathBuf::from(env!("CARGO_MANIFEST_DIR"))
|
||||
}
|
||||
|
||||
/// Get the home directory of the current user.
|
||||
pub fn home_path() -> PathBuf {
|
||||
#[cfg(any(target_os = "macos", target_os = "ios", target_os = "linux"))]
|
||||
{
|
||||
PathBuf::from(std::env::var("HOME").unwrap_or_default())
|
||||
}
|
||||
|
||||
#[cfg(target_os = "windows")]
|
||||
{
|
||||
PathBuf::from(std::env::var("USERPROFILE").unwrap_or_default())
|
||||
}
|
||||
}
|
||||
|
||||
/// Get the root path of the Tauri repository.
|
||||
pub fn tauri_root_path() -> PathBuf {
|
||||
bench_root_path().parent().map(|p| p.to_path_buf()).unwrap()
|
||||
}
|
||||
|
||||
/// Run a command and collect its stdout and stderr as strings.
|
||||
/// Returns an error if the command fails or exits with a non-zero status.
|
||||
pub fn run_collect(cmd: &[&str]) -> Result<(String, String)> {
|
||||
let output: Output = Command::new(cmd[0])
|
||||
.args(&cmd[1..])
|
||||
.stdin(Stdio::piped())
|
||||
.stdout(Stdio::piped())
|
||||
.stderr(Stdio::piped())
|
||||
.output()
|
||||
.with_context(|| format!("failed to execute command: {cmd:?}"))?;
|
||||
|
||||
if !output.status.success() {
|
||||
bail!(
|
||||
"Command {:?} exited with {:?}\nstdout:\n{}\nstderr:\n{}",
|
||||
cmd,
|
||||
output.status.code(),
|
||||
String::from_utf8_lossy(&output.stdout),
|
||||
String::from_utf8_lossy(&output.stderr)
|
||||
);
|
||||
}
|
||||
|
||||
Ok((
|
||||
String::from_utf8_lossy(&output.stdout).to_string(),
|
||||
String::from_utf8_lossy(&output.stderr).to_string(),
|
||||
))
|
||||
}
|
||||
|
||||
/// Parse a memory profiler (`mprof`) output file and return the maximum
|
||||
/// memory usage in bytes. Returns `None` if no values are found.
|
||||
pub fn parse_max_mem(file_path: &str) -> Result<Option<u64>> {
|
||||
let file = fs::File::open(file_path)
|
||||
.with_context(|| format!("failed to open mprof output file {file_path}"))?;
|
||||
let output = BufReader::new(file);
|
||||
|
||||
let mut highest: u64 = 0;
|
||||
|
||||
for line in output.lines().map_while(Result::ok) {
|
||||
let split: Vec<&str> = line.split(' ').collect();
|
||||
if split.len() == 3 {
|
||||
if let Ok(mb) = split[1].parse::<f64>() {
|
||||
let current_bytes = (mb * 1024.0 * 1024.0) as u64;
|
||||
highest = highest.max(current_bytes);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Best-effort cleanup
|
||||
let _ = fs::remove_file(file_path);
|
||||
|
||||
Ok(if highest > 0 { Some(highest) } else { None })
|
||||
}
|
||||
|
||||
/// Parse the output of `strace -c` and return a summary of syscalls.
|
||||
pub fn parse_strace_output(output: &str) -> HashMap<String, StraceOutput> {
|
||||
let mut summary = HashMap::new();
|
||||
|
||||
let mut lines = output
|
||||
.lines()
|
||||
.filter(|line| !line.is_empty() && !line.contains("detached ..."));
|
||||
|
||||
let count = lines.clone().count();
|
||||
if count < 4 {
|
||||
return summary;
|
||||
}
|
||||
|
||||
let total_line = lines.next_back().unwrap();
|
||||
lines.next_back(); // Drop separator
|
||||
let data_lines = lines.skip(2);
|
||||
|
||||
for line in data_lines {
|
||||
let syscall_fields: Vec<&str> = line.split_whitespace().collect();
|
||||
let len = syscall_fields.len();
|
||||
|
||||
if let Some(&syscall_name) = syscall_fields.last() {
|
||||
if (5..=6).contains(&len) {
|
||||
let output = StraceOutput {
|
||||
percent_time: syscall_fields[0].parse().unwrap_or(0.0),
|
||||
seconds: syscall_fields[1].parse().unwrap_or(0.0),
|
||||
usecs_per_call: syscall_fields[2].parse().ok(),
|
||||
calls: syscall_fields[3].parse().unwrap_or(0),
|
||||
errors: if len < 6 {
|
||||
0
|
||||
} else {
|
||||
syscall_fields[4].parse().unwrap_or(0)
|
||||
},
|
||||
};
|
||||
summary.insert(syscall_name.to_string(), output);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let total_fields: Vec<&str> = total_line.split_whitespace().collect();
|
||||
let total = match total_fields.len() {
|
||||
5 => StraceOutput {
|
||||
percent_time: total_fields[0].parse().unwrap_or(0.0),
|
||||
seconds: total_fields[1].parse().unwrap_or(0.0),
|
||||
usecs_per_call: None,
|
||||
calls: total_fields[2].parse().unwrap_or(0),
|
||||
errors: total_fields[3].parse().unwrap_or(0),
|
||||
},
|
||||
6 => StraceOutput {
|
||||
percent_time: total_fields[0].parse().unwrap_or(0.0),
|
||||
seconds: total_fields[1].parse().unwrap_or(0.0),
|
||||
usecs_per_call: total_fields[2].parse().ok(),
|
||||
calls: total_fields[3].parse().unwrap_or(0),
|
||||
errors: total_fields[4].parse().unwrap_or(0),
|
||||
},
|
||||
_ => {
|
||||
panic!("Unexpected total field count: {}", total_fields.len());
|
||||
}
|
||||
};
|
||||
|
||||
summary.insert("total".to_string(), total);
|
||||
summary
|
||||
}
|
||||
|
||||
/// Run a command and wait for completion.
|
||||
/// Returns an error if the command fails.
|
||||
pub fn run(cmd: &[&str]) -> Result<()> {
|
||||
let status = Command::new(cmd[0])
|
||||
.args(&cmd[1..])
|
||||
.stdin(Stdio::piped())
|
||||
.status()
|
||||
.with_context(|| format!("failed to execute command: {cmd:?}"))?;
|
||||
|
||||
if !status.success() {
|
||||
bail!("Command {:?} exited with {:?}", cmd, status.code());
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Read a JSON file into a [`serde_json::Value`].
|
||||
pub fn read_json(filename: &str) -> Result<Value> {
|
||||
let f =
|
||||
fs::File::open(filename).with_context(|| format!("failed to open JSON file {filename}"))?;
|
||||
Ok(serde_json::from_reader(f)?)
|
||||
}
|
||||
|
||||
/// Write a [`serde_json::Value`] into a JSON file.
|
||||
pub fn write_json(filename: &str, value: &Value) -> Result<()> {
|
||||
let f =
|
||||
fs::File::create(filename).with_context(|| format!("failed to create JSON file {filename}"))?;
|
||||
serde_json::to_writer(f, value)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Download a file from either a local path or an HTTP/HTTPS URL.
|
||||
/// Falls back to copying the file if the URL does not start with http/https.
|
||||
pub fn download_file(url: &str, filename: PathBuf) -> Result<()> {
|
||||
if !url.starts_with("http:") && !url.starts_with("https:") {
|
||||
fs::copy(url, &filename).with_context(|| format!("failed to copy from {url}"))?;
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
println!("Downloading {url}");
|
||||
let status = Command::new("curl")
|
||||
.arg("-L")
|
||||
.arg("-s")
|
||||
.arg("-o")
|
||||
.arg(&filename)
|
||||
.arg(url)
|
||||
.status()
|
||||
.with_context(|| format!("failed to execute curl for {url}"))?;
|
||||
|
||||
if !status.success() {
|
||||
bail!("curl failed with exit code {:?}", status.code());
|
||||
}
|
||||
if !filename.exists() {
|
||||
bail!("expected file {:?} to exist after download", filename);
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
body {
|
||||
font-family:
|
||||
-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial,
|
||||
sans-serif;
|
||||
margin: auto;
|
||||
max-width: 38rem;
|
||||
padding: 2rem;
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
[package]
|
||||
name = "bench_cpu_intensive"
|
||||
version = "0.1.0"
|
||||
description = "A very simple Tauri Application"
|
||||
edition = "2021"
|
||||
rust-version = "1.77.2"
|
||||
|
||||
[build-dependencies]
|
||||
tauri-build = { path = "../../../../crates/tauri-build", features = [
|
||||
"codegen",
|
||||
] }
|
||||
|
||||
[dependencies]
|
||||
serde_json = "1"
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
tauri = { path = "../../../../crates/tauri", features = [] }
|
||||
@@ -1,33 +0,0 @@
|
||||
{
|
||||
"$schema": "../../../../crates/tauri-schema-generator/schemas/config.schema.json",
|
||||
"identifier": "com.tauri.dev",
|
||||
"build": {
|
||||
"frontendDist": "../public"
|
||||
},
|
||||
"app": {
|
||||
"withGlobalTauri": true,
|
||||
"windows": [
|
||||
{
|
||||
"title": "Welcome to Tauri!",
|
||||
"width": 800,
|
||||
"height": 600,
|
||||
"resizable": true,
|
||||
"fullscreen": false
|
||||
}
|
||||
],
|
||||
"security": {
|
||||
"csp": "default-src blob: data: filesystem: ws: wss: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self'; connect-src ipc: http://ipc.localhost"
|
||||
}
|
||||
},
|
||||
"bundle": {
|
||||
"active": true,
|
||||
"targets": "all",
|
||||
"icon": [
|
||||
"../../../../examples/.icons/32x32.png",
|
||||
"../../../../examples/.icons/128x128.png",
|
||||
"../../../../examples/.icons/128x128@2x.png",
|
||||
"../../../../examples/.icons/icon.icns",
|
||||
"../../../../examples/.icons/icon.ico"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
[package]
|
||||
name = "bench_files_transfer"
|
||||
version = "0.1.0"
|
||||
description = "A very simple Tauri Application"
|
||||
edition = "2021"
|
||||
rust-version = "1.77.2"
|
||||
|
||||
[build-dependencies]
|
||||
tauri-build = { path = "../../../../crates/tauri-build", features = [
|
||||
"codegen",
|
||||
] }
|
||||
|
||||
[dependencies]
|
||||
serde_json = "1"
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
tauri = { path = "../../../../crates/tauri", features = [] }
|
||||
@@ -1,30 +0,0 @@
|
||||
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
|
||||
|
||||
use std::fs::read;
|
||||
use tauri::{command, ipc::Response, path::BaseDirectory, AppHandle, Manager, Runtime};
|
||||
|
||||
#[command]
|
||||
fn app_should_close(exit_code: i32) {
|
||||
std::process::exit(exit_code);
|
||||
}
|
||||
|
||||
#[command]
|
||||
async fn read_file<R: Runtime>(app: AppHandle<R>) -> Result<Response, String> {
|
||||
let path = app
|
||||
.path()
|
||||
.resolve(".tauri_3mb.json", BaseDirectory::Home)
|
||||
.map_err(|e| e.to_string())?;
|
||||
let contents = read(path).map_err(|e| e.to_string())?;
|
||||
Ok(Response::new(contents))
|
||||
}
|
||||
|
||||
fn main() {
|
||||
tauri::Builder::default()
|
||||
.invoke_handler(tauri::generate_handler![app_should_close, read_file])
|
||||
.run(tauri::generate_context!())
|
||||
.expect("error while running tauri application");
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
{
|
||||
"$schema": "../../../../crates/tauri-schema-generator/schemas/config.schema.json",
|
||||
"identifier": "com.tauri.dev",
|
||||
"build": {
|
||||
"frontendDist": "../public"
|
||||
},
|
||||
"app": {
|
||||
"withGlobalTauri": true,
|
||||
"windows": [
|
||||
{
|
||||
"title": "Welcome to Tauri!",
|
||||
"width": 800,
|
||||
"height": 600,
|
||||
"resizable": true,
|
||||
"fullscreen": false
|
||||
}
|
||||
],
|
||||
"security": {
|
||||
"csp": "default-src blob: data: filesystem: ws: wss: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self'; connect-src ipc: http://ipc.localhost"
|
||||
}
|
||||
},
|
||||
"bundle": {
|
||||
"active": true,
|
||||
"targets": "all",
|
||||
"icon": [
|
||||
"../../../../examples/.icons/32x32.png",
|
||||
"../../../../examples/.icons/128x128.png",
|
||||
"../../../../examples/.icons/128x128@2x.png",
|
||||
"../../../../examples/.icons/icon.icns",
|
||||
"../../../../examples/.icons/icon.ico"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
[package]
|
||||
name = "bench_helloworld"
|
||||
version = "0.1.0"
|
||||
description = "A very simple Tauri Application"
|
||||
edition = "2021"
|
||||
rust-version = "1.77.2"
|
||||
|
||||
[build-dependencies]
|
||||
tauri-build = { path = "../../../../crates/tauri-build", features = [
|
||||
"codegen",
|
||||
] }
|
||||
|
||||
[dependencies]
|
||||
serde_json = "1"
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
tauri = { path = "../../../../crates/tauri", features = [] }
|
||||
@@ -1,35 +0,0 @@
|
||||
{
|
||||
"$schema": "../../../../crates/tauri-schema-generator/schemas/config.schema.json",
|
||||
"identifier": "com.tauri.dev",
|
||||
"build": {
|
||||
"frontendDist": "../public",
|
||||
"beforeDevCommand": "",
|
||||
"beforeBuildCommand": ""
|
||||
},
|
||||
"app": {
|
||||
"withGlobalTauri": true,
|
||||
"windows": [
|
||||
{
|
||||
"title": "Welcome to Tauri!",
|
||||
"width": 800,
|
||||
"height": 600,
|
||||
"resizable": true,
|
||||
"fullscreen": false
|
||||
}
|
||||
],
|
||||
"security": {
|
||||
"csp": "default-src blob: data: filesystem: ws: wss: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self'; connect-src ipc: http://ipc.localhost"
|
||||
}
|
||||
},
|
||||
"bundle": {
|
||||
"active": true,
|
||||
"targets": "all",
|
||||
"icon": [
|
||||
"../../../../examples/.icons/32x32.png",
|
||||
"../../../../examples/.icons/128x128.png",
|
||||
"../../../../examples/.icons/128x128@2x.png",
|
||||
"../../../../examples/.icons/icon.icns",
|
||||
"../../../../examples/.icons/icon.ico"
|
||||
]
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user