Compare commits

..

7 Commits

Author SHA1 Message Date
Lucas Nogueira
83a9e6c572 Merge remote-tracking branch 'origin/dev' into feat/command-tests 2023-01-04 19:00:48 -03:00
Lucas Nogueira
f7e86798c2 lint 2023-01-04 18:19:15 -03:00
Lucas Nogueira
936d46a41a struct arg test 2023-01-02 15:43:37 -03:00
Lucas Nogueira
a115f91c52 add future test 2023-01-02 15:21:49 -03:00
Lucas Nogueira
2624af9c24 add rename_all test 2022-12-09 09:02:06 -03:00
Lucas Nogueira
b0485d0187 add async command tests, command with arg 2022-12-08 17:02:58 -03:00
Lucas Nogueira
a2724b3e1c basic setup for command tests 2022-12-08 14:15:20 -03:00
1423 changed files with 106261 additions and 169773 deletions

View File

@@ -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
View File

@@ -0,0 +1,2 @@
[env]
__TAURI_WORKSPACE__ = "true"

View File

@@ -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"

View File

@@ -0,0 +1,5 @@
---
"tauri-bundler": patch
---
Add dylib support to `tauri.bundle.macOS.frameworks`.

View File

@@ -0,0 +1,5 @@
---
"api": minor
---
Added the `additionalBrowserArgs` option when creating a window.

View File

@@ -0,0 +1,5 @@
---
"tauri-utils": minor
---
Added the `additional_browser_args` option to the window configuration.

View File

@@ -0,0 +1,7 @@
---
"tauri": minor
"tauri-runtime-wry": minor
"tauri-runtime": minor
---
Added the `additional_browser_args` option when creating a window.

6
.changes/cli-info.md Normal file
View File

@@ -0,0 +1,6 @@
---
"cli.rs": "patch"
---
Fix `tauri info` panicking when parsing crates version on a newly created project without a `Cargo.lock` file.

View File

@@ -1,27 +1,21 @@
{
"gitSiteUrl": "https://www.github.com/tauri-apps/tauri/",
"changeTags": {
"feat": "New Features",
"enhance": "Enhancements",
"bug": "Bug Fixes",
"perf": "Performance Improvements",
"changes": "What's Changed",
"sec": "Security fixes",
"deps": "Dependencies",
"breaking": "Breaking Changes"
},
"defaultChangeTag": "changes",
"timeout": 3600000,
"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": "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,
@@ -40,6 +34,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,
@@ -56,34 +55,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
@@ -92,17 +91,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
},
{
@@ -111,27 +115,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",
"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": "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
},
@@ -143,81 +177,90 @@
]
},
"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 ../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",
"cli.js": {
"path": "./tooling/cli/node",
"manager": "javascript",
"dependencies": ["tauri-cli"],
"postversion": "node ../../.scripts/ci/sync-cli-metadata.js ${ pkg.pkg } ${ release.type }",
"getPublishedVersion": "node ../../../.scripts/covector/package-latest-version.js npm ${ pkgFile.pkg.name } ${ pkgFile.pkg.version }",
"dependencies": ["cli.rs"],
"postversion": [
"node ../../../.scripts/covector/sync-cli-metadata.js ${ pkg.pkg } ${ release.type }",
"cargo build --manifest-path ../../../core/config-schema/Cargo.toml"
],
"prepublish": [],
"publish": [],
"postpublish": []
},
"tauri-cli": {
"path": "./crates/tauri-cli",
"cli.rs": {
"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/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",
"path": "./tooling/webdriver",
"manager": "rust"
}
}

View File

@@ -0,0 +1,5 @@
---
"api": "minor"
---
Added the `WindowOptions::contentProtected` option and `WebviewWindow#setContentProtected` to change it at runtime.

View File

@@ -0,0 +1,5 @@
---
"tauri-utils": "patch"
---
Added the `content_protected` option to the window configuration.

View File

@@ -0,0 +1,7 @@
---
"tauri": "minor"
"tauri-runtime": "minor"
"tauri-runtime-wry": "minor"
---
Added the `content_protected` option when creating a window and `Window::set_content_protected` to change it at runtime.

View File

@@ -0,0 +1,5 @@
---
"tauri": minor
---
Added `Window::on_navigation`.

View File

@@ -0,0 +1,5 @@
---
"tauri": "patch"
---
Sync `__TAURI_METADATA__.__windows` across all windows.

View File

@@ -0,0 +1,5 @@
---
"api": minor
---
Allow setting the text of the dialog buttons.

View File

@@ -0,0 +1,5 @@
---
"tauri": minor
---
Added `OkWithLabel` and `OkCancelWithLabels` variants to the `api::dialog::MessageDialogButtons` enum to set the text of the dialog buttons.

6
.changes/custom-icon.md Normal file
View File

@@ -0,0 +1,6 @@
---
"cli.rs": minor
"cli.js": minor
---
Add `--png` option for the `icon` command to generate custom icon sizes.

View File

@@ -0,0 +1,7 @@
---
"tauri-runtime-wry": minor
"tauri-runtime": minor
"tauri": minor
---
Added `Builder::device_event_filter` and `App::set_device_event_filter` methods.

5
.changes/fix-2549.md Normal file
View File

@@ -0,0 +1,5 @@
---
"tauri": "patch"
---
Fix resize glitch when double clicking a custom titlebar in the top resize area.

View File

@@ -0,0 +1,5 @@
---
"tauri": "patch"
---
Fix the filesystem scope allowing sub-directories of the directory picked by the dialog when `recursive` option was `false`.

5
.changes/heck-unicode.md Normal file
View File

@@ -0,0 +1,5 @@
---
"cli.rs": "patch"
---
Fix building apps with unicode characters in their `productName`.

8
.changes/is-minimized.md Normal file
View File

@@ -0,0 +1,8 @@
---
"tauri": minor
"tauri-runtime": minor
"tauri-runtime-wry": minor
"api": minor
---
Add `is_minimized()` window method.

8
.changes/nsis.md Normal file
View File

@@ -0,0 +1,8 @@
---
"tauri-bundler": minor
"tauri-utils": minor
"cli.rs": minor
"cli.js": minor
---
Add `nsis` bundle target

View File

@@ -0,0 +1,5 @@
---
"tauri": minor
---
Added support to `mailto:` and `tel:` links on the shell API.

View File

@@ -1,44 +1,31 @@
# Changes
##### via https://github.com/jbolda/covector
As you create PRs and make changes that require a version bump, please add a new markdown file in this folder. You do not note the version _number_, but rather the type of bump that you expect: major, minor, or patch. The filename is not important, as long as it is a `.md`, but we recommend that it represents the overall change for organizational purposes.
When you select the version bump required, you do _not_ need to consider dependencies. Only note the package with the actual change, and any packages that depend on that package will be bumped automatically in the process.
Use the following format:
```md
---
'package-a': 'patch:enhance'
'package-b': 'patch:enhance'
---
Change summary goes here
```
Summaries do not have a specific character limit, but are text only. These summaries are used within the (future implementation of) changelogs. They will give context to the change and also point back to the original PR if more details and context are needed.
Changes will be designated as a `major`, `minor` or `patch` as further described in [semver](https://semver.org/).
Given a version number MAJOR.MINOR.PATCH, increment the:
- MAJOR version when you make incompatible API changes,
- MINOR version when you add functionality in a backwards compatible manner, and
- PATCH version when you make backwards compatible bug fixes.
Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format, but will be discussed prior to usage (as extra steps will be necessary in consideration of merging and publishing).
Additionally you could specify a tag for the change file to group it with other changes by prefixing the bump with `:<tag>`, for example:
```md
---
'package-a': 'patch:enhance'
---
Change summary goes here
```
which will group this change file with other changes that specify the `bug` tag.
For list of available tags, see the `changeTags` key in [./config.json](./config.json)
# Changes
##### via https://github.com/jbolda/covector
As you create PRs and make changes that require a version bump, please add a new markdown file in this folder. You do not note the version _number_, but rather the type of bump that you expect: major, minor, or patch. The filename is not important, as long as it is a `.md`, but we recommend that it represents the overall change for organizational purposes.
When you select the version bump required, you do _not_ need to consider dependencies. Only note the package with the actual change, and any packages that depend on that package will be bumped automatically in the process.
Use the following format:
```md
---
"package-a": patch
"package-b": patch
---
Change summary goes here
```
Summaries do not have a specific character limit, but are text only. These summaries are used within the (future implementation of) changelogs. They will give context to the change and also point back to the original PR if more details and context are needed.
Changes will be designated as a `major`, `minor` or `patch` as further described in [semver](https://semver.org/).
Given a version number MAJOR.MINOR.PATCH, increment the:
- MAJOR version when you make incompatible API changes,
- MINOR version when you add functionality in a backwards compatible manner, and
- PATCH version when you make backwards compatible bug fixes.
Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format, but will be discussed prior to usage (as extra steps will be necessary in consideration of merging and publishing).

View File

@@ -0,0 +1,5 @@
---
"tauri-runtime": minor
---
Added `navigation_handler` field on `PendingWindow`.

View File

@@ -0,0 +1,5 @@
---
"tauri-build": "minor"
---
Add `WindowsAttributes::app_manifest` to specify the application manifest on Windows.

8
.changes/title-getter.md Normal file
View File

@@ -0,0 +1,8 @@
---
"tauri": "minor"
"api": "minor"
"tauri-runtime": "minor"
"tauri-runtime-wry": "minor"
---
Add `title` getter on window.

View File

@@ -0,0 +1,6 @@
---
"tauri-runtime": minor
"tauri-runtime-wry": minor
---
Added `TrayHandle::set_tooltip` and `SystemTray::with_tooltip`.

5
.changes/tray-tooltip.md Normal file
View File

@@ -0,0 +1,5 @@
---
"tauri": patch
---
Implement `SystemTray::with_tooltip` and `SystemTrayHandle::set_tooltip` for Windows and macOS.

7
.changes/url-getter.md Normal file
View File

@@ -0,0 +1,7 @@
---
"tauri-runtime": minor
"tauri-runtime-wry": minor
"tauri": minor
---
Added window's `url()` getter.

View File

@@ -0,0 +1,5 @@
---
'cli.rs': 'minor'
---
Add support for Cargo's workspace inheritance for the package version.

View File

@@ -0,0 +1,7 @@
---
"tauri": "patch"
"tauri-runtime": "patch"
"tauri-runtime-wry": "patch"
---
On Windows, change webview theme based on Window theme for more accurate `prefers-color-scheme` support.

View File

@@ -0,0 +1,6 @@
---
"tauri-bundler": "patch"
---
On Windows, the `msi` installer's `Launch App` checkbox will be checked by default.

View File

@@ -0,0 +1,5 @@
---
"tauri-runtime-wry": minor
---
Implement the webview navigation handler.

View File

@@ -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

View File

@@ -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"
```

View File

@@ -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

View File

@@ -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

View File

@@ -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, dont 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.
@@ -33,77 +33,58 @@ Hi! We, the maintainers, are really excited that you are interested in contribut
- It's OK to have multiple small commits as you work on the PR - we will let GitHub automatically squash it before merging.
- If adding new feature:
- 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
```
- The JS API (`/tooling/api`) contains JS bindings to the builtin Rust functions in the Rust API.
- cli.rs (`/tooling/cli`) is the primary CLI for creating and developing Tauri apps.
- cli.js (`/tooling/cli/node`) is a Node.js CLI wrapper for `cli.rs`.
- Tauri Bundler (`/tooling/bundler`) is used by the Rust CLI to package executables into installers.
- 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.
### Overview
### Developing The Node.js CLI (cli.js)
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.
`cli.js` is a wrapper to `cli.rs` 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 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 cli.js (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`)
### Developing Tauri Core and Related Components (Rust API, Macros, Codegen, and Utils)
[`@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).
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.

6
.github/FUNDING.yml vendored
View File

@@ -1,10 +1,6 @@
# Copyright 2019-2024 Tauri Programme within The Commons Conservancy
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
# These are supported funding model platforms
github: tauri-apps
github: nothingismagick
patreon: #
open_collective: tauri
ko_fi: # Replace with a single Ko-fi username

View File

@@ -1,7 +1,3 @@
# Copyright 2019-2024 Tauri Programme within The Commons Conservancy
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
name: 🐞 Bug Report
title: '[bug] '
description: Report a bug
@@ -30,10 +26,11 @@ body:
id: reproduction
attributes:
label: Reproduction
description: A link to a reproduction repo or steps to reproduce the behaviour.
description: Steps to reproduce the behavior.
placeholder: |
Please provide a minimal reproduction or steps to reproduce, see this guide https://stackoverflow.com/help/minimal-reproducible-example
Why reproduction is required? see this article https://antfu.me/posts/why-reproductions-are-required
1. Go to ...
2. Click on ...
3. See error
- type: textarea
id: expected-behavior
@@ -44,9 +41,8 @@ body:
- type: textarea
id: info
attributes:
label: Full `tauri info` output
description: 'Output of `npm run tauri info` or `cargo tauri info`'
render: text
label: Platform and versions
description: "Output of `npm run tauri info` or `cargo tauri info`"
validations:
required: true
@@ -54,8 +50,8 @@ body:
id: logs
attributes:
label: Stack trace
render: text
render: shell
- type: textarea
id: context
attributes:

View File

@@ -1,7 +1,3 @@
# Copyright 2019-2024 Tauri Programme within The Commons Conservancy
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
contact_links:
- name: 💬 Discord Chat
url: https://discord.com/invite/tauri

View File

@@ -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: ''
---

View File

@@ -1,11 +1,7 @@
# Copyright 2019-2024 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 +18,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 +27,7 @@ body:
attributes:
label: Alternatives considered
description: "Any alternative solutions you've considered"
- type: textarea
id: context
attributes:

View File

@@ -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
View File

@@ -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.

View File

@@ -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

107
.github/workflows/artifacts-updater.yml vendored Normal file
View File

@@ -0,0 +1,107 @@
# Copyright 2019-2022 Tauri Programme within The Commons Conservancy
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
name: updater test artifacts
on:
schedule:
- cron: '0 0 * * *'
pull_request:
paths:
- '.github/workflows/artifacts-updater.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:
build-artifacts:
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 cli.rs
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.*

View File

@@ -1,4 +1,4 @@
# Copyright 2019-2024 Tauri Programme within The Commons Conservancy
# Copyright 2019-2022 Tauri Programme within The Commons Conservancy
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
@@ -10,11 +10,10 @@ on:
- cron: '0 0 * * *'
push:
paths:
- '.github/workflows/audit.yml'
- '**/Cargo.lock'
- '**/Cargo.toml'
- '**/package.json'
- '**/pnpm-lock.yaml'
- '**/yarn.lock'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
@@ -24,18 +23,16 @@ 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: yarn audit
working-directory: tooling/cli/node
run: yarn audit

View File

@@ -1,23 +1,16 @@
# Copyright 2019-2024 Tauri Programme within The Commons Conservancy
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
name: bench
name: benches
on:
push:
branches:
- dev
- next
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 }}
@@ -35,17 +28,18 @@ jobs:
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 +48,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 +75,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"

View File

@@ -1,4 +1,4 @@
# Copyright 2019-2024 Tauri Programme within The Commons Conservancy
# Copyright 2019-2022 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

View File

@@ -1,44 +0,0 @@
# Copyright 2019-2024 Tauri Programme within The Commons Conservancy
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
name: check change tags
on:
pull_request:
paths:
- '.changes/*.md'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- 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
id: filter
with:
list-files: shell
filters: |
changes:
- added|modified: '.changes/*.md'
- name: check
run: node ./.scripts/ci/check-change-tags.js ${{ steps.filter.outputs.changes_files }}
if: ${{ steps.filter.outputs.changes == 'true' }}

View File

@@ -1,19 +1,26 @@
# Copyright 2019-2024 Tauri Programme within The Commons Conservancy
# Copyright 2019-2022 Tauri Programme within The Commons Conservancy
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
name: check generated files
name: Check generated files
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/config-schema/schema.json'
push:
paths:
- '.github/workflows/check-generated-files.yml'
- 'tooling/api/src/**'
- 'core/tauri/scripts/bundle.global.js'
- 'core/tauri-utils/src/config.rs'
- 'tooling/cli/schema.json'
- 'core/config-schema/schema.json'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
@@ -23,52 +30,47 @@ jobs:
changes:
runs-on: ubuntu-latest
outputs:
api: ${{ steps.filter.outputs.api }}
bundle: ${{ steps.filter.outputs.bundle }}
schema: ${{ steps.filter.outputs.schema }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
- uses: actions/checkout@v2
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
api:
- 'pnpm-lock.yaml'
- 'packages/api/src/**'
- 'crates/tauri/scripts/bundle.global.js'
bundle:
- '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/config-schema/schema.json'
api:
check-bundle:
runs-on: ubuntu-latest
needs: changes
if: needs.changes.outputs.api == 'true'
if: needs.changes.outputs.bundle == '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@v2
- name: install deps
run: pnpm i --frozen-lockfile
- name: build api
run: pnpm build
working-directory: packages/api
- name: check api
- name: generate bundle
working-directory: tooling/api
run: yarn && yarn build
- name: check bundle
run: ./.scripts/ci/has-diff.sh
schema:
check-schema:
runs-on: ubuntu-latest
needs: changes
if: needs.changes.outputs.schema == 'true'
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v2
- 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 +78,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/config-schema/Cargo.toml
- name: check schemas
- name: check schema
run: ./.scripts/ci/has-diff.sh

View File

@@ -1,28 +0,0 @@
# Copyright 2019-2024 Tauri Programme within The Commons Conservancy
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
name: check license headers
on:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
list-files: shell
filters: |
added:
- added: '**'
- name: check header license on new files
if: ${{ steps.filter.outputs.added == 'true' }}
run: node ./.scripts/ci/check-license-header.js ${{ steps.filter.outputs.added_files }}

View File

@@ -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'

View File

@@ -1,8 +1,8 @@
# Copyright 2019-2024 Tauri Programme within The Commons Conservancy
# Copyright 2019-2022 Tauri Programme within The Commons Conservancy
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
name: covector version or publish
name: version or publish
on:
push:
@@ -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,30 +104,34 @@ 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
event-type: update-docs
- name: Trigger `@tauri-apps/cli` publishing workflow
- name: Trigger cli.js publishing workflow
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 }}
contains(steps.covector.outputs.packagesPublished, 'cli.rs')
uses: peter-evans/repository-dispatch@v1
with:
token: ${{ secrets.ORG_TAURI_BOT_PAT }}
repository: tauri-apps/tauri
event-type: publish-clijs
client-payload: '{"releaseId": "${{ steps.covector.outputs.cli.js-releaseId }}" }'
- name: Trigger `tauri-cli` publishing workflow
- name: Trigger cli.rs 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 }}
contains(steps.covector.outputs.packagesPublished, 'cli.rs')
uses: peter-evans/repository-dispatch@v1
with:
token: ${{ secrets.ORG_TAURI_BOT_PAT }}
repository: tauri-apps/tauri
event-type: publish-clirs

View File

@@ -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 }}

View File

@@ -1,7 +1,3 @@
# Copyright 2019-2024 Tauri Programme within The Commons Conservancy
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
name: docker
on:
@@ -17,10 +13,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 +29,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 +60,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 +111,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

View File

@@ -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-fmt-cli.yml vendored Normal file
View File

@@ -0,0 +1,70 @@
# Copyright 2019-2022 Tauri Programme within The Commons Conservancy
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
name: cli clippy and fmt check
on:
push:
branches:
- dev
- next
pull_request:
paths:
- '.github/workflows/lint-fmt-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_check:
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
cli_clippy_check:
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-fmt-core.yml vendored Normal file
View File

@@ -0,0 +1,83 @@
# Copyright 2019-2022 Tauri Programme within The Commons Conservancy
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
name: core clippy and fmt check
on:
push:
branches:
- dev
- next
pull_request:
paths:
- '.github/workflows/lint-fmt-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_check:
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
core_clippy_check:
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',
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 }}

View File

@@ -1,40 +1,47 @@
# Copyright 2019-2024 Tauri Programme within The Commons Conservancy
# Copyright 2019-2022 Tauri Programme within The Commons Conservancy
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
name: lint js
name: api and cli.js lint check
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-check:
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/*/yarn.lock
- name: install cli.js deps via yarn
working-directory: ./tooling/cli/node/
run: yarn
# nothing to lint
#- name: run cli.js lint
# working-directory: ./tooling/cli/node/
# run: yarn lint
- name: run cli.js format
working-directory: ./tooling/cli/node/
run: yarn format:check
typescript:
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 ts:check
- name: install api deps via yarn
working-directory: ./tooling/api/
run: yarn
- name: run api lint
working-directory: ./tooling/api/
run: yarn lint
- name: run api format
working-directory: ./tooling/api/
run: yarn format:check

View File

@@ -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

View File

@@ -1,8 +1,4 @@
# Copyright 2019-2024 Tauri Programme within The Commons Conservancy
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
name: publish `@tauri-apps/cli`
name: publish cli.js
env:
DEBUG: napi:*
APP_NAME: cli
@@ -11,14 +7,14 @@ on:
workflow_dispatch:
inputs:
releaseId:
description: 'ID of the `@tauri-apps/cli` release'
description: 'ID of the cli.js release'
required: true
repository_dispatch:
types: [publish-js-cli]
types: [publish-clijs]
defaults:
run:
working-directory: packages/cli/
working-directory: tooling/cli/node/
jobs:
build:
@@ -30,102 +26,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
- host: ubuntu-18.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-18.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-18.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-18.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-18.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
#- host: windows-latest
# architecture: x64
# target: aarch64-pc-windows-msvc
# build: yarn build:release --target aarch64-pc-windows-msvc
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 +131,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 +156,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 +164,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 +173,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 +194,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 +231,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 +268,44 @@ 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: Install system dependencies
run: |
apk add openssl-dev musl-dev glib-dev cairo-dev pkgconfig gdk-pixbuf-dev webkit2gtk-dev curl libappindicator-dev gtk+3.0-dev
- name: Setup and run tests
run: |
pnpm tauri --help
yarn tauri --help
ls -la
# TODO: fix this test: https://github.com/tauri-apps/tauri/runs/5145729140?check_suite_focus=true#step:9:704
#- 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 }}

View File

@@ -1,8 +1,4 @@
# Copyright 2019-2024 Tauri Programme within The Commons Conservancy
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
name: publish `tauri-cli`
name: publish cli.rs
env:
MACOSX_DEPLOYMENT_TARGET: '10.13'
on:
@@ -12,59 +8,50 @@ on:
jobs:
build:
runs-on: ${{ matrix.config.os }}
runs-on: ${{ matrix.target.platform }}
strategy:
fail-fast: false
matrix:
config:
- os: ubuntu-22.04
rust_target: x86_64-unknown-linux-gnu
ext: ''
args: ''
- os: macos-latest
rust_target: x86_64-apple-darwin
ext: ''
args: ''
- os: macos-latest
rust_target: aarch64-apple-darwin
ext: ''
args: ''
- os: windows-latest
rust_target: x86_64-pc-windows-msvc
ext: '.exe'
args: ''
- os: windows-latest
rust_target: aarch64-pc-windows-msvc
ext: '.exe'
args: ''
target:
- {
name: 'x86_64-unknown-linux-gnu',
platform: 'ubuntu-18.04',
ext: ''
}
- { name: 'x86_64-apple-darwin', platform: 'macos-latest', ext: '' }
- {
name: 'x86_64-pc-windows-msvc',
platform: 'windows-latest',
ext: '.exe'
}
steps:
- uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v3
- name: 'Setup Rust'
uses: dtolnay/rust-toolchain@stable
- name: install stable
uses: actions-rs/toolchain@v1
with:
targets: ${{ matrix.config.rust_target }}
- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.config.rust_target }}
toolchain: stable
- name: install Linux dependencies
if: matrix.config.os == 'ubuntu-latest'
if: matrix.target.platform == 'ubuntu-latest'
run: |
sudo apt-get update
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 }}
- name: build CLI
uses: actions-rs/cargo@v1
with:
command: build
args: --manifest-path ./tooling/cli/Cargo.toml --release
- 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 }}
name: cargo-tauri-${{ matrix.target.name }}${{ matrix.target.ext }}
path: tooling/cli/target/release/cargo-tauri${{ matrix.target.ext }}
if-no-files-found: error
upload:
@@ -73,10 +60,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,12 +71,12 @@ 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
with:
tag_name: tauri-cli-v${{ env.CLI_VERSION }}
tag_name: cli.rs-v${{ env.CLI_VERSION }}
files: |
outputs/cargo-tauri-*.zip
outputs/cargo-tauri-*.tgz

View File

@@ -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

View File

@@ -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 }}

93
.github/workflows/test-bundler.yml vendored Normal file
View File

@@ -0,0 +1,93 @@
# Copyright 2019-2022 Tauri Programme within The Commons Conservancy
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
name: test bundler
on:
push:
branches:
- dev
- next
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:
build-tauri-bundler:
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_check:
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-check:
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

View File

@@ -1,19 +1,19 @@
# Copyright 2019-2024 Tauri Programme within The Commons Conservancy
# Copyright 2019-2022 Tauri Programme within The Commons Conservancy
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
name: test `@tauri-apps/cli`
name: test cli.js
on:
push:
branches:
- dev
- next
pull_request:
paths:
- '.github/workflows/test-cli-js.yml'
- 'packages/cli/**'
# currently` @tauri-apps/cli` only tests the template
- 'crates/tauri-cli/templates/app/**'
# currently cli.js only tests the template
- 'tooling/cli/templates/app/**'
env:
RUST_BACKTRACE: 1
@@ -24,7 +24,7 @@ concurrency:
cancel-in-progress: true
jobs:
test:
test-tauri-js-cli:
runs-on: ${{ matrix.platform }}
strategy:
@@ -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

View File

@@ -1,19 +1,18 @@
# Copyright 2019-2024 Tauri Programme within The Commons Conservancy
# Copyright 2019-2022 Tauri Programme within The Commons Conservancy
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
name: test `tauri-cli`
name: test cli.rs
on:
push:
branches:
- dev
- next
pull_request:
paths:
- '.github/workflows/test-cli-rs.yml'
- 'crates/tauri-utils/**'
- 'crates/tauri-bundler/**'
- 'crates/tauri-cli/**'
- 'tooling/cli/**'
env:
RUST_BACKTRACE: 1
@@ -24,37 +23,35 @@ concurrency:
cancel-in-progress: true
jobs:
test:
runs-on: ${{ matrix.platform.os }}
test-tauri-cli:
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 }}
- name: build CLI
uses: actions-rs/cargo@v1
with:
command: build
args: --manifest-path ./tooling/cli/Cargo.toml

View File

@@ -1,4 +1,4 @@
# Copyright 2019-2024 Tauri Programme within The Commons Conservancy
# Copyright 2019-2022 Tauri Programme within The Commons Conservancy
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
@@ -8,15 +8,12 @@ on:
push:
branches:
- dev
- next
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
@@ -27,7 +24,7 @@ concurrency:
cancel-in-progress: true
jobs:
test:
test-tauri-core:
runs-on: ${{ matrix.platform.os }}
strategy:
@@ -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.59.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.59.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 compression,wry,linux-protocol-headers,isolation,custom-protocol,api-all,cli,updater,system-tray,windows7-compat,http-multipart,
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 }}

View File

@@ -1,4 +1,4 @@
# Copyright 2019-2024 Tauri Programme within The Commons Conservancy
# Copyright 2019-2022 Tauri Programme within The Commons Conservancy
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
@@ -8,6 +8,7 @@ on:
push:
branches:
- dev
- next
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
View File

@@ -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
/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
View File

@@ -0,0 +1 @@
_

24
.husky/pre-commit Executable file
View File

@@ -0,0 +1,24 @@
#!/bin/sh
# Copyright 2019-2022 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 cli.js - no changes detected"
else
cd tooling/cli/node
yarn format
cd ../../..
fi

View File

@@ -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/config-schema/schema.json

View File

@@ -1,6 +0,0 @@
{
"singleQuote": true,
"semi": false,
"trailingComma": "none",
"experimentalOperatorPosition": "start"
}

5
.prettierrc.js Normal file
View File

@@ -0,0 +1,5 @@
module.exports = {
singleQuote: true,
semi: false,
trailingComma: 'none'
}

54
.scripts/cargo-check.ps1 Executable file
View File

@@ -0,0 +1,54 @@
#!/usr/bin/env pwsh
# Copyright 2019-2022 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
}
}
}

44
.scripts/cargo-check.sh Executable file
View File

@@ -0,0 +1,44 @@
#!/usr/bin/env sh
# Copyright 2019-2022 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

View File

@@ -1,81 +0,0 @@
#!/usr/bin/env node
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
const fs = require('fs')
const path = require('path')
const ignorePackages = [
'tauri-macros',
'tauri-codegen',
'tauri-runtime',
'tauri-runtime-wry',
'tauri-driver'
]
const covectorConfig = JSON.parse(
fs.readFileSync('.changes/config.json', 'utf8')
)
const tags = Object.keys(covectorConfig.changeTags)
const missingTagsFiles = {}
const unknownTagsFiles = {}
function checkChangeFiles(changeFiles) {
for (const file of changeFiles) {
const content = fs.readFileSync(file, 'utf8')
const [frontMatter] = /^---[\s\S.]*---\n/i.exec(content)
const packages = frontMatter
.split('\n')
.filter((l) => !(l === '---' || !l))
.map((l) => l.replace(/('|")/g, '').split(':'))
for (const [package, _, tag] of packages) {
if (!tag) {
if (ignorePackages.includes(package)) continue
if (!missingTagsFiles[file]) missingTagsFiles[file] = []
missingTagsFiles[file].push(package)
} else if (!tags.includes(tag)) {
if (!unknownTagsFiles[file]) unknownTagsFiles[file] = []
unknownTagsFiles[file].push({ package, tag })
}
}
}
const missingTagsEntries = Object.entries(missingTagsFiles)
const unknownTagsEntries = Object.entries(unknownTagsFiles)
if (missingTagsEntries.length > 0 || unknownTagsEntries.length > 0) {
for (const [file, packages] of missingTagsEntries) {
for (const package of packages) {
console.error(
`Package \`${package}\` is missing a change tag in ${file} `
)
}
}
for (const [file, packages] of unknownTagsEntries) {
for (const { package, tag } of packages) {
console.error(
`Package \`${package}\` has an unknown change tag ${tag} in ${file} `
)
}
}
process.exit(1)
}
}
const [_bin, _script, ...files] = process.argv
if (files.length > 0) {
checkChangeFiles(
files.filter((f) => f.toLowerCase() !== '.changes/readme.md')
)
} else {
const changeFiles = fs
.readdirSync('.changes')
.filter((f) => f.endsWith('.md') && f.toLowerCase() !== 'readme.md')
.map((p) => path.join('.changes', p))
checkChangeFiles(changeFiles)
}

View File

@@ -1,123 +0,0 @@
#!/usr/bin/env node
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
const fs = require('fs')
const path = require('path')
const readline = require('readline')
const header = `Copyright 2019-2024 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 ignore = [
'target',
'templates',
'node_modules',
'gen',
'dist',
'bundle.global.js'
]
async function checkFile(file) {
if (
extensions.some((e) => file.endsWith(e))
&& !ignore.some((i) => file.includes(`/${i}/`) || path.basename(file) === i)
) {
const fileStream = fs.createReadStream(file)
const rl = readline.createInterface({
input: fileStream,
crlfDelay: Infinity
})
let contents = ``
let i = 0
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
) {
continue
}
// strip comment marker
if (line.startsWith('// ')) {
line = line.substring(3)
} else if (line.startsWith('# ')) {
line = line.substring(2)
}
contents += line
if (++i === 3) {
break
}
contents += '\n'
}
if (contents !== header) {
return true
}
}
return false
}
async function check(src) {
const missingHeader = []
for (const entry of fs.readdirSync(src, { withFileTypes: true })) {
const p = path.join(src, entry.name)
if (entry.isSymbolicLink() || ignore.includes(entry.name)) {
continue
}
if (entry.isDirectory()) {
const missing = await check(p)
missingHeader.push(...missing)
} else {
const isMissing = await checkFile(p)
if (isMissing) {
missingHeader.push(p)
}
}
}
return missingHeader
}
const [_bin, _script, ...files] = process.argv
if (files.length > 0) {
async function run() {
const missing = []
for (const f of files) {
const isMissing = await checkFile(f)
if (isMissing) {
missing.push(f)
}
}
if (missing.length > 0) {
console.log(missing.join('\n'))
process.exit(1)
}
}
run()
} else {
check('.').then((missing) => {
if (missing.length > 0) {
console.log(missing.join('\n'))
process.exit(1)
}
})
}

View File

@@ -1,15 +1,9 @@
#!/bin/bash
# Copyright 2019-2024 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

View File

@@ -1,16 +1,11 @@
#!/bin/bash
# Copyright 2019-2024 Tauri Programme within The Commons Conservancy
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
set -euxo pipefail
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

View File

@@ -0,0 +1,54 @@
#!/usr/bin/env node
// Copyright 2019-2022 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')
}
})
})

View File

@@ -1,27 +1,27 @@
#!/usr/bin/env node
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy
// Copyright 2019-2022 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
we should look to find a more "rusty way" to import / "pin" a version value in our tauri-cli
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 cli.rs
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 === 'cli.js'
? `../../../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 +30,6 @@ switch (bump) {
case 'patch':
index = 2
break
case 'prerelease':
case 'prepatch':
index = 3
break
default:
throw new Error('unexpected bump ' + bump)
}
@@ -47,12 +43,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('.')
}
@@ -61,14 +51,14 @@ const metadata = JSON.parse(readFileSync(filePath, 'utf-8'))
// set field version
let version
if (packageNickname === '@tauri-apps/cli') {
version = inc(metadata['cli.js'].version)
metadata['cli.js'].version = version
if (packageNickname === 'cli.js') {
version = inc(metadata[packageNickname].version)
metadata[packageNickname].version = version
} else {
version = inc(metadata[packageNickname])
metadata[packageNickname] = version
}
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)

3
.scripts/docker/build.sh Executable file
View File

@@ -0,0 +1,3 @@
#!/bin/sh
docker build -t aarch64-unknown-linux-gnu:latest --file .docker/cross/aarch64.Dockerfile .docker/cross

29
.scripts/setup.ps1 Normal file
View File

@@ -0,0 +1,29 @@
#!/usr/bin/env pwsh
# Copyright 2019-2022 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]'."
}
}

28
.scripts/setup.sh Executable file
View File

@@ -0,0 +1,28 @@
#!/usr/bin/env bash
# Copyright 2019-2022 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

23
.scripts/update-lockfiles.sh Executable file
View File

@@ -0,0 +1,23 @@
#!/usr/bin/env sh
# Copyright 2019-2022 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

View File

@@ -0,0 +1,62 @@
@ECHO OFF
REM Copyright 2019-2022 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

View File

@@ -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

View File

@@ -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"
]
}

View File

@@ -1,134 +1,108 @@
# 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]
#### [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]
#### [cli.js](https://github.com/tauri-apps/tauri/tree/dev/tooling/cli/node) [JS]
It is a wrapper around [cli.rs](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.
#### [cli.rs](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)
## [binary-releases](https://github.com/tauri-apps/binary-releases)
This is the delivery mechanism for tauri prebuilt binaries: currently the cli.rs (used by cli.js) and rustup binaries (used by the deps install command of cli.js). These artifacts are automatically created on release.
## [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,21 +110,16 @@ 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
4. keep a long-lived console alive
4. keep a long-lived console alive
If you change your HTML/CSS/TS/JS, your framework devserver should give you its best shot at instant hot module reloading and you will see the changes instantly.
@@ -159,9 +128,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 +139,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`).
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).

11363
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,49 +1,29 @@
[workspace]
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/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 +32,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" }

View File

@@ -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
View File

@@ -2,56 +2,126 @@
[![status](https://img.shields.io/badge/status-stable-blue.svg)](https://github.com/tauri-apps/tauri/tree/dev)
[![License](https://img.shields.io/badge/License-MIT%20or%20Apache%202-green.svg)](https://opencollective.com/tauri)
[![test core](https://img.shields.io/github/actions/workflow/status/tauri-apps/tauri/test-core.yml?label=test%20core&logo=github)](https://github.com/tauri-apps/tauri/actions/workflows/test-core.yml)
[![test library](https://img.shields.io/github/workflow/status/tauri-apps/tauri/test%20library?label=test%20library)](https://github.com/tauri-apps/tauri/actions?query=workflow%3A%22test+library%22)
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Ftauri-apps%2Ftauri.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Ftauri-apps%2Ftauri?ref=badge_shield)
[![Chat Server](https://img.shields.io/badge/chat-discord-7289da.svg)](https://discord.com/invite/tauri)
[![Chat Server](https://img.shields.io/badge/chat-discord-7289da.svg)](https://discord.gg/SpmNs4S)
[![website](https://img.shields.io/badge/website-tauri.app-purple.svg)](https://tauri.app)
[![https://good-labs.github.io/greater-good-affirmation/assets/images/badge.svg](https://good-labs.github.io/greater-good-affirmation/assets/images/badge.svg)](https://good-labs.github.io/greater-good-affirmation)
[![support](https://img.shields.io/badge/sponsor-Open%20Collective-blue.svg)](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://img.shields.io/crates/v/tauri.svg)](https://crates.io/crates/tauri) | ✅ | ✅ | ✅ |
| [**tauri-build**](https://github.com/tauri-apps/tauri/tree/dev/core/tauri-build) | applies macros at build-time | [![](https://img.shields.io/crates/v/tauri-build.svg)](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://img.shields.io/crates/v/tauri-codegen.svg)](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://img.shields.io/crates/v/tauri-macros.svg)](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://img.shields.io/crates/v/tauri-runtime.svg)](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://img.shields.io/crates/v/tauri-runtime-wry.svg)](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://img.shields.io/crates/v/tauri-utils.svg)](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://img.shields.io/crates/v/tauri-bundler.svg)](https://crates.io/crates/tauri-bundler) | ✅ | ✅ | ✅ |
| [**api.js**](https://github.com/tauri-apps/tauri/tree/dev/tooling/api) | JS API for interaction with Rust backend | [![](https://img.shields.io/npm/v/@tauri-apps/api.svg)](https://www.npmjs.com/package/@tauri-apps/api) | ✅ | ✅ | ✅ |
| [**cli.rs**](https://github.com/tauri-apps/tauri/tree/dev/tooling/cli) | create, develop and build apps | [![](https://img.shields.io/crates/v/tauri-cli.svg)](https://crates.io/crates/tauri-cli) | ✅ | ✅ | ✅ |
| [**cli.js**](https://github.com/tauri-apps/tauri/tree/dev/tooling/cli/node) | Node.js CLI wrapper for cli.rs | [![](https://img.shields.io/npm/v/@tauri-apps/cli.svg)](https://www.npmjs.com/package/@tauri-apps/cli) | ✅ | ✅ | ✅ |
### 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://img.shields.io/npm/v/create-tauri-app.svg)](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://img.shields.io/npm/v/vue-cli-plugin-tauri.svg)](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>
<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 +131,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.

Some files were not shown because too many files have changed in this diff Show More