mirror of
https://github.com/tauri-apps/tauri.git
synced 2026-04-11 10:43:31 +02:00
Compare commits
19 Commits
@tauri-app
...
1.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
68d4397b6c | ||
|
|
8799060663 | ||
|
|
d2bb02fe3d | ||
|
|
33bff7db92 | ||
|
|
f7ae62140f | ||
|
|
0d529c9497 | ||
|
|
daf21c7199 | ||
|
|
fa90214b05 | ||
|
|
34e03b8455 | ||
|
|
f0602e7c29 | ||
|
|
10dda1900e | ||
|
|
ceb6972ec2 | ||
|
|
264c087b5e | ||
|
|
bcd9dc7f85 | ||
|
|
e7af22c9d9 | ||
|
|
c89ed86dbd | ||
|
|
90e56c454c | ||
|
|
0bd3a90178 | ||
|
|
bb17882908 |
@@ -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",
|
||||
]
|
||||
@@ -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"
|
||||
@@ -1,44 +0,0 @@
|
||||
# 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)
|
||||
@@ -1,38 +1,31 @@
|
||||
{
|
||||
"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 libgtk-3-dev webkit2gtk-4.0 libayatana-appindicator3-dev librsvg2-dev patchelf",
|
||||
"cargo install cargo-audit --features=fix",
|
||||
{
|
||||
"command": "echo '<details>\n<summary><em><h4>Cargo Audit</h4></em></summary>\n\n```'",
|
||||
"dryRunCommand": true,
|
||||
"pipe": true
|
||||
},
|
||||
{
|
||||
"command": "cargo generate-lockfile",
|
||||
"dryRunCommand": true,
|
||||
"runFromRoot": true,
|
||||
"pipe": true
|
||||
},
|
||||
{
|
||||
"command": "echo \"# Cargo Audit\"",
|
||||
"dryRunCommand": true,
|
||||
"pipe": true
|
||||
},
|
||||
{
|
||||
"command": "echo '```'",
|
||||
"dryRunCommand": true,
|
||||
"pipe": true
|
||||
},
|
||||
{
|
||||
"command": "cargo audit ${ process.env.CARGO_AUDIT_OPTIONS || '' }",
|
||||
"dryRunCommand": true,
|
||||
@@ -40,14 +33,24 @@
|
||||
"pipe": true
|
||||
},
|
||||
{
|
||||
"command": "echo '```\n\n</details>\n'",
|
||||
"command": "echo '```'",
|
||||
"dryRunCommand": true,
|
||||
"pipe": true
|
||||
}
|
||||
],
|
||||
"publish": [
|
||||
"sleep 15s",
|
||||
{
|
||||
"command": "echo '<details>\n<summary><em><h4>Cargo Publish</h4></em></summary>\n\n```'",
|
||||
"command": "cargo package --no-verify",
|
||||
"dryRunCommand": true
|
||||
},
|
||||
{
|
||||
"command": "echo \"# Cargo Publish\"",
|
||||
"dryRunCommand": true,
|
||||
"pipe": true
|
||||
},
|
||||
{
|
||||
"command": "echo '```'",
|
||||
"dryRunCommand": true,
|
||||
"pipe": true
|
||||
},
|
||||
@@ -57,39 +60,43 @@
|
||||
"pipe": true
|
||||
},
|
||||
{
|
||||
"command": "echo '```\n\n</details>\n'",
|
||||
"command": "echo '```'",
|
||||
"dryRunCommand": true,
|
||||
"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 }.${ 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 \"# Yarn Audit\n\"",
|
||||
"dryRunCommand": true,
|
||||
"pipe": true
|
||||
},
|
||||
{
|
||||
"command": "pnpm i --frozen-lockfile",
|
||||
"dryRunCommand": true
|
||||
"command": "echo '<details>\n<summary>click to view</summary>\n\n```'",
|
||||
"dryRunCommand": true,
|
||||
"pipe": true
|
||||
},
|
||||
{
|
||||
"command": "pnpm audit",
|
||||
"command": "yarn audit",
|
||||
"dryRunCommand": true,
|
||||
"runFromRoot": true,
|
||||
"pipe": true
|
||||
@@ -98,132 +105,174 @@
|
||||
"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 \"# Yarn Package Publish\"",
|
||||
"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": "echo '```'",
|
||||
"dryRunCommand": true,
|
||||
"pipe": true
|
||||
},
|
||||
{
|
||||
"command": "echo '```\n\n</details>\n'",
|
||||
"command": "yarn publish --access public --loglevel silly",
|
||||
"dryRunCommand": "npm publish --dry-run --access public",
|
||||
"pipe": true
|
||||
},
|
||||
{
|
||||
"command": "echo '```'",
|
||||
"dryRunCommand": true,
|
||||
"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 }.${ 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 \"# Yarn Audit\n\"",
|
||||
"dryRunCommand": true,
|
||||
"pipe": true
|
||||
},
|
||||
{
|
||||
"command": "pnpm npm-publish",
|
||||
"command": "echo '<details>\n<summary>click to view</summary>\n\n```'",
|
||||
"dryRunCommand": true,
|
||||
"pipe": true
|
||||
},
|
||||
{
|
||||
"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 \"# Yarn Package Publish\"",
|
||||
"dryRunCommand": true,
|
||||
"pipe": true
|
||||
},
|
||||
{
|
||||
"command": "echo '```'",
|
||||
"dryRunCommand": true,
|
||||
"pipe": true
|
||||
},
|
||||
{
|
||||
"command": "yarn npm-publish",
|
||||
"dryRunCommand": true,
|
||||
"pipe": true
|
||||
},
|
||||
{
|
||||
"command": "echo '```'",
|
||||
"dryRunCommand": true,
|
||||
"pipe": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"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 }"
|
||||
},
|
||||
"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 }",
|
||||
"postversion": "node ../../../.scripts/covector/sync-cli-metadata.js ${ pkg.pkg } ${ release.type }",
|
||||
"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",
|
||||
"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"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.studio/v1/guides/getting-started/prerequisites/#setting-up-linux
|
||||
ARG TAURI_BUILD_DEPS="build-essential curl libappindicator3-dev libgtk-3-dev librsvg2-dev libssl-dev libwebkit2gtk-4.0-dev wget"
|
||||
|
||||
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
|
||||
&& apt-get install -y --no-install-recommends $TAURI_BUILD_DEPS
|
||||
|
||||
@@ -24,7 +24,7 @@ Prerequisites are mainly derived from VS Code's instructions for usage of develo
|
||||
|
||||
### A note on filesystem performance
|
||||
|
||||
Due to limitations in how Docker shares files between the Docker host and a container, it's also recommended that developers [clone Tauri source code into a container volume](https://code.visualstudio.com/remote/advancedcontainers/improve-performance#_use-clone-repository-in-container-volume). This is optional, but highly advised as many filesystem/IO heavy operations (`cargo build`, `pnpm install`, etc) will be very slow if they operate on directories shared with a Docker container from the Docker host.
|
||||
Due to limititations 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 opearations (`cargo build`, `yarn install`, etc) will be very slow if they operate on directories shared with a Docker container from the Docker host.
|
||||
|
||||
To do this, open your project with VS Code and run **Remote-Containers: Clone Repository in Container Volume...** from the Command Palette (<kbd>F1</kbd>).
|
||||
|
||||
@@ -33,7 +33,6 @@ To do this, open your project with VS Code and run **Remote-Containers: Clone Re
|
||||
Docker Desktop provides facilities for [allowing the development container to connect to a service on the Docker host](https://docs.docker.com/desktop/windows/networking/#i-want-to-connect-from-a-container-to-a-service-on-the-host). So long as you have an X window server running on your Docker host, the devcontainer can connect to it and expose your Tauri GUI via an X window.
|
||||
|
||||
**Export the `DISPLAY` variable within the devcontainer terminal you launch your Tauri application from to expose your GUI outside of the devcontainer**.
|
||||
|
||||
```bash
|
||||
export DISPLAY="host.docker.internal:0"
|
||||
```
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
FROM ubuntu:22.04
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
COPY common.sh lib.sh /
|
||||
RUN /common.sh
|
||||
|
||||
COPY cmake.sh /
|
||||
RUN /cmake.sh
|
||||
|
||||
COPY xargo.sh /
|
||||
RUN /xargo.sh
|
||||
|
||||
RUN apt-get update && apt-get install --assume-yes --no-install-recommends \
|
||||
g++-aarch64-linux-gnu \
|
||||
libc6-dev-arm64-cross
|
||||
|
||||
COPY deny-debian-packages.sh /
|
||||
RUN TARGET_ARCH=arm64 /deny-debian-packages.sh \
|
||||
binutils \
|
||||
binutils-aarch64-linux-gnu
|
||||
|
||||
COPY qemu.sh /
|
||||
RUN /qemu.sh aarch64 softmmu
|
||||
|
||||
COPY dropbear.sh /
|
||||
RUN /dropbear.sh
|
||||
|
||||
COPY linux-image.sh /
|
||||
RUN /linux-image.sh aarch64
|
||||
|
||||
COPY linux-runner /
|
||||
|
||||
ENV CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc \
|
||||
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_RUNNER="/linux-runner aarch64" \
|
||||
CC_aarch64_unknown_linux_gnu=aarch64-linux-gnu-gcc \
|
||||
CXX_aarch64_unknown_linux_gnu=aarch64-linux-gnu-g++ \
|
||||
BINDGEN_EXTRA_CLANG_ARGS_aarch64_unknown_linux_gnu="--sysroot=/usr/aarch64-linux-gnu" \
|
||||
QEMU_LD_PREFIX=/usr/aarch64-linux-gnu \
|
||||
RUST_TEST_THREADS=1 \
|
||||
PKG_CONFIG_PATH="/usr/lib/aarch64-linux-gnu/pkgconfig/:${PKG_CONFIG_PATH}"
|
||||
|
||||
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
|
||||
@@ -1,31 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -x
|
||||
set -euo pipefail
|
||||
|
||||
# shellcheck disable=SC1091
|
||||
. lib.sh
|
||||
|
||||
main() {
|
||||
local version=3.23.1
|
||||
|
||||
install_packages curl
|
||||
|
||||
local td
|
||||
td="$(mktemp -d)"
|
||||
|
||||
pushd "${td}"
|
||||
|
||||
curl --retry 3 -sSfL "https://github.com/Kitware/CMake/releases/download/v${version}/cmake-${version}-linux-x86_64.sh" -o cmake.sh
|
||||
sh cmake.sh --skip-license --prefix=/usr/local
|
||||
|
||||
popd
|
||||
|
||||
purge_packages
|
||||
|
||||
rm -rf "${td}"
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
rm "${0}"
|
||||
}
|
||||
|
||||
main "${@}"
|
||||
@@ -1,40 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -x
|
||||
set -euo pipefail
|
||||
|
||||
# shellcheck disable=SC1091
|
||||
. lib.sh
|
||||
|
||||
# For architectures except amd64 and i386, look for packages on ports.ubuntu.com instead.
|
||||
# This is important if you enable additional architectures so you can install libraries to cross-compile against.
|
||||
# Look for 'dpkg --add-architecture' in the README for more details.
|
||||
if grep -i ubuntu /etc/os-release >/dev/null; then
|
||||
sed 's/http:\/\/\(.*\).ubuntu.com\/ubuntu\//[arch-=amd64,i386] http:\/\/ports.ubuntu.com\/ubuntu-ports\//g' /etc/apt/sources.list > /etc/apt/sources.list.d/ports.list
|
||||
sed -i 's/http:\/\/\(.*\).ubuntu.com\/ubuntu\//[arch=amd64,i386] http:\/\/\1.archive.ubuntu.com\/ubuntu\//g' /etc/apt/sources.list
|
||||
fi
|
||||
|
||||
install_packages \
|
||||
autoconf \
|
||||
automake \
|
||||
binutils \
|
||||
ca-certificates \
|
||||
curl \
|
||||
file \
|
||||
gcc \
|
||||
git \
|
||||
libtool \
|
||||
m4 \
|
||||
make
|
||||
|
||||
if_centos install_packages \
|
||||
clang-devel \
|
||||
gcc-c++ \
|
||||
glibc-devel \
|
||||
pkgconfig
|
||||
|
||||
if_ubuntu install_packages \
|
||||
g++ \
|
||||
libc6-dev \
|
||||
libclang-dev \
|
||||
pkg-config
|
||||
@@ -1,19 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -x
|
||||
set -euo pipefail
|
||||
|
||||
main() {
|
||||
local package
|
||||
|
||||
for package in "${@}"; do
|
||||
echo "Package: ${package}:${TARGET_ARCH}
|
||||
Pin: release *
|
||||
Pin-Priority: -1" > "/etc/apt/preferences.d/${package}"
|
||||
echo "${package}"
|
||||
done
|
||||
|
||||
rm "${0}"
|
||||
}
|
||||
|
||||
main "${@}"
|
||||
@@ -1,56 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -x
|
||||
set -euo pipefail
|
||||
|
||||
# shellcheck disable=SC1091
|
||||
. lib.sh
|
||||
|
||||
main() {
|
||||
local version=2022.82
|
||||
|
||||
install_packages \
|
||||
autoconf \
|
||||
automake \
|
||||
bzip2 \
|
||||
curl \
|
||||
make
|
||||
|
||||
if_centos install_packages zlib-devel
|
||||
if_ubuntu install_packages zlib1g-dev
|
||||
|
||||
local td
|
||||
td="$(mktemp -d)"
|
||||
|
||||
pushd "${td}"
|
||||
|
||||
curl --retry 3 -sSfL "https://matt.ucc.asn.au/dropbear/releases/dropbear-${version}.tar.bz2" -O
|
||||
tar --strip-components=1 -xjf "dropbear-${version}.tar.bz2"
|
||||
|
||||
# Remove some unwanted message
|
||||
sed -i '/skipping hostkey/d' cli-kex.c
|
||||
sed -i '/failed to identify current user/d' cli-runopts.c
|
||||
|
||||
./configure \
|
||||
--disable-syslog \
|
||||
--disable-shadow \
|
||||
--disable-lastlog \
|
||||
--disable-utmp \
|
||||
--disable-utmpx \
|
||||
--disable-wtmp \
|
||||
--disable-wtmpx \
|
||||
--disable-pututline \
|
||||
--disable-pututxline
|
||||
|
||||
make "-j$(nproc)" PROGRAMS=dbclient
|
||||
cp dbclient /usr/local/bin/
|
||||
|
||||
purge_packages
|
||||
|
||||
popd
|
||||
|
||||
rm -rf "${td}"
|
||||
rm "${0}"
|
||||
}
|
||||
|
||||
main "${@}"
|
||||
@@ -1,45 +0,0 @@
|
||||
purge_list=()
|
||||
|
||||
install_packages() {
|
||||
if grep -i ubuntu /etc/os-release; then
|
||||
apt-get update
|
||||
|
||||
for pkg in "${@}"; do
|
||||
if ! dpkg -L "${pkg}" >/dev/null 2>/dev/null; then
|
||||
apt-get install --assume-yes --no-install-recommends "${pkg}"
|
||||
|
||||
purge_list+=( "${pkg}" )
|
||||
fi
|
||||
done
|
||||
else
|
||||
for pkg in "${@}"; do
|
||||
if ! yum list installed "${pkg}" >/dev/null 2>/dev/null; then
|
||||
yum install -y "${pkg}"
|
||||
|
||||
purge_list+=( "${pkg}" )
|
||||
fi
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
purge_packages() {
|
||||
if (( ${#purge_list[@]} )); then
|
||||
if grep -i ubuntu /etc/os-release; then
|
||||
apt-get purge --assume-yes --auto-remove "${purge_list[@]}"
|
||||
else
|
||||
yum remove -y "${purge_list[@]}"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
if_centos() {
|
||||
if grep -q -i centos /etc/os-release; then
|
||||
eval "${@}"
|
||||
fi
|
||||
}
|
||||
|
||||
if_ubuntu() {
|
||||
if grep -q -i ubuntu /etc/os-release; then
|
||||
eval "${@}"
|
||||
fi
|
||||
}
|
||||
@@ -1,274 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -x
|
||||
set -euo pipefail
|
||||
|
||||
# shellcheck disable=SC1091
|
||||
. lib.sh
|
||||
|
||||
main() {
|
||||
# arch in the rust target
|
||||
local arch="${1}" \
|
||||
kversion=4.19.0-20
|
||||
|
||||
local debsource="deb http://http.debian.net/debian/ buster main"
|
||||
debsource="${debsource}\ndeb http://security.debian.org/ buster/updates main"
|
||||
|
||||
local dropbear="dropbear-bin"
|
||||
|
||||
local -a deps
|
||||
local kernel=
|
||||
local libgcc="libgcc1"
|
||||
|
||||
# select debian arch and kernel version
|
||||
case "${arch}" in
|
||||
aarch64)
|
||||
arch=arm64
|
||||
kernel="${kversion}-arm64"
|
||||
;;
|
||||
armv7)
|
||||
arch=armhf
|
||||
kernel="${kversion}-armmp"
|
||||
;;
|
||||
i686)
|
||||
arch=i386
|
||||
kernel="${kversion}-686"
|
||||
;;
|
||||
mips|mipsel)
|
||||
kernel="${kversion}-4kc-malta"
|
||||
;;
|
||||
mips64el)
|
||||
kernel="${kversion}-5kc-malta"
|
||||
;;
|
||||
powerpc)
|
||||
# there is no buster powerpc port, so we use jessie
|
||||
# use a more recent kernel from backports
|
||||
kversion='4.9.0-0.bpo.6'
|
||||
kernel="${kversion}-powerpc"
|
||||
debsource="deb http://archive.debian.org/debian jessie main"
|
||||
debsource="${debsource}\ndeb http://archive.debian.org/debian jessie-backports main"
|
||||
debsource="${debsource}\ndeb http://ftp.ports.debian.org/debian-ports unstable main"
|
||||
debsource="${debsource}\ndeb http://ftp.ports.debian.org/debian-ports unreleased main"
|
||||
|
||||
# archive.debian.org Release files are expired.
|
||||
echo "Acquire::Check-Valid-Until false;" | tee -a /etc/apt/apt.conf.d/10-nocheckvalid
|
||||
echo "APT::Get::AllowUnauthenticated true;" | tee -a /etc/apt/apt.conf.d/10-nocheckvalid
|
||||
|
||||
dropbear="dropbear"
|
||||
deps=(libcrypt1:"${arch}")
|
||||
;;
|
||||
powerpc64)
|
||||
# there is no stable port
|
||||
arch=ppc64
|
||||
# https://packages.debian.org/en/sid/linux-image-powerpc64
|
||||
kversion='5.*'
|
||||
kernel="${kversion}-powerpc64"
|
||||
libgcc="libgcc-s1"
|
||||
debsource="deb http://ftp.ports.debian.org/debian-ports unstable main"
|
||||
debsource="${debsource}\ndeb http://ftp.ports.debian.org/debian-ports unreleased main"
|
||||
# sid version of dropbear requires these dependencies
|
||||
deps=(libcrypt1:"${arch}")
|
||||
;;
|
||||
powerpc64le)
|
||||
arch=ppc64el
|
||||
kernel="${kversion}-powerpc64le"
|
||||
;;
|
||||
s390x)
|
||||
arch=s390x
|
||||
kernel="${kversion}-s390x"
|
||||
;;
|
||||
sparc64)
|
||||
# there is no stable port
|
||||
# https://packages.debian.org/en/sid/linux-image-sparc64
|
||||
kernel='*-sparc64'
|
||||
libgcc="libgcc-s1"
|
||||
debsource="deb http://ftp.ports.debian.org/debian-ports unstable main"
|
||||
debsource="${debsource}\ndeb http://ftp.ports.debian.org/debian-ports unreleased main"
|
||||
# sid version of dropbear requires these dependencies
|
||||
deps=(libcrypt1:"${arch}")
|
||||
;;
|
||||
x86_64)
|
||||
arch=amd64
|
||||
kernel="${kversion}-amd64"
|
||||
;;
|
||||
*)
|
||||
echo "Invalid arch: ${arch}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
install_packages ca-certificates \
|
||||
curl \
|
||||
cpio \
|
||||
sharutils \
|
||||
gnupg
|
||||
|
||||
# Download packages
|
||||
mv /etc/apt/sources.list /etc/apt/sources.list.bak
|
||||
echo -e "${debsource}" > /etc/apt/sources.list
|
||||
|
||||
# Old ubuntu does not support --add-architecture, so we directly change multiarch file
|
||||
if [ -f /etc/dpkg/dpkg.cfg.d/multiarch ]; then
|
||||
cp /etc/dpkg/dpkg.cfg.d/multiarch /etc/dpkg/dpkg.cfg.d/multiarch.bak
|
||||
fi
|
||||
dpkg --add-architecture "${arch}" || echo "foreign-architecture ${arch}" > /etc/dpkg/dpkg.cfg.d/multiarch
|
||||
|
||||
# Add Debian keys.
|
||||
curl --retry 3 -sSfL 'https://ftp-master.debian.org/keys/archive-key-{7.0,8,9,10}.asc' -O
|
||||
curl --retry 3 -sSfL 'https://ftp-master.debian.org/keys/archive-key-{8,9,10}-security.asc' -O
|
||||
curl --retry 3 -sSfL 'https://ftp-master.debian.org/keys/release-{7,8,9,10}.asc' -O
|
||||
curl --retry 3 -sSfL 'https://www.ports.debian.org/archive_{2020,2021,2022}.key' -O
|
||||
|
||||
for key in *.asc *.key; do
|
||||
apt-key add "${key}"
|
||||
rm "${key}"
|
||||
done
|
||||
|
||||
# allow apt-get to retry downloads
|
||||
echo 'APT::Acquire::Retries "3";' > /etc/apt/apt.conf.d/80-retries
|
||||
|
||||
apt-get update
|
||||
|
||||
mkdir -p "/qemu/${arch}"
|
||||
chmod 777 /qemu "/qemu/${arch}"
|
||||
|
||||
cd "/qemu/${arch}"
|
||||
apt-get -d --no-install-recommends download \
|
||||
${deps[@]+"${deps[@]}"} \
|
||||
"busybox:${arch}" \
|
||||
"${dropbear}:${arch}" \
|
||||
"libtommath1:${arch}" \
|
||||
"libtomcrypt1:${arch}" \
|
||||
"libgmp10:${arch}" \
|
||||
"libc6:${arch}" \
|
||||
"${libgcc}:${arch}" \
|
||||
"libstdc++6:${arch}" \
|
||||
"linux-image-${kernel}:${arch}" \
|
||||
ncurses-base \
|
||||
"zlib1g:${arch}"
|
||||
cd /qemu
|
||||
|
||||
# Install packages
|
||||
root="root-${arch}"
|
||||
mkdir -p "${root}"/{bin,etc/dropbear,root,sys,dev,proc,sbin,tmp,usr/{bin,sbin},var/log}
|
||||
for deb in "${arch}"/*deb; do
|
||||
dpkg -x "${deb}" "${root}"/
|
||||
done
|
||||
|
||||
cp "${root}/boot/vmlinu"* kernel
|
||||
|
||||
# initrd
|
||||
mkdir -p "${root}/modules"
|
||||
cp -v \
|
||||
"${root}/lib/modules"/*/kernel/drivers/net/net_failover.ko \
|
||||
"${root}/lib/modules"/*/kernel/drivers/net/virtio_net.ko \
|
||||
"${root}/lib/modules"/*/kernel/drivers/virtio/* \
|
||||
"${root}/lib/modules"/*/kernel/fs/netfs/netfs.ko \
|
||||
"${root}/lib/modules"/*/kernel/fs/9p/9p.ko \
|
||||
"${root}/lib/modules"/*/kernel/fs/fscache/fscache.ko \
|
||||
"${root}/lib/modules"/*/kernel/net/9p/9pnet.ko \
|
||||
"${root}/lib/modules"/*/kernel/net/9p/9pnet_virtio.ko \
|
||||
"${root}/lib/modules"/*/kernel/net/core/failover.ko \
|
||||
"${root}/modules" || true # some file may not exist
|
||||
rm -rf "${root:?}/boot"
|
||||
rm -rf "${root:?}/lib/modules"
|
||||
|
||||
cat << 'EOF' > "${root}/etc/hosts"
|
||||
127.0.0.1 localhost qemu
|
||||
EOF
|
||||
|
||||
cat << 'EOF' > $root/etc/hostname
|
||||
qemu
|
||||
EOF
|
||||
|
||||
cat << 'EOF' > $root/etc/passwd
|
||||
root::0:0:root:/root:/bin/sh
|
||||
EOF
|
||||
|
||||
cat << 'EOF' | uudecode -o $root/etc/dropbear/dropbear_rsa_host_key
|
||||
begin 600 dropbear_rsa_host_key
|
||||
M````!W-S:"UR<V$````#`0`!```!`0"N!-<%K,3Z.!Z,OEMB2.N\O.$IWQ*F
|
||||
M#5%(_;(^2YKY_J_.RQW/7U@_MK&J#!Z0_\;EH#98ZW*E1\.<FF%P/*Y.W56-
|
||||
M31.'EJE`TN@=T5EC(8"Y%3'ZBYH)^WIVJ]S*G/_;#RH\_?S"U^1L_<<.F`O+
|
||||
MZVI?*]\KTDOT&QV0#B-M;"%_7:\>+3[X=QMH,B<HM$+0E[\B6*^!XKLR@V,K
|
||||
M)<V80HHK:_#;D]26XKN&CB./EZAC%4)78R!G""4HT@UK<5I4B^$/""`,?*\T
|
||||
M>*4$RYULV,V3X6]K:7@Q?80"#WXGGQZNFN6CZ7LTDX(F6J[\]F5<0`HEOF:Z
|
||||
MX;^53`L'4I/A```!``$L:$Z*#6<^3@+O%.[-#/5H+.C'3\#QQZN[1;J>L`8I
|
||||
MZ_&T'!"J'/Y+?R?55G:M^=]R*-&I3TOJYZA8@&H51ZOAF59'1_>>Z@?E4#)$
|
||||
MQU)X/RWH51ZB5KSDWJS:D'7GD(!?NAY`C'7\)I:_4)J")QBV/P"RJQGHG'%B
|
||||
M1BT2LE6676>`1K,0\NIMZTKQNB(IC+88<7#8%_-=P<&6<"9LH>60TSS?3?-C
|
||||
MN`T36YB/3^<(Q;`N1NT>I9EZS`BAC^-?.:,R\7EL"<4>7E=]^1]B\K9])AQU
|
||||
MBM\]M;4V(S(6KH-I.4[6>9E+@\UEM.J6:[2LUEEJDG:G:+:/EVF^Y75@(S$`
|
||||
M``"!`.O+KW=&*CBCHL"11&SVO4/K]$R-]7MV7,3RR)Q[X'0;6.?4JHW!3VR6
|
||||
M*FGBY--37ZD-+UV.8_+"$<?B"#&K$.[V)F7V2\UY!7(0FZ@A2`0ADDY*J-_B
|
||||
M4AU&.*GP#F/!I([:?E],.>6PH9)(/E.\G19#G0K`LRM?JWS!58&;D0C1````
|
||||
M@0"\[@NYWSTW(?Q@:_A*1Y3/AKYO5?S=0"<2>#V-AH6W-NCSDTSRP=2D79FS
|
||||
M"D?[;.)V>8'#9&I3"MU@+:2\Z%$0-MG0+J'(0>T1_C6?*C=4U0I$DI<=@D]1
|
||||
H_&DE8Y(OT%%EPG]!$H&5HX*),_D1A2\P=R.7G'`0L%YM-79Y"T">$0``
|
||||
`
|
||||
end
|
||||
EOF
|
||||
|
||||
# dropbear complains when this file is missing
|
||||
touch "${root}/var/log/lastlog"
|
||||
|
||||
cat << 'EOF' > $root/init
|
||||
#!/bin/busybox sh
|
||||
|
||||
set -e
|
||||
|
||||
/bin/busybox --install
|
||||
|
||||
mount -t devtmpfs devtmpfs /dev
|
||||
mount -t proc none /proc
|
||||
mount -t sysfs none /sys
|
||||
mkdir /dev/pts
|
||||
mount -t devpts none /dev/pts/
|
||||
|
||||
# some archs does not have virtio modules
|
||||
insmod /modules/failover.ko || true
|
||||
insmod /modules/net_failover.ko || true
|
||||
insmod /modules/virtio.ko || true
|
||||
insmod /modules/virtio_ring.ko || true
|
||||
insmod /modules/virtio_mmio.ko || true
|
||||
insmod /modules/virtio_pci_legacy_dev.ko || true
|
||||
insmod /modules/virtio_pci_modern_dev.ko || true
|
||||
insmod /modules/virtio_pci.ko || true
|
||||
insmod /modules/virtio_net.ko || true
|
||||
insmod /modules/netfs.ko || true
|
||||
insmod /modules/fscache.ko
|
||||
insmod /modules/9pnet.ko
|
||||
insmod /modules/9pnet_virtio.ko || true
|
||||
insmod /modules/9p.ko
|
||||
|
||||
ifconfig lo 127.0.0.1
|
||||
ifconfig eth0 10.0.2.15
|
||||
route add default gw 10.0.2.2 eth0
|
||||
|
||||
mkdir /target
|
||||
mount -t 9p -o trans=virtio target /target -oversion=9p2000.u || true
|
||||
|
||||
exec dropbear -F -E -B
|
||||
EOF
|
||||
|
||||
chmod +x "${root}/init"
|
||||
cd "${root}"
|
||||
find . | cpio --create --format='newc' --quiet | gzip > ../initrd.gz
|
||||
cd -
|
||||
|
||||
# Clean up
|
||||
rm -rf "/qemu/${root}" "/qemu/${arch}"
|
||||
mv -f /etc/apt/sources.list.bak /etc/apt/sources.list
|
||||
if [ -f /etc/dpkg/dpkg.cfg.d/multiarch.bak ]; then
|
||||
mv /etc/dpkg/dpkg.cfg.d/multiarch.bak /etc/dpkg/dpkg.cfg.d/multiarch
|
||||
fi
|
||||
# can fail if arch is used (amd64 and/or i386)
|
||||
dpkg --remove-architecture "${arch}" || true
|
||||
apt-get update
|
||||
|
||||
purge_packages
|
||||
|
||||
ls -lh /qemu
|
||||
}
|
||||
|
||||
main "${@}"
|
||||
@@ -1,173 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
LOG=/tmp/qemu.log
|
||||
LOCK=/tmp/qemu.lock
|
||||
|
||||
if [ -n "${CROSS_DEBUG}" ]; then
|
||||
set -x
|
||||
fi
|
||||
|
||||
# arch in the rust target
|
||||
arch="${1}"
|
||||
shift
|
||||
|
||||
if [ "${CROSS_RUNNER}" = "" ]; then
|
||||
if [[ "${arch}" == i?86 ]] || [[ "${arch}" == x86_64 ]]; then
|
||||
CROSS_RUNNER=native
|
||||
else
|
||||
CROSS_RUNNER=qemu-user
|
||||
fi
|
||||
fi
|
||||
|
||||
# select qemu arch
|
||||
qarch="${arch}"
|
||||
case "${arch}" in
|
||||
armv7)
|
||||
qarch="arm"
|
||||
;;
|
||||
i686)
|
||||
qarch="i386"
|
||||
;;
|
||||
powerpc)
|
||||
qarch="ppc"
|
||||
;;
|
||||
powerpc64)
|
||||
qarch="ppc64"
|
||||
;;
|
||||
powerpc64le)
|
||||
if [ "${CROSS_RUNNER}" = "qemu-user" ]; then
|
||||
qarch="ppc64le"
|
||||
else
|
||||
qarch="ppc64"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
case "${CROSS_RUNNER}" in
|
||||
native)
|
||||
exec "${@}"
|
||||
;;
|
||||
qemu-user)
|
||||
exec "qemu-${qarch}" "${@}"
|
||||
;;
|
||||
qemu-system)
|
||||
true
|
||||
;;
|
||||
*)
|
||||
echo "Invalid runner: \"${CROSS_RUNNER}\"";
|
||||
echo "Valid runners are: native, qemu-user and qemu-system"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
n="$(nproc)"
|
||||
memory=1G
|
||||
driver9p="virtio-9p-pci"
|
||||
drivernet="virtio-net-pci"
|
||||
|
||||
# select qemu parameters
|
||||
case "${arch}" in
|
||||
aarch64)
|
||||
# 8 is the max number of cpu supported by qemu-aarch64
|
||||
n=$(( n > 8 ? 8 : n ))
|
||||
opt="-machine virt -cpu cortex-a57"
|
||||
;;
|
||||
armv7)
|
||||
opt="-machine virt"
|
||||
driver9p="virtio-9p-device"
|
||||
drivernet="virtio-net-device"
|
||||
;;
|
||||
i686)
|
||||
opt="-append console=ttyS0"
|
||||
;;
|
||||
mips|mipsel)
|
||||
# avoid kernel error
|
||||
# https://blahcat.github.io/2017/07/14/building-a-debian-stretch-qemu-image-for-mipsel/
|
||||
opt="-append nokaslr"
|
||||
n=1
|
||||
;;
|
||||
mips64el)
|
||||
# avoid kernel error
|
||||
# https://blahcat.github.io/2017/07/14/building-a-debian-stretch-qemu-image-for-mipsel/
|
||||
opt="-append nokaslr -cpu MIPS64R2-generic"
|
||||
n=1
|
||||
;;
|
||||
powerpc)
|
||||
opt="-append console=ttyPZ0"
|
||||
n=1
|
||||
;;
|
||||
powerpc64|powerpc64le)
|
||||
opt="-append console=hvc0 --nodefaults -serial stdio"
|
||||
;;
|
||||
s390x)
|
||||
n=1
|
||||
driver9p="virtio-9p-ccw"
|
||||
drivernet="virtio-net-ccw"
|
||||
;;
|
||||
sparc64)
|
||||
n=1
|
||||
driver9p+=",bus=pciB"
|
||||
drivernet+=",bus=pciB"
|
||||
;;
|
||||
x86_64)
|
||||
opt="-append console=ttyS0"
|
||||
;;
|
||||
esac
|
||||
|
||||
(
|
||||
flock -n 200 || exit 0
|
||||
|
||||
echo Booting QEMU virtual machine with $n cpus...
|
||||
|
||||
QEMU_CMD="qemu-system-${qarch} \
|
||||
-m ${memory} \
|
||||
-smp ${n} \
|
||||
-nographic \
|
||||
-monitor none \
|
||||
-netdev user,id=net0,hostfwd=tcp::10022-:22 \
|
||||
-device ${drivernet},netdev=net0 \
|
||||
-kernel /qemu/kernel \
|
||||
-initrd /qemu/initrd.gz \
|
||||
${opt} \
|
||||
-fsdev local,id=fs0,path=/target,security_model=mapped \
|
||||
-device ${driver9p},fsdev=fs0,mount_tag=target"
|
||||
|
||||
touch "${LOG}"
|
||||
if [[ -n "${CROSS_DEBUG}" ]]; then
|
||||
(${QEMU_CMD} 2>&1 | tee -a "${LOG}") &
|
||||
else
|
||||
${QEMU_CMD} >> "${LOG}" 2>&1 &
|
||||
fi
|
||||
|
||||
# wait for dropbear
|
||||
for _ in $(seq 240); do
|
||||
if grep -q "Not backgrounding" "${LOG}"; then
|
||||
READY=1
|
||||
break
|
||||
fi
|
||||
sleep 0.5s
|
||||
done
|
||||
|
||||
if [ -z "${READY}" ]; then
|
||||
if [ -n "${CROSS_DEBUG}" ]; then
|
||||
echo "Not ready but continuing because CROSS_DEBUG is set"
|
||||
else
|
||||
echo "Qemu is not ready after ${SECONDS} seconds..."
|
||||
echo "Set the environment variable CROSS_DEBUG=1 to debug"
|
||||
echo "Last 100 lines of qemu output:"
|
||||
tail -n 100 "${LOG}"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "Booted in ${SECONDS} seconds"
|
||||
|
||||
) 200>"${LOCK}"
|
||||
|
||||
if [[ -t 1 ]] && [[ -t 2 ]]; then
|
||||
tty_flag='-t'
|
||||
fi
|
||||
|
||||
exec dbclient ${tty_flag} -p 10022 -y -y root@localhost "${@}"
|
||||
@@ -1,233 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -x
|
||||
set -euo pipefail
|
||||
|
||||
# shellcheck disable=SC1091
|
||||
. lib.sh
|
||||
|
||||
build_static_libffi () {
|
||||
local version=3.0.13
|
||||
|
||||
local td
|
||||
td="$(mktemp -d)"
|
||||
|
||||
pushd "${td}"
|
||||
|
||||
|
||||
curl --retry 3 -sSfL "https://github.com/libffi/libffi/archive/refs/tags/v${version}.tar.gz" -O -L
|
||||
tar --strip-components=1 -xzf "v${version}.tar.gz"
|
||||
./configure --prefix="$td"/lib --disable-builddir --disable-shared --enable-static
|
||||
make "-j$(nproc)"
|
||||
install -m 644 ./.libs/libffi.a /usr/lib64/
|
||||
|
||||
popd
|
||||
|
||||
rm -rf "${td}"
|
||||
}
|
||||
|
||||
build_static_libmount () {
|
||||
local version_spec=2.23.2
|
||||
local version=2.23
|
||||
local td
|
||||
td="$(mktemp -d)"
|
||||
|
||||
pushd "${td}"
|
||||
|
||||
curl --retry 3 -sSfL "https://kernel.org/pub/linux/utils/util-linux/v${version}/util-linux-${version_spec}.tar.xz" -O -L
|
||||
tar --strip-components=1 -xJf "util-linux-${version_spec}.tar.xz"
|
||||
./configure --disable-shared --enable-static --without-ncurses
|
||||
make "-j$(nproc)" mount blkid
|
||||
install -m 644 ./.libs/*.a /usr/lib64/
|
||||
|
||||
popd
|
||||
|
||||
rm -rf "${td}"
|
||||
}
|
||||
|
||||
|
||||
build_static_libattr() {
|
||||
local version=2.4.46
|
||||
|
||||
local td
|
||||
td="$(mktemp -d)"
|
||||
|
||||
pushd "${td}"
|
||||
|
||||
yum install -y gettext
|
||||
|
||||
curl --retry 3 -sSfL "https://download.savannah.nongnu.org/releases/attr/attr-${version}.src.tar.gz" -O
|
||||
tar --strip-components=1 -xzf "attr-${version}.src.tar.gz"
|
||||
cp /usr/share/automake*/config.* .
|
||||
|
||||
./configure
|
||||
make "-j$(nproc)"
|
||||
install -m 644 ./libattr/.libs/libattr.a /usr/lib64/
|
||||
|
||||
yum remove -y gettext
|
||||
|
||||
popd
|
||||
|
||||
rm -rf "${td}"
|
||||
}
|
||||
|
||||
build_static_libcap() {
|
||||
local version=2.22
|
||||
|
||||
local td
|
||||
td="$(mktemp -d)"
|
||||
|
||||
pushd "${td}"
|
||||
|
||||
curl --retry 3 -sSfL "https://www.kernel.org/pub/linux/libs/security/linux-privs/libcap2/libcap-${version}.tar.xz" -O
|
||||
tar --strip-components=1 -xJf "libcap-${version}.tar.xz"
|
||||
make "-j$(nproc)"
|
||||
install -m 644 libcap/libcap.a /usr/lib64/
|
||||
|
||||
popd
|
||||
|
||||
rm -rf "${td}"
|
||||
}
|
||||
|
||||
build_static_pixman() {
|
||||
local version=0.34.0
|
||||
|
||||
local td
|
||||
td="$(mktemp -d)"
|
||||
|
||||
pushd "${td}"
|
||||
|
||||
curl --retry 3 -sSfL "https://www.cairographics.org/releases/pixman-${version}.tar.gz" -O
|
||||
tar --strip-components=1 -xzf "pixman-${version}.tar.gz"
|
||||
./configure
|
||||
make "-j$(nproc)"
|
||||
install -m 644 ./pixman/.libs/libpixman-1.a /usr/lib64/
|
||||
|
||||
popd
|
||||
|
||||
rm -rf "${td}"
|
||||
}
|
||||
|
||||
main() {
|
||||
local version=5.1.0
|
||||
|
||||
if_centos version=4.2.1
|
||||
|
||||
local arch="${1}" \
|
||||
softmmu="${2:-}"
|
||||
|
||||
install_packages \
|
||||
autoconf \
|
||||
automake \
|
||||
bison \
|
||||
bzip2 \
|
||||
curl \
|
||||
flex \
|
||||
libtool \
|
||||
make \
|
||||
patch \
|
||||
python3 \
|
||||
|
||||
if_centos install_packages \
|
||||
gcc-c++ \
|
||||
pkgconfig \
|
||||
xz \
|
||||
glib2-devel \
|
||||
glib2-static \
|
||||
glibc-static \
|
||||
libattr-devel \
|
||||
libcap-devel \
|
||||
libfdt-devel \
|
||||
pcre-static \
|
||||
pixman-devel \
|
||||
libselinux-devel \
|
||||
libselinux-static \
|
||||
libffi \
|
||||
libuuid-devel \
|
||||
libblkid-devel \
|
||||
libmount-devel \
|
||||
zlib-devel \
|
||||
zlib-static
|
||||
|
||||
if_centos 'curl --retry 3 -sSfL "https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD" -o /usr/share/automake*/config.guess'
|
||||
if_centos 'curl --retry 3 -sSfL "https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD" -o /usr/share/automake*/config.sub'
|
||||
|
||||
# these are not packaged as static libraries in centos; build them manually
|
||||
if_centos build_static_libffi
|
||||
if_centos build_static_libmount
|
||||
if_centos build_static_libattr
|
||||
if_centos build_static_libcap
|
||||
if_centos build_static_pixman
|
||||
|
||||
if_ubuntu install_packages \
|
||||
g++ \
|
||||
pkg-config \
|
||||
xz-utils \
|
||||
libattr1-dev \
|
||||
libcap-ng-dev \
|
||||
libffi-dev \
|
||||
libglib2.0-dev \
|
||||
libpixman-1-dev \
|
||||
libselinux1-dev \
|
||||
zlib1g-dev
|
||||
|
||||
# if we have python3.6+, we can install qemu 6.1.0, which needs ninja-build
|
||||
# ubuntu 16.04 only provides python3.5, so remove when we have a newer qemu.
|
||||
is_ge_python36=$(python3 -c "import sys; print(int(sys.version_info >= (3, 6)))")
|
||||
if [[ "${is_ge_python36}" == "1" ]]; then
|
||||
if_ubuntu version=6.1.0
|
||||
if_ubuntu install_packages ninja-build
|
||||
fi
|
||||
|
||||
local td
|
||||
td="$(mktemp -d)"
|
||||
|
||||
pushd "${td}"
|
||||
|
||||
curl --retry 3 -sSfL "https://download.qemu.org/qemu-${version}.tar.xz" -O
|
||||
tar --strip-components=1 -xJf "qemu-${version}.tar.xz"
|
||||
|
||||
local targets="${arch}-linux-user"
|
||||
local virtfs=""
|
||||
case "${softmmu}" in
|
||||
softmmu)
|
||||
if [ "${arch}" = "ppc64le" ]; then
|
||||
targets="${targets},ppc64-softmmu"
|
||||
else
|
||||
targets="${targets},${arch}-softmmu"
|
||||
fi
|
||||
virtfs="--enable-virtfs"
|
||||
;;
|
||||
"")
|
||||
true
|
||||
;;
|
||||
*)
|
||||
echo "Invalid softmmu option: ${softmmu}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
./configure \
|
||||
--disable-kvm \
|
||||
--disable-vnc \
|
||||
--disable-guest-agent \
|
||||
--enable-linux-user \
|
||||
--static \
|
||||
${virtfs} \
|
||||
--target-list="${targets}"
|
||||
make "-j$(nproc)"
|
||||
make install
|
||||
|
||||
# HACK the binfmt_misc interpreter we'll use expects the QEMU binary to be
|
||||
# in /usr/bin. Create an appropriate symlink
|
||||
ln -s "/usr/local/bin/qemu-${arch}" "/usr/bin/qemu-${arch}-static"
|
||||
|
||||
purge_packages
|
||||
|
||||
popd
|
||||
|
||||
rm -rf "${td}"
|
||||
rm "${0}"
|
||||
}
|
||||
|
||||
main "${@}"
|
||||
@@ -1,28 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -x
|
||||
set -euo pipefail
|
||||
|
||||
# shellcheck disable=SC1091
|
||||
. lib.sh
|
||||
|
||||
main() {
|
||||
install_packages ca-certificates curl
|
||||
|
||||
export RUSTUP_HOME=/tmp/rustup
|
||||
export CARGO_HOME=/tmp/cargo
|
||||
|
||||
curl --retry 3 -sSfL https://sh.rustup.rs -o rustup-init.sh
|
||||
sh rustup-init.sh -y --no-modify-path --profile minimal
|
||||
rm rustup-init.sh
|
||||
|
||||
PATH="${CARGO_HOME}/bin:${PATH}" cargo install xargo --root /usr/local
|
||||
|
||||
rm -r "${RUSTUP_HOME}" "${CARGO_HOME}"
|
||||
|
||||
purge_packages
|
||||
|
||||
rm "${0}"
|
||||
}
|
||||
|
||||
main "${@}"
|
||||
25
.github/CODE_OF_CONDUCT.md
vendored
25
.github/CODE_OF_CONDUCT.md
vendored
@@ -1,3 +1,4 @@
|
||||
|
||||
# Contributor Covenant Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
@@ -17,23 +18,23 @@ diverse, inclusive, and healthy community.
|
||||
Examples of behavior that contributes to a positive environment for our
|
||||
community include:
|
||||
|
||||
- Demonstrating empathy and kindness toward other people
|
||||
- Being respectful of differing opinions, viewpoints, and experiences
|
||||
- Giving and gracefully accepting constructive feedback
|
||||
- Accepting responsibility and apologizing to those affected by our mistakes,
|
||||
* Demonstrating empathy and kindness toward other people
|
||||
* Being respectful of differing opinions, viewpoints, and experiences
|
||||
* Giving and gracefully accepting constructive feedback
|
||||
* Accepting responsibility and apologizing to those affected by our mistakes,
|
||||
and learning from the experience
|
||||
- Focusing on what is best not just for us as individuals, but for the overall
|
||||
* Focusing on what is best not just for us as individuals, but for the overall
|
||||
community
|
||||
|
||||
Examples of unacceptable behavior include:
|
||||
|
||||
- The use of sexualized language or imagery, and sexual attention or advances of
|
||||
* The use of sexualized language or imagery, and sexual attention or advances of
|
||||
any kind
|
||||
- Trolling, insulting or derogatory comments, and personal or political attacks
|
||||
- Public or private harassment
|
||||
- Publishing others' private information, such as a physical or email address,
|
||||
* Trolling, insulting or derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or email address,
|
||||
without their explicit permission
|
||||
- Other conduct which could reasonably be considered inappropriate in a
|
||||
* Other conduct which could reasonably be considered inappropriate in a
|
||||
professional setting
|
||||
|
||||
## Enforcement Responsibilities
|
||||
@@ -60,7 +61,7 @@ representative at an online or offline event.
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported to the community leaders responsible for enforcement at
|
||||
[contact@tauri.app](mailto:contact@tauri.app).
|
||||
[contact@tauri.studio](mailto:contact@tauri.studio).
|
||||
All complaints will be reviewed and investigated promptly and fairly.
|
||||
|
||||
All community leaders are obligated to respect the privacy and security of the
|
||||
@@ -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
|
||||
59
.github/CONTRIBUTING.md
vendored
59
.github/CONTRIBUTING.md
vendored
@@ -22,7 +22,7 @@ Hi! We, the maintainers, are really excited that you are interested in contribut
|
||||
|
||||
- Issues with no clear repro steps will not be triaged. If an issue labeled "need repro" receives no further input from the issue author for more than 5 days, it will be closed.
|
||||
|
||||
- If your issue is resolved but still open, don't hesitate to close it. In case you found a solution by yourself, it could be helpful to explain how you fixed it.
|
||||
- If your issue is resolved but still open, don’t hesitate to close it. In case you found a solution by yourself, it could be helpful to explain how you fixed it.
|
||||
|
||||
- Most importantly, we beg your patience: the team must balance your request against many other responsibilities — fixing other bugs, answering other questions, new features, new documentation, etc. The issue list is not paid support and we cannot make guarantees about how fast your issue can be resolved.
|
||||
|
||||
@@ -37,75 +37,54 @@ Hi! We, the maintainers, are really excited that you are interested in contribut
|
||||
- Provide convincing reason to add this feature. Ideally you should open a suggestion issue first and have it greenlighted before working on it.
|
||||
|
||||
- If fixing a bug:
|
||||
|
||||
- If you are resolving a special issue, add `(fix: #xxxx[,#xxx])` (#xxxx is the issue id) in your PR title for a better release log, e.g. `fix: update entities encoding/decoding (fix #3899)`.
|
||||
- Provide detailed description of the bug in the PR, or link to an issue that does.
|
||||
|
||||
- If the PR is meant to be released, follow the instructions in `.changes/readme.md` to log your changes. ie. [readme.md](https://github.com/tauri-apps/tauri/blob/dev/.changes/README.md)
|
||||
|
||||
## Development Guide
|
||||
|
||||
**NOTE: If you have any question don't hesitate to ask in our Discord server. We try to keep this guide to up guide, but if something doesn't work let us know.**
|
||||
**NOTE: Tauri is undergoing rapid development right now, and the docs match the latest published version of Tauri. They are horribly out of date when compared with the code in the dev branch. This contributor guide is up-to-date, but it doesn't cover all of Tauri's functions in depth. If you have any questions, don't hesitate to ask in our Discord server.**
|
||||
|
||||
### General Setup
|
||||
|
||||
First, [join our Discord server](https://discord.gg/SpmNs4S) and let us know that you want to contribute. This way we can point you in the right direction and help ensure your contribution will be as helpful as possible.
|
||||
|
||||
To set up your machine for development, follow the [Tauri setup guide](https://v2.tauri.app/start/prerequisites/) to get all the tools you need to develop Tauri apps. The only additional tool you may need is [PNPM](https://pnpm.io/), it is only required if you are developing the Node CLI or API packages (`packages/cli` and `packages/api`).
|
||||
To set up your machine for development, follow the [Tauri setup guide](https://tauri.studio/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 respository 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
|
||||
$ RUSTDOCFLAGS="--cfg docsrs" 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
6
.github/FUNDING.yml
vendored
@@ -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
|
||||
|
||||
21
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
21
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
@@ -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,9 @@ 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`"
|
||||
render: shell
|
||||
validations:
|
||||
required: true
|
||||
|
||||
@@ -54,8 +51,8 @@ body:
|
||||
id: logs
|
||||
attributes:
|
||||
label: Stack trace
|
||||
render: text
|
||||
|
||||
render: shell
|
||||
|
||||
- type: textarea
|
||||
id: context
|
||||
attributes:
|
||||
|
||||
4
.github/ISSUE_TEMPLATE/config.yml
vendored
4
.github/ISSUE_TEMPLATE/config.yml
vendored
@@ -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
|
||||
|
||||
3
.github/ISSUE_TEMPLATE/docs_report.md
vendored
3
.github/ISSUE_TEMPLATE/docs_report.md
vendored
@@ -1,7 +1,8 @@
|
||||
---
|
||||
name: 📚 Docs Report
|
||||
about: Create a report to help us improve the docs
|
||||
title: '[docs] '
|
||||
title: "[docs] "
|
||||
labels: 'type: documentation'
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
10
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
10
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
@@ -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:
|
||||
|
||||
45
.github/PULL_REQUEST_TEMPLATE.md
vendored
45
.github/PULL_REQUEST_TEMPLATE.md
vendored
@@ -1,21 +1,30 @@
|
||||
<!--
|
||||
Before submitting a PR, please read https://github.com/tauri-apps/tauri/blob/dev/.github/CONTRIBUTING.md#pull-request-guidelines
|
||||
Update "[ ]" to "[x]" to check a box
|
||||
|
||||
1. Give the PR a descriptive title.
|
||||
|
||||
Examples of good title:
|
||||
- fix(windows): fix race condition in event loop
|
||||
- docs: update example for `App::show`
|
||||
- feat: add `Window::set_fullscreen`
|
||||
|
||||
Examples of bad title:
|
||||
- fix #7123
|
||||
- update docs
|
||||
- fix bugs
|
||||
|
||||
2. If there is a related issue, reference it in the PR text, e.g. closes #123.
|
||||
3. If this change requires a new version, then add a change file in `.changes` directory with the appropriate bump, see https://github.com/tauri-apps/tauri/blob/dev/.changes/README.md
|
||||
4. Ensure that all your commits are signed https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits
|
||||
5. Ensure `cargo test` and `cargo clippy` passes.
|
||||
6. Propose your changes as a draft PR if your work is still in progress.
|
||||
Please make sure to read the Pull Request Guidelines: https://github.com/tauri-apps/tauri/blob/dev/.github/CONTRIBUTING.md#pull-request-guidelines
|
||||
-->
|
||||
|
||||
### What kind of change does this PR introduce?
|
||||
<!-- Check at least one. If you are introducing a new binding, you must reference an issue where this binding has been proposed, discussed and approved by the maintainers. -->
|
||||
|
||||
- [ ] Bugfix
|
||||
- [ ] Feature
|
||||
- [ ] Docs
|
||||
- [ ] New Binding issue #___
|
||||
- [ ] Code style update
|
||||
- [ ] Refactor
|
||||
- [ ] Build-related changes
|
||||
- [ ] Other, please describe:
|
||||
|
||||
### Does this PR introduce a breaking change?
|
||||
<!-- If yes, please describe the impact and migration path for existing applications in an attached issue. -->
|
||||
|
||||
- [ ] Yes, and the changes were approved in issue #___
|
||||
- [ ] No
|
||||
|
||||
### Checklist
|
||||
- [ ] When resolving issues, they are referenced in the PR's title (e.g `fix: remove a typo, closes #___, #___`)
|
||||
- [ ] A change file is added if any packages will require a version bump due to this PR per [the instructions in the readme](https://github.com/tauri-apps/tauri/blob/dev/.changes/readme.md).
|
||||
- [ ] I have added a convincing reason for adding this feature, if necessary
|
||||
|
||||
### Other information
|
||||
|
||||
57
.github/RELEASING.md
vendored
57
.github/RELEASING.md
vendored
@@ -1,57 +0,0 @@
|
||||
# Tauri Releasing Handbook
|
||||
|
||||
This handbook contains information about our release pipeline and how to deal with common issues.
|
||||
This document is mainly intended for team members responsible for maintaining the project.
|
||||
|
||||
- [Covector](#covector)
|
||||
- [Version Pull Request](#version-pull-request)
|
||||
- [Releasing and Publishing](#releasing-and-publishing)
|
||||
- [Publishing failed, what to do?](#publishing-failed-what-to-do)
|
||||
|
||||
## Covector
|
||||
|
||||
We use [`covector`](https://github.com/jbolda/covector) to manage our version bumps and release pipeline.
|
||||
It can be configured in [`.changes/config.json`](../.changes/config.json) which includes how each package should be published step by step.
|
||||
|
||||
Some packages can't be published directly using `covector` as it requires to be built on a matrix of platforms
|
||||
such as `tauri-cli` prebuilt binaries which is published using [publish-cli-rs.yml](./workflows/publish-cli-rs.yml)
|
||||
and `@tauri-apps/cli` native Node.js modules which is published using using [publish-cli-js.yml](./workflows/publish-cli-js.yml)
|
||||
both of which are triggered after `covector` has created a github release for both of them, see `Trigger @tauri-apps/cli publishing workflow`
|
||||
and `Trigger tauri-cli publishing workflow` steps in [covector-version-or-publish.yml](./workflows/covector-version-or-publish.yml)
|
||||
|
||||
## Version Pull Request
|
||||
|
||||
On each pull request merged, [covector-version-or-publish.yml](./workflows/covector-version-or-publish.yml) workflow will run, and:
|
||||
|
||||
When there're change files inside `.changes` folder and they're not all included in `pre.json` (usually this is only when we are in `-alpha` to `-rc` phase), it will open/update an `Apply Version Updates From Current Changes` PR (https://github.com/tauri-apps/tauri/pull/11029 for example) that bumps all packages based on current existing change files and generate `CHANGELOG.md` entries. see `Create Pull Request With Versions Bumped` step in [covector-version-or-publish.yml](./workflows/covector-version-or-publish.yml).
|
||||
|
||||
Otherwise, covector will start to publish packages configured in [`.changes/config.json`](../.changes/config.json).
|
||||
|
||||
## Releasing and Publishing
|
||||
|
||||
Releasing can be as easy as merging the version pull request but here is a checklist to follow:
|
||||
|
||||
- [ ] Double check that every package is bumped correctly and there are no accidental major or minor being released unless that is indeed the intention.
|
||||
- [ ] Make sure that there are no pending or unfinished [covector-version-or-publish.yml](./workflows/covector-version-or-publish.yml) workflow runs.
|
||||
- [ ] Approve and merge the version pull request
|
||||
|
||||
## Publishing failed, what to do?
|
||||
|
||||
It is possible and due to many factors that one or many packages release can fail to release, there is no reason to panic, we can fix this.
|
||||
|
||||
Did all of the packages fail to release?
|
||||
|
||||
- yes?
|
||||
- [ ] `git checkout -b revert-branch`
|
||||
- [ ] `git revert HEAD~1`
|
||||
- no?
|
||||
- [ ] `git checkout -b revert-branch`
|
||||
- [ ] `git revert HEAD~1 --no-commit`
|
||||
- [ ] Edit the commit and revert only changes related to packages that failed to publish
|
||||
- [ ] `git revert --continue`
|
||||
|
||||
Then:
|
||||
|
||||
- [ ] Make a pull request with reverted changes, get it approved and merged
|
||||
- [ ] Fix the issue that caused releases to fail in another PR, get it approved and merged
|
||||
- [ ] Repeat the release process again.
|
||||
31
.github/sponsors/crabnebula.svg
vendored
31
.github/sponsors/crabnebula.svg
vendored
@@ -1,31 +0,0 @@
|
||||
<svg class="crabnebula-logo" width="100%" height="100%" viewBox="0 0 1204 210" version="1.1"
|
||||
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xml:space="preserve" xmlns:serif="http://www.serif.com/"
|
||||
style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
|
||||
<style>
|
||||
.crabnebula-logo path,
|
||||
.crabnebula-logo rect {
|
||||
fill: #001e42;
|
||||
}
|
||||
@media (prefers-color-scheme: dark) {
|
||||
.crabnebula-logo path, .crabnebula-logo rect {
|
||||
fill: #fff;
|
||||
}
|
||||
}
|
||||
html[data-color-mode="dark"] .crabnebula-logo path,
|
||||
html[data-color-mode="dark"] .crabnebula-logo rect {
|
||||
fill: #fff;
|
||||
}
|
||||
</style>
|
||||
<path d="M351.903,162.334C344.288,162.334 337.123,160.881 330.41,157.975C323.696,155.069 317.834,151.11 312.824,146.099C307.914,141.089 304.006,135.276 301.101,128.662C298.195,121.948 296.742,114.783 296.742,107.167C296.742,99.55 298.195,92.435 301.101,85.821C304.006,79.107 307.914,73.244 312.824,68.234C317.834,63.223 323.696,59.265 330.41,56.358C337.123,53.452 344.288,51.999 351.903,51.999C357.414,51.999 362.675,52.701 367.685,54.103C372.795,55.507 377.455,57.511 381.663,60.116C385.972,62.622 389.83,65.678 393.237,69.286C396.644,72.793 399.499,76.752 401.804,81.161L380.762,92.586C377.756,87.174 373.848,82.915 369.038,79.808C364.328,76.702 358.617,75.148 351.903,75.148C347.494,75.148 343.386,76 339.578,77.704C335.871,79.407 332.614,81.762 329.809,84.769C327.003,87.675 324.798,91.082 323.195,94.991C321.592,98.799 320.79,102.857 320.79,107.167C320.79,111.476 321.592,115.584 323.195,119.493C324.798,123.301 327.003,126.708 329.809,129.715C332.614,132.621 335.871,134.926 339.578,136.629C343.386,138.333 347.494,139.185 351.903,139.185C358.617,139.185 364.328,137.631 369.038,134.525C373.848,131.418 377.756,127.159 380.762,121.748L401.804,133.172C399.499,137.581 396.644,141.59 393.237,145.198C389.83,148.705 385.972,151.762 381.663,154.367C377.455,156.872 372.795,158.827 367.685,160.23C362.675,161.633 357.414,162.334 351.903,162.334Z" style="fill-rule:nonzero;stroke:black;stroke-width:0.55px;"/>
|
||||
<path d="M413.821,85.37L436.517,85.37L436.517,96.644C437.72,93.337 439.924,90.481 443.131,88.076C446.437,85.671 450.195,84.468 454.403,84.468C455.506,84.468 456.658,84.518 457.86,84.619C459.063,84.719 460.366,84.969 461.768,85.37L461.768,108.369C460.065,107.768 458.412,107.317 456.808,107.016C455.205,106.716 453.502,106.565 451.698,106.565C446.788,106.565 443.03,108.269 440.425,111.676C437.82,115.083 436.517,119.493 436.517,124.904L436.517,160.53L413.821,160.53L413.821,85.37Z" style="fill-rule:nonzero;stroke:black;stroke-width:0.55px;"/>
|
||||
<path d="M502.161,162.184C497.251,162.184 492.642,161.132 488.333,159.027C484.125,156.923 480.467,154.117 477.361,150.609C474.255,147.001 471.8,142.843 469.996,138.133C468.193,133.322 467.291,128.261 467.291,122.95C467.291,117.639 468.193,112.628 469.996,107.918C471.8,103.108 474.255,98.949 477.361,95.442C480.467,91.834 484.125,88.978 488.333,86.873C492.642,84.769 497.251,83.717 502.161,83.717C504.666,83.717 506.971,84.017 509.075,84.619C511.28,85.12 513.234,85.821 514.937,86.723C516.741,87.625 518.244,88.627 519.446,89.729C520.749,90.832 521.801,91.884 522.603,92.886L522.603,85.37L545.299,85.37L545.299,160.53L522.603,160.53L522.603,153.014C521.801,154.016 520.749,155.069 519.446,156.171C518.244,157.273 516.741,158.275 514.937,159.177C513.234,160.079 511.28,160.781 509.075,161.282C506.971,161.883 504.666,162.184 502.161,162.184ZM507.272,141.59C512.382,141.59 516.49,139.836 519.597,136.329C522.803,132.821 524.406,128.362 524.406,122.95C524.406,117.539 522.803,113.079 519.597,109.572C516.49,106.064 512.382,104.31 507.272,104.31C502.161,104.31 498.003,106.064 494.796,109.572C491.69,113.079 490.137,117.539 490.137,122.95C490.137,128.362 491.69,132.821 494.796,136.329C498.003,139.836 502.161,141.59 507.272,141.59Z" style="fill-rule:nonzero;stroke:black;stroke-width:0.55px;"/>
|
||||
<path d="M607.116,162.184C604.611,162.184 602.256,161.883 600.051,161.282C597.947,160.781 595.993,160.079 594.19,159.177C592.486,158.275 590.983,157.273 589.681,156.171C588.378,155.069 587.376,154.016 586.674,153.014L586.674,160.53L563.979,160.53L563.979,47.79L586.674,47.79L586.674,92.886C587.376,91.884 588.378,90.832 589.681,89.729C590.983,88.627 592.486,87.625 594.19,86.723C595.993,85.821 597.947,85.12 600.051,84.619C602.256,84.017 604.611,83.717 607.116,83.717C612.026,83.717 616.585,84.769 620.793,86.873C625.102,88.978 628.81,91.834 631.916,95.442C635.022,98.949 637.477,103.108 639.281,107.918C641.084,112.628 641.986,117.639 641.986,122.95C641.986,128.261 641.084,133.322 639.281,138.133C637.477,142.843 635.022,147.001 631.916,150.609C628.81,154.117 625.102,156.923 620.793,159.027C616.585,161.132 612.026,162.184 607.116,162.184ZM602.005,141.59C607.116,141.59 611.224,139.836 614.33,136.329C617.537,132.821 619.14,128.362 619.14,122.95C619.14,117.539 617.537,113.079 614.33,109.572C611.224,106.064 607.116,104.31 602.005,104.31C596.895,104.31 592.737,106.064 589.53,109.572C586.424,113.079 584.871,117.539 584.871,122.95C584.871,128.362 586.424,132.821 589.53,136.329C592.737,139.836 596.895,141.59 602.005,141.59Z" style="fill-rule:nonzero;stroke:black;stroke-width:0.55px;"/>
|
||||
<path d="M732.106,160.53L680.101,94.54L680.101,160.53L656.203,160.53L656.203,53.803L676.795,53.803L728.649,119.793L728.649,53.803L752.698,53.803L752.698,160.53L732.106,160.53Z" style="fill-rule:nonzero;stroke:black;stroke-width:0.55px;"/>
|
||||
<path d="M806.852,162.184C801.341,162.184 796.13,161.282 791.22,159.478C786.411,157.674 782.202,155.069 778.595,151.661C774.988,148.254 772.132,144.145 770.028,139.335C767.923,134.425 766.871,128.963 766.871,122.95C766.871,117.338 767.823,112.177 769.727,107.467C771.731,102.657 774.487,98.498 777.994,94.991C781.601,91.483 785.809,88.727 790.619,86.723C795.429,84.719 800.69,83.717 806.401,83.717C811.311,83.717 816.021,84.518 820.53,86.122C825.139,87.625 829.147,89.93 832.554,93.036C835.961,96.043 838.666,99.851 840.67,104.461C842.775,108.97 843.827,114.282 843.827,120.395C843.827,121.397 843.777,122.549 843.677,123.852C843.677,125.055 843.576,126.558 843.376,128.362L788.816,128.362C789.517,132.871 791.671,136.228 795.279,138.433C798.886,140.538 802.844,141.59 807.153,141.59C811.562,141.59 815.319,140.738 818.425,139.034C821.632,137.231 823.937,135.226 825.339,133.022L842.173,145.649C838.666,150.659 833.857,154.668 827.744,157.674C821.732,160.681 814.768,162.184 806.852,162.184ZM821.281,113.48C820.279,109.471 818.275,106.615 815.269,104.912C812.263,103.108 809.107,102.206 805.8,102.206C804.096,102.206 802.393,102.406 800.69,102.807C798.986,103.208 797.383,103.859 795.88,104.761C794.377,105.663 793.024,106.816 791.822,108.219C790.719,109.622 789.918,111.376 789.417,113.48L821.281,113.48Z" style="fill-rule:nonzero;stroke:black;stroke-width:0.55px;"/>
|
||||
<path d="M901.265,162.184C898.76,162.184 896.405,161.883 894.201,161.282C892.097,160.781 890.143,160.079 888.339,159.177C886.636,158.275 885.133,157.273 883.83,156.171C882.527,155.069 881.525,154.016 880.824,153.014L880.824,160.53L858.128,160.53L858.128,47.79L880.824,47.79L880.824,92.886C881.525,91.884 882.527,90.832 883.83,89.729C885.133,88.627 886.636,87.625 888.339,86.723C890.143,85.821 892.097,85.12 894.201,84.619C896.405,84.017 898.76,83.717 901.265,83.717C906.175,83.717 910.734,84.769 914.943,86.873C919.252,88.978 922.959,91.834 926.065,95.442C929.172,98.949 931.627,103.108 933.43,107.918C935.234,112.628 936.136,117.639 936.136,122.95C936.136,128.261 935.234,133.322 933.43,138.133C931.627,142.843 929.172,147.001 926.065,150.609C922.959,154.117 919.252,156.923 914.943,159.027C910.734,161.132 906.175,162.184 901.265,162.184ZM896.155,141.59C901.265,141.59 905.374,139.836 908.48,136.329C911.686,132.821 913.29,128.362 913.29,122.95C913.29,117.539 911.686,113.079 908.48,109.572C905.374,106.064 901.265,104.31 896.155,104.31C891.045,104.31 886.886,106.064 883.68,109.572C880.573,113.079 879.02,117.539 879.02,122.95C879.02,128.362 880.573,132.821 883.68,136.329C886.886,139.836 891.045,141.59 896.155,141.59Z" style="fill-rule:nonzero;stroke:black;stroke-width:0.55px;"/>
|
||||
<path d="M977.812,162.184C968.493,162.184 961.429,159.077 956.619,152.864C951.81,146.651 949.405,138.433 949.405,128.211L949.405,85.37L972.101,85.37L972.101,124.303C972.101,129.815 972.952,134.074 974.656,137.08C976.459,140.087 979.466,141.59 983.674,141.59C987.983,141.59 991.39,140.037 993.895,136.93C996.5,133.823 997.803,128.813 997.803,121.898L997.803,85.37L1020.5,85.37L1020.5,160.53L997.803,160.53L997.803,152.864C995.999,155.469 993.444,157.674 990.137,159.478C986.83,161.282 982.722,162.184 977.812,162.184Z" style="fill-rule:nonzero;stroke:black;stroke-width:0.55px;"/>
|
||||
<rect x="1039.11" y="47.79" width="22.701" height="112.74" style="fill-rule:nonzero;stroke:black;stroke-width:0.55px;"/>
|
||||
<path d="M1110.86,162.184C1105.95,162.184 1101.34,161.132 1097.03,159.027C1092.83,156.923 1089.17,154.117 1086.06,150.609C1082.96,147.001 1080.5,142.843 1078.7,138.133C1076.89,133.322 1075.99,128.261 1075.99,122.95C1075.99,117.639 1076.89,112.628 1078.7,107.918C1080.5,103.108 1082.96,98.949 1086.06,95.442C1089.17,91.834 1092.83,88.978 1097.03,86.873C1101.34,84.769 1105.95,83.717 1110.86,83.717C1113.37,83.717 1115.67,84.017 1117.78,84.619C1119.98,85.12 1121.94,85.821 1123.64,86.723C1125.44,87.625 1126.95,88.627 1128.15,89.729C1129.45,90.832 1130.5,91.884 1131.3,92.886L1131.3,85.37L1154,85.37L1154,160.53L1131.3,160.53L1131.3,153.014C1130.5,154.016 1129.45,155.069 1128.15,156.171C1126.95,157.273 1125.44,158.275 1123.64,159.177C1121.94,160.079 1119.98,160.781 1117.78,161.282C1115.67,161.883 1113.37,162.184 1110.86,162.184ZM1115.97,141.59C1121.08,141.59 1125.19,139.836 1128.3,136.329C1131.5,132.821 1133.11,128.362 1133.11,122.95C1133.11,117.539 1131.5,113.079 1128.3,109.572C1125.19,106.064 1121.08,104.31 1115.97,104.31C1110.86,104.31 1106.7,106.064 1103.5,109.572C1100.39,113.079 1098.84,117.539 1098.84,122.95C1098.84,128.362 1100.39,132.821 1103.5,136.329C1106.7,139.836 1110.86,141.59 1115.97,141.59Z" style="fill-rule:nonzero;stroke:black;stroke-width:0.55px;"/>
|
||||
<path d="M146.48,54.585C119.724,89.866 119.878,134.941 146.826,155.264C153.908,160.605 162.136,163.705 170.903,164.732C146.032,184.934 117.382,191.203 98.037,178.045C71.507,160 72.524,112.249 100.309,71.391C123.51,37.273 158.039,18.749 184.247,24.072C170.404,30.195 157.116,40.561 146.48,54.585ZM181.638,99.643C169.141,111.453 154.859,119.304 142.801,121.916C149.921,147.367 177.29,149.323 177.29,149.323C177.29,149.323 193.578,145.578 205.877,117.941C216.005,95.183 215.122,71.668 204.914,59.7C204.065,71.267 195.731,86.324 181.638,99.643Z" style="stroke:black;stroke-width:0.55px;"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 11 KiB |
157
.github/workflows/artifacts-updater.yml
vendored
Normal file
157
.github/workflows/artifacts-updater.yml
vendored
Normal file
@@ -0,0 +1,157 @@
|
||||
# Copyright 2019-2021 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
name: updater test artifacts
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- dev
|
||||
- next
|
||||
pull_request:
|
||||
paths:
|
||||
- '.github/workflows/artifacts-updater.yml'
|
||||
- 'core/tauri/**'
|
||||
- 'tooling/cli/**'
|
||||
- 'tooling/bundler/**'
|
||||
- 'examples/updater/**'
|
||||
|
||||
env:
|
||||
RUST_BACKTRACE: 1
|
||||
CARGO_INCREMENTAL: 0 # This is set to 0 by the https://github.com/Swatinem/rust-cache
|
||||
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-artifacs:
|
||||
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 libgtk-3-dev webkit2gtk-4.0 libayatana-appindicator3-dev librsvg2-dev patchelf
|
||||
|
||||
- name: Get current date
|
||||
run: echo "CURRENT_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
|
||||
if: matrix.platform == 'macos-latest' || matrix.platform == 'ubuntu-latest'
|
||||
|
||||
- name: Get current date
|
||||
if: matrix.platform == 'windows-latest'
|
||||
run: echo "CURRENT_DATE=$(Get-Date -Format "yyyy-MM-dd")" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||
|
||||
- name: Cache cargo state
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: cargo_state
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/registry
|
||||
~/.cargo/git
|
||||
~/.cargo/bin
|
||||
key: ${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('**/Cargo.toml') }}-${{ env.CURRENT_DATE }}
|
||||
restore-keys: |
|
||||
${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('**/Cargo.toml') }}-
|
||||
${{ matrix.platform }}-stable-${{ env.cache-name }}-
|
||||
${{ matrix.platform }}-stable-
|
||||
${{ matrix.platform }}-
|
||||
|
||||
- name: Cache core cargo target
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: cargo_core
|
||||
with:
|
||||
path: target
|
||||
# Add date to the cache to keep it up to date
|
||||
key: ${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('core/**/Cargo.toml') }}-${{ env.CURRENT_DATE }}
|
||||
# Restore from outdated cache for speed
|
||||
restore-keys: |
|
||||
${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('core/**/Cargo.toml') }}
|
||||
${{ matrix.platform }}-stable-${{ env.cache-name }}-
|
||||
${{ matrix.platform }}-stable-
|
||||
${{ matrix.platform }}-
|
||||
|
||||
- name: Cache CLI cargo target
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: cargo_cli
|
||||
with:
|
||||
path: tooling/cli/target
|
||||
# Add date to the cache to keep it up to date
|
||||
key: ${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('tooling/cli/Cargo.lock') }}-${{ env.CURRENT_DATE }}
|
||||
# Restore from outdated cache for speed
|
||||
restore-keys: |
|
||||
${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('tooling/cli/Cargo.lock') }}
|
||||
${{ matrix.platform }}-stable-${{ env.cache-name }}-
|
||||
${{ matrix.platform }}-stable-
|
||||
${{ matrix.platform }}-
|
||||
|
||||
- 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
|
||||
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==
|
||||
# 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
|
||||
env:
|
||||
TAURI_PRIVATE_KEY: dW50cnVzdGVkIGNvbW1lbnQ6IHJzaWduIGVuY3J5cHRlZCBzZWNyZXQga2V5ClJXUlRZMEl5YTBGV3JiTy9lRDZVd3NkL0RoQ1htZmExNDd3RmJaNmRMT1ZGVjczWTBKZ0FBQkFBQUFBQUFBQUFBQUlBQUFBQWdMekUzVkE4K0tWQ1hjeGt1Vkx2QnRUR3pzQjVuV0ZpM2czWXNkRm9hVUxrVnB6TUN3K1NheHJMREhQbUVWVFZRK3NIL1VsMDBHNW5ET1EzQno0UStSb21nRW4vZlpTaXIwZFh5ZmRlL1lSN0dKcHdyOUVPclVvdzFhVkxDVnZrbHM2T1o4Tk1NWEU9Cg==
|
||||
# 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.*
|
||||
19
.github/workflows/audit.yml
vendored
19
.github/workflows/audit.yml
vendored
@@ -1,4 +1,4 @@
|
||||
# Copyright 2019-2024 Tauri Programme within The Commons Conservancy
|
||||
# Copyright 2019-2021 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
|
||||
|
||||
99
.github/workflows/bench.yml
vendored
99
.github/workflows/bench.yml
vendored
@@ -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_INCREMENTAL: 0 # This is set to 0 by the https://github.com/Swatinem/rust-cache
|
||||
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.
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
@@ -35,45 +28,87 @@ 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
|
||||
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'
|
||||
python-version: '3.x'
|
||||
architecture: x64
|
||||
|
||||
- name: install dependencies
|
||||
- name: install depedencies
|
||||
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 librsvg2-dev patchelf 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
|
||||
- name: Get current date
|
||||
run: echo "CURRENT_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
|
||||
|
||||
- name: Cache cargo state
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: cargo_state
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/registry
|
||||
~/.cargo/git
|
||||
~/.cargo/bin
|
||||
key: ${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('**/Cargo.toml') }}-${{ env.CURRENT_DATE }}
|
||||
restore-keys: |
|
||||
${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('**/Cargo.toml') }}-
|
||||
${{ matrix.platform }}-stable-${{ env.cache-name }}-
|
||||
${{ matrix.platform }}-stable-
|
||||
${{ matrix.platform }}-
|
||||
|
||||
- name: Cache core cargo target
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: cargo_core
|
||||
with:
|
||||
path: target
|
||||
# Add date to the cache to keep it up to date
|
||||
key: ${{ matrix.platform }}-${{ matrix.rust }}-${{ env.cache-name }}-${{ hashFiles('core/**/Cargo.toml') }}-${{ env.CURRENT_DATE }}
|
||||
# Restore from outdated cache for speed
|
||||
restore-keys: |
|
||||
${{ matrix.platform }}-${{ matrix.rust }}-${{ env.cache-name }}-${{ hashFiles('core/**/Cargo.toml') }}
|
||||
${{ matrix.platform }}-${{ matrix.rust }}-${{ env.cache-name }}-
|
||||
${{ matrix.platform }}-${{ matrix.rust }}-
|
||||
${{ matrix.platform }}-
|
||||
|
||||
- name: cache cargo `tooling/bench/tests` target
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: cargo_benches
|
||||
with:
|
||||
path: tooling/bench/tests/target
|
||||
# Add date to the cache to keep it up to date
|
||||
key: ${{ matrix.platform }}-${{ matrix.rust }}-${{ env.cache-name }}-${{ hashFiles('tooling/bench/tests/Cargo.lock') }}-${{ env.CURRENT_DATE }}
|
||||
# Restore from outdated cache for speed
|
||||
restore-keys: |
|
||||
${{ matrix.platform }}-${{ matrix.rust }}-${{ env.cache-name }}-${{ hashFiles('tooling/bench/tests/Cargo.lock') }}
|
||||
${{ matrix.platform }}-${{ matrix.rust }}-${{ env.cache-name }}-
|
||||
${{ matrix.platform }}-${{ matrix.rust }}-
|
||||
${{ matrix.platform }}-
|
||||
|
||||
- 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 +117,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"
|
||||
@@ -91,7 +126,7 @@ jobs:
|
||||
git commit --message "Update Tauri benchmarks"
|
||||
git push origin gh-pages
|
||||
|
||||
- name: Print worker info
|
||||
- name: Worker info
|
||||
run: |
|
||||
cat /proc/cpuinfo
|
||||
cat /proc/meminfo
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2019-2024 Tauri Programme within The Commons Conservancy
|
||||
# Copyright 2019-2021 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
|
||||
44
.github/workflows/check-change-tags.yml
vendored
44
.github/workflows/check-change-tags.yml
vendored
@@ -1,44 +0,0 @@
|
||||
# Copyright 2019-2024 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
name: 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' }}
|
||||
84
.github/workflows/check-generated-files.yml
vendored
84
.github/workflows/check-generated-files.yml
vendored
@@ -1,84 +0,0 @@
|
||||
# Copyright 2019-2024 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
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'
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
changes:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
api: ${{ steps.filter.outputs.api }}
|
||||
schema: ${{ steps.filter.outputs.schema }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: dorny/paths-filter@v3
|
||||
id: filter
|
||||
with:
|
||||
filters: |
|
||||
api:
|
||||
- 'pnpm-lock.yaml'
|
||||
- 'packages/api/src/**'
|
||||
- 'crates/tauri/scripts/bundle.global.js'
|
||||
schema:
|
||||
- 'crates/tauri-utils/src/config.rs'
|
||||
- 'crates/tauri-cli/config.schema.json'
|
||||
- 'crates/tauri-schema-generator/schemas/*.json'
|
||||
|
||||
api:
|
||||
runs-on: ubuntu-latest
|
||||
needs: changes
|
||||
if: needs.changes.outputs.api == 'true'
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- run: npm i -g --force corepack
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 'lts/*'
|
||||
cache: 'pnpm'
|
||||
|
||||
- name: install deps
|
||||
run: pnpm i --frozen-lockfile
|
||||
- name: build api
|
||||
run: pnpm build
|
||||
working-directory: packages/api
|
||||
- name: check api
|
||||
run: ./.scripts/ci/has-diff.sh
|
||||
|
||||
schema:
|
||||
runs-on: ubuntu-latest
|
||||
needs: changes
|
||||
if: needs.changes.outputs.schema == 'true'
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: install stable
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
|
||||
- name: install Linux dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y libgtk-3-dev
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
|
||||
- name: generate schemas
|
||||
run: cargo build --manifest-path ./crates/tauri-schema-generator/Cargo.toml
|
||||
|
||||
- name: check schemas
|
||||
run: ./.scripts/ci/has-diff.sh
|
||||
28
.github/workflows/check-license-header.yml
vendored
28
.github/workflows/check-license-header.yml
vendored
@@ -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 }}
|
||||
30
.github/workflows/covector-comment-on-fork.yml
vendored
30
.github/workflows/covector-comment-on-fork.yml
vendored
@@ -1,30 +0,0 @@
|
||||
# Copyright 2019-2024 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
name: covector comment
|
||||
on:
|
||||
workflow_run:
|
||||
workflows: [covector status] # the `name` of the workflow run on `pull_request` running `status` with `comment: true`
|
||||
types:
|
||||
- completed
|
||||
|
||||
# note all other permissions are set to none if not specified
|
||||
# and these set the permissions for `secrets.GITHUB_TOKEN`
|
||||
permissions:
|
||||
# to read the action artifacts on `covector status` workflows
|
||||
actions: read
|
||||
# to write the comment
|
||||
pull-requests: write
|
||||
|
||||
jobs:
|
||||
comment:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event.workflow_run.conclusion == 'success' &&
|
||||
(github.event.workflow_run.head_repository.full_name != github.repository || github.actor == 'dependabot[bot]')
|
||||
steps:
|
||||
- name: covector status
|
||||
uses: jbolda/covector/packages/action@covector-v0
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
command: 'status'
|
||||
151
.github/workflows/covector-version-or-publish.yml
vendored
151
.github/workflows/covector-version-or-publish.yml
vendored
@@ -1,8 +1,8 @@
|
||||
# Copyright 2019-2024 Tauri Programme within The Commons Conservancy
|
||||
# Copyright 2019-2021 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:
|
||||
@@ -16,32 +16,82 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
platform: [ubuntu-latest, macos-latest, windows-latest]
|
||||
# platform: [ubuntu-latest, macos-latest, windows-latest]
|
||||
platform: [ubuntu-latest, macos-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 libgtk-3-dev webkit2gtk-4.0 libayatana-appindicator3-dev librsvg2-dev patchelf
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
- name: Get current date
|
||||
run: echo "CURRENT_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
|
||||
if: matrix.platform == 'macos-latest' || matrix.platform == 'ubuntu-latest'
|
||||
|
||||
- name: Get current date
|
||||
if: matrix.platform == 'windows-latest'
|
||||
run: echo "CURRENT_DATE=$(Get-Date -Format "yyyy-MM-dd")" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||
|
||||
- name: Cache cargo state
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: cargo_state
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/registry
|
||||
~/.cargo/git
|
||||
~/.cargo/bin
|
||||
key: ${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('**/Cargo.toml') }}-${{ env.CURRENT_DATE }}
|
||||
restore-keys: |
|
||||
${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('**/Cargo.toml') }}-
|
||||
${{ matrix.platform }}-stable-${{ env.cache-name }}-
|
||||
${{ matrix.platform }}-stable-
|
||||
${{ matrix.platform }}-
|
||||
|
||||
- name: Cache core cargo target
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: cargo_core
|
||||
with:
|
||||
path: target
|
||||
# Add date to the cache to keep it up to date
|
||||
key: ${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('core/**/Cargo.toml') }}-${{ env.CURRENT_DATE }}
|
||||
# Restore from outdated cache for speed
|
||||
restore-keys: |
|
||||
${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('core/**/Cargo.toml') }}
|
||||
${{ matrix.platform }}-stable-${{ env.cache-name }}-
|
||||
${{ matrix.platform }}-stable-
|
||||
${{ matrix.platform }}-
|
||||
|
||||
- name: Cache CLI cargo target
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: cargo_cli
|
||||
with:
|
||||
path: tooling/cli/target
|
||||
# Add date to the cache to keep it up to date
|
||||
key: ${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('tooling/cli/Cargo.lock') }}-${{ env.CURRENT_DATE }}
|
||||
# Restore from outdated cache for speed
|
||||
restore-keys: |
|
||||
${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('tooling/cli/Cargo.lock') }}
|
||||
${{ matrix.platform }}-stable-${{ env.cache-name }}-
|
||||
${{ matrix.platform }}-stable-
|
||||
${{ matrix.platform }}-
|
||||
|
||||
- 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 +99,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,48 +115,37 @@ 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: 'pnpm'
|
||||
cache: yarn
|
||||
cache-dependency-path: tooling/*/yarn.lock
|
||||
|
||||
- name: cargo login
|
||||
run: cargo login ${{ secrets.ORG_CRATES_IO_TOKEN }}
|
||||
run: cargo login ${{ secrets.crate_token }}
|
||||
- name: git config
|
||||
run: |
|
||||
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.4.1
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
branch: release/version-updates
|
||||
@@ -119,30 +153,21 @@ 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
|
||||
if: steps.covector.outputs.successfulPublish == 'true'
|
||||
uses: peter-evans/repository-dispatch@v1
|
||||
with:
|
||||
token: ${{ secrets.ORG_TAURI_BOT_PAT }}
|
||||
token: ${{ secrets.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 }}
|
||||
|
||||
- name: Trigger `tauri-cli` publishing workflow
|
||||
if: |
|
||||
steps.covector.outputs.successfulPublish == 'true' &&
|
||||
contains(steps.covector.outputs.packagesPublished, 'tauri-cli')
|
||||
run: gh workflow run 31554139 -r dev
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
contains(steps.covector.outputs.packagesPublished, 'cli.rs')
|
||||
uses: peter-evans/repository-dispatch@v1
|
||||
with:
|
||||
token: ${{ secrets.TAURI_BOT_PAT }}
|
||||
repository: tauri-apps/tauri
|
||||
event-type: publish-clijs
|
||||
|
||||
25
.github/workflows/deploy-schema-worker.yml
vendored
25
.github/workflows/deploy-schema-worker.yml
vendored
@@ -1,25 +0,0 @@
|
||||
# Copyright 2019-2024 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
name: deploy schema worker
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- dev
|
||||
paths:
|
||||
- '.github/workflows/deploy-schema-worker.yml'
|
||||
- 'crates/tauri-schema-worker/**'
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: cloudflare/wrangler-action@v3
|
||||
with:
|
||||
command: deploy
|
||||
workingDirectory: 'crates/tauri-schema-worker'
|
||||
apiToken: ${{ secrets.SCHEMA_WORKER_CLOUDFLARE_API_TOKEN }}
|
||||
accountId: ${{ secrets.SCHEMA_WORKER_CLOUDFLARE_ACCOUNT_ID }}
|
||||
130
.github/workflows/docker.yml
vendored
130
.github/workflows/docker.yml
vendored
@@ -1,130 +0,0 @@
|
||||
# Copyright 2019-2024 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
name: docker
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
#pull_request:
|
||||
# paths:
|
||||
# - '.docker/**'
|
||||
# - '.github/workflows/docker.yml'
|
||||
|
||||
jobs:
|
||||
setup:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: install stable
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
|
||||
- name: install Linux dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y libgtk-3-dev
|
||||
|
||||
- name: install cross
|
||||
run: cargo install cross --git https://github.com/cross-rs/cross
|
||||
|
||||
- name: Upload cross
|
||||
uses: actions/upload-artifact@v4
|
||||
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
|
||||
|
||||
- name: Upload CLI
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: cargo-tauri
|
||||
path: crates/tauri-cli/target/debug/cargo-tauri
|
||||
if-no-files-found: error
|
||||
|
||||
docker:
|
||||
needs: setup
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
target:
|
||||
- { name: 'aarch64-unknown-linux-gnu', filename: 'aarch64' }
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: install stable
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
targets: ${{ matrix.target.name }}
|
||||
|
||||
- run: npm i -g --force corepack
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 'lts/*'
|
||||
|
||||
- name: Download cross
|
||||
uses: actions/download-artifact@v4.1.7
|
||||
with:
|
||||
name: cross
|
||||
path: '~/.cargo/bin'
|
||||
|
||||
- name: Download CLI
|
||||
uses: actions/download-artifact@v4.1.7
|
||||
with:
|
||||
name: cargo-tauri
|
||||
path: 'examples/api'
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Build and export to Docker
|
||||
uses: docker/build-push-action@v3
|
||||
with:
|
||||
context: .docker/cross
|
||||
file: .docker/cross/${{ matrix.target.filename }}.Dockerfile
|
||||
load: true
|
||||
tags: ${{ matrix.target.name }}:latest
|
||||
|
||||
- name: install dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y webkit2gtk-4.1 libayatana-appindicator3-dev
|
||||
|
||||
- name: Test
|
||||
run: |
|
||||
cd packages/api
|
||||
pnpm i --frozen-lockfile && pnpm build
|
||||
cd ../../examples/api
|
||||
pnpm i --frozen-lockfile
|
||||
. .setup-cross.sh
|
||||
chmod +x cargo-tauri
|
||||
chmod +x $HOME/.cargo/bin/cross
|
||||
./cargo-tauri build --runner cross --bundles deb --target ${{ matrix.target.name }} --verbose
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v3
|
||||
with:
|
||||
context: .docker/cross
|
||||
file: .docker/cross/${{ matrix.target.filename }}.Dockerfile
|
||||
push: true
|
||||
tags: ghcr.io/${{ github.repository }}/${{ matrix.target.name }}:latest
|
||||
51
.github/workflows/fmt.yml
vendored
51
.github/workflows/fmt.yml
vendored
@@ -1,51 +0,0 @@
|
||||
# Copyright 2019-2024 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
name: check formatting
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
rustfmt:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: install Rust stable and rustfmt
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
components: rustfmt
|
||||
|
||||
- name: run cargo fmt
|
||||
run: cargo fmt --all -- --check
|
||||
|
||||
prettier:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- run: npm i -g --force corepack
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 'lts/*'
|
||||
cache: 'pnpm'
|
||||
- run: pnpm i --frozen-lockfile
|
||||
- run: pnpm format:check
|
||||
|
||||
taplo:
|
||||
name: taplo (.toml files)
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: install Rust stable
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
|
||||
- name: install taplo-cli
|
||||
uses: taiki-e/install-action@v2
|
||||
with:
|
||||
tool: taplo-cli
|
||||
|
||||
- run: taplo fmt --check --diff
|
||||
101
.github/workflows/lint-fmt-cli.yml
vendored
Normal file
101
.github/workflows/lint-fmt-cli.yml
vendored
Normal file
@@ -0,0 +1,101 @@
|
||||
# Copyright 2019-2021 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_INCREMENTAL: 0 # This is set to 0 by the https://github.com/Swatinem/rust-cache
|
||||
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 Linux dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y libgtk-3-dev
|
||||
|
||||
- name: Get current date
|
||||
run: echo "CURRENT_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
|
||||
|
||||
- name: Cache cargo state
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: cargo_state
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/registry
|
||||
~/.cargo/git
|
||||
~/.cargo/bin
|
||||
key: ubuntu-latest-stable-${{ env.cache-name }}-${{ hashFiles('**/Cargo.toml') }}-${{ env.CURRENT_DATE }}
|
||||
restore-keys: |
|
||||
ubuntu-latest-stable-${{ env.cache-name }}-${{ hashFiles('**/Cargo.toml') }}-
|
||||
ubuntu-latest-stable-${{ env.cache-name }}-
|
||||
ubuntu-latest-stable-
|
||||
ubuntu-latest-
|
||||
|
||||
- name: Cache CLI cargo target
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: cargo_cli
|
||||
with:
|
||||
path: tooling/cli/target
|
||||
# Add date to the cache to keep it up to date
|
||||
key: ubuntu-latest-stable-${{ env.cache-name }}-${{ hashFiles('tooling/cli/Cargo.lock') }}-${{ env.CURRENT_DATE }}
|
||||
# Restore from outdated cache for speed
|
||||
restore-keys: |
|
||||
ubuntu-latest-stable-${{ env.cache-name }}-${{ hashFiles('tooling/cli/Cargo.lock') }}
|
||||
ubuntu-latest-stable-${{ env.cache-name }}-
|
||||
ubuntu-latest-stable-
|
||||
ubuntu-latest-
|
||||
|
||||
- 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
|
||||
116
.github/workflows/lint-fmt-core.yml
vendored
Normal file
116
.github/workflows/lint-fmt-core.yml
vendored
Normal file
@@ -0,0 +1,116 @@
|
||||
# Copyright 2019-2021 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/**'
|
||||
- 'examples/**'
|
||||
|
||||
env:
|
||||
RUST_BACKTRACE: 1
|
||||
CARGO_INCREMENTAL: 0 # This is set to 0 by the https://github.com/Swatinem/rust-cache
|
||||
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,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 webkit2gtk
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libayatana-appindicator3-dev librsvg2-dev patchelf
|
||||
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: minimal
|
||||
toolchain: stable
|
||||
override: true
|
||||
components: clippy
|
||||
|
||||
- name: Get current date
|
||||
run: echo "CURRENT_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
|
||||
if: matrix.platform == 'macos-latest' || matrix.platform == 'ubuntu-latest'
|
||||
|
||||
- name: Get current date
|
||||
if: matrix.platform == 'windows-latest'
|
||||
run: echo "CURRENT_DATE=$(Get-Date -Format "yyyy-MM-dd")" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||
|
||||
- name: Cache cargo state
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: cargo_state
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/registry
|
||||
~/.cargo/git
|
||||
~/.cargo/bin
|
||||
key: ubuntu-latest-stable-${{ env.cache-name }}-${{ hashFiles('**/Cargo.toml') }}-${{ env.CURRENT_DATE }}
|
||||
restore-keys: |
|
||||
ubuntu-latest-stable-${{ env.cache-name }}-${{ hashFiles('**/Cargo.toml') }}-
|
||||
ubuntu-latest-stable-${{ env.cache-name }}-
|
||||
ubuntu-latest-stable-
|
||||
ubuntu-latest-
|
||||
|
||||
- name: Cache core cargo target
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: cargo_core
|
||||
with:
|
||||
path: target
|
||||
# Add date to the cache to keep it up to date
|
||||
key: ubuntu-latest-stable-${{ env.cache-name }}-${{ hashFiles('core/**/Cargo.toml') }}-${{ env.CURRENT_DATE }}
|
||||
# Restore from outdated cache for speed
|
||||
restore-keys: |
|
||||
ubuntu-latest-stable-${{ env.cache-name }}-${{ hashFiles('core/**/Cargo.toml') }}
|
||||
ubuntu-latest-stable-${{ env.cache-name }}-
|
||||
ubuntu-latest-stable-
|
||||
ubuntu-latest-
|
||||
|
||||
- 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 }}
|
||||
51
.github/workflows/lint-js.yml
vendored
51
.github/workflows/lint-js.yml
vendored
@@ -1,40 +1,47 @@
|
||||
# Copyright 2019-2024 Tauri Programme within The Commons Conservancy
|
||||
# Copyright 2019-2021 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
|
||||
|
||||
43
.github/workflows/lint-rust.yml
vendored
43
.github/workflows/lint-rust.yml
vendored
@@ -1,43 +0,0 @@
|
||||
# Copyright 2019-2024 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
name: lint rust
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- dev
|
||||
pull_request:
|
||||
paths:
|
||||
- '.github/workflows/lint-rust.yml'
|
||||
- 'crates/**'
|
||||
|
||||
env:
|
||||
RUST_BACKTRACE: 1
|
||||
CARGO_PROFILE_DEV_DEBUG: 0 # This would add unnecessary bloat to the target folder, decreasing cache efficiency.
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
clippy:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: install rust stable and clippy
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
components: clippy
|
||||
|
||||
- name: install dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.1 libayatana-appindicator3-dev
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
|
||||
- run: cargo clippy --all-targets --all-features -- -D warnings
|
||||
95
.github/workflows/publish-cli-rs.yml
vendored
95
.github/workflows/publish-cli-rs.yml
vendored
@@ -1,95 +0,0 @@
|
||||
# Copyright 2019-2024 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
name: publish `tauri-cli`
|
||||
env:
|
||||
MACOSX_DEPLOYMENT_TARGET: '10.13'
|
||||
on:
|
||||
workflow_dispatch:
|
||||
repository_dispatch:
|
||||
types: [publish-clirs]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ${{ matrix.config.os }}
|
||||
|
||||
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: ''
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: 'Setup Rust'
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
targets: ${{ matrix.config.rust_target }}
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
key: ${{ matrix.config.rust_target }}
|
||||
|
||||
- name: install Linux dependencies
|
||||
if: matrix.config.os == '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: Upload CLI
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: cargo-tauri-${{ matrix.config.rust_target }}${{ matrix.config.ext }}
|
||||
path: target/release-size-optimized/cargo-tauri${{ matrix.config.ext }}
|
||||
if-no-files-found: error
|
||||
|
||||
upload:
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Download built CLIs
|
||||
uses: actions/download-artifact@v4.1.7
|
||||
with:
|
||||
path: outputs
|
||||
|
||||
- name: Pack archives
|
||||
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
|
||||
|
||||
- name: Publish release
|
||||
uses: softprops/action-gh-release@50195ba7f6f93d1ac97ba8332a178e008ad176aa
|
||||
with:
|
||||
tag_name: tauri-cli-v${{ env.CLI_VERSION }}
|
||||
files: |
|
||||
outputs/cargo-tauri-*.zip
|
||||
outputs/cargo-tauri-*.tgz
|
||||
@@ -1,24 +1,16 @@
|
||||
# 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
|
||||
MACOSX_DEPLOYMENT_TARGET: '10.13'
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
releaseId:
|
||||
description: 'ID of the `@tauri-apps/cli` 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 +22,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 +127,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 +152,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 +160,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 +169,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 +190,36 @@ 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:
|
||||
- '12'
|
||||
- '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 +228,36 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
node:
|
||||
- '12'
|
||||
- '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 libgtk-3-dev webkit2gtk-4.0 libayatana-appindicator3-dev librsvg2-dev patchelf
|
||||
- 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 +266,45 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
node:
|
||||
- '12'
|
||||
- '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 patchelf librsvg-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 +314,33 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
node:
|
||||
- '12'
|
||||
- '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 libgtk-3-dev webkit2gtk-4.0 libayatana-appindicator3-dev librsvg2-dev patchelf
|
||||
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,3 @@ 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
|
||||
58
.github/workflows/publish-hotfix.yml
vendored
Normal file
58
.github/workflows/publish-hotfix.yml
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
# Copyright 2019-2021 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
name: version or publish
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- '1.*'
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 65
|
||||
outputs:
|
||||
change: ${{ steps.covector.outputs.change }}
|
||||
commandRan: ${{ steps.covector.outputs.commandRan }}
|
||||
successfulPublish: ${{ steps.covector.outputs.successfulPublish }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 14
|
||||
registry-url: 'https://registry.npmjs.org'
|
||||
cache: yarn
|
||||
cache-dependency-path: tooling/*/yarn.lock
|
||||
|
||||
- name: cargo login
|
||||
run: cargo login ${{ secrets.ORG_CRATES_IO_TOKEN }}
|
||||
- name: git config
|
||||
run: |
|
||||
git config --global user.name "${{ github.event.pusher.name }}"
|
||||
git config --global user.email "${{ github.event.pusher.email }}"
|
||||
|
||||
- name: covector version or publish (publish when no change files present)
|
||||
uses: jbolda/covector/packages/action@covector-v0
|
||||
id: covector
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.ORG_NPM_TOKEN }}
|
||||
CARGO_AUDIT_OPTIONS: ${{ secrets.CARGO_AUDIT_OPTIONS }}
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
command: 'version-or-publish'
|
||||
createRelease: true
|
||||
|
||||
- name: Trigger cli.js publishing workflow
|
||||
if: |
|
||||
steps.covector.outputs.successfulPublish == 'true' &&
|
||||
contains(steps.covector.outputs.packagesPublished, 'cli.rs')
|
||||
uses: peter-evans/repository-dispatch@v1
|
||||
with:
|
||||
token: ${{ secrets.TAURI_BOT_PAT }}
|
||||
repository: tauri-apps/tauri
|
||||
event-type: publish-clijs
|
||||
44
.github/workflows/supply-chain.yml
vendored
44
.github/workflows/supply-chain.yml
vendored
@@ -1,44 +0,0 @@
|
||||
# Copyright 2019-2024 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
name: supply chain health status
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: '0 0 * * *'
|
||||
push:
|
||||
branches:
|
||||
- dev
|
||||
paths:
|
||||
- '.github/workflows/supply-chain.yml'
|
||||
- '**/Cargo.lock'
|
||||
- '**/Cargo.toml'
|
||||
jobs:
|
||||
cargo-vet:
|
||||
name: check rust dependencies with cargo vet
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CARGO_VET_VERSION: 0.9.1
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
- name: Install Rust
|
||||
run: rustup update stable && rustup default stable
|
||||
|
||||
- uses: actions/cache@v4
|
||||
with:
|
||||
path: ${{ runner.tool_cache }}/cargo-vet
|
||||
key: cargo-vet-bin-${{ env.CARGO_VET_VERSION }}
|
||||
|
||||
- name: Add the tool cache directory to the search path
|
||||
run: echo "${{ runner.tool_cache }}/cargo-vet/bin" >> $GITHUB_PATH
|
||||
|
||||
- name: Ensure that the tool cache is populated with the cargo-vet binary
|
||||
run: cargo install --root ${{ runner.tool_cache }}/cargo-vet --version ${{ env.CARGO_VET_VERSION }} cargo-vet
|
||||
|
||||
# Enable this again to break the workflow once we have a reasonable amount of suggestions to get to a clean base line
|
||||
# - name: Invoke cargo-vet
|
||||
# run: cargo vet --locked
|
||||
|
||||
- name: Provide audit suggestions
|
||||
run: cargo vet suggest
|
||||
106
.github/workflows/test-android.yml
vendored
106
.github/workflows/test-android.yml
vendored
@@ -1,106 +0,0 @@
|
||||
# Copyright 2019-2024 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
name: test android
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- '.github/workflows/test-android.yml'
|
||||
- 'crates/tauri-cli/templates/mobile/android/**'
|
||||
- 'crates/tauri-cli/src/mobile/**'
|
||||
- '!crates/tauri-cli/src/mobile/ios.rs'
|
||||
- '!crates/tauri-cli/src/mobile/ios/**'
|
||||
- 'crates/tauri-build/src/mobile.rs'
|
||||
- 'crates/tauri/mobile/android/**'
|
||||
- 'crates/tauri/mobile/android-codegen/**'
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ${{ matrix.platform }}
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
platform: [ubuntu-latest, macos-latest, windows-latest]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: install Rust 1.77.2
|
||||
uses: dtolnay/rust-toolchain@1.77.2
|
||||
|
||||
- name: install Linux dependencies
|
||||
if: matrix.platform == 'ubuntu-latest'
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.1
|
||||
|
||||
- run: npm i -g --force corepack
|
||||
- name: setup node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: lts/*
|
||||
cache: 'pnpm'
|
||||
|
||||
- uses: actions/setup-java@v3
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: 17
|
||||
cache: 'gradle'
|
||||
|
||||
- name: Setup NDK
|
||||
uses: nttld/setup-ndk@v1
|
||||
id: setup-ndk
|
||||
with:
|
||||
ndk-version: r25b
|
||||
local-cache: true
|
||||
|
||||
# TODO check after https://github.com/nttld/setup-ndk/issues/518 is fixed
|
||||
- name: Restore Android Symlinks
|
||||
if: matrix.platform == 'ubuntu-latest' || matrix.platform == 'macos-latest'
|
||||
run: |
|
||||
directory="${{ steps.setup-ndk.outputs.ndk-path }}/toolchains/llvm/prebuilt/linux-x86_64/bin"
|
||||
find "$directory" -type l | while read link; do
|
||||
current_target=$(readlink "$link")
|
||||
new_target="$directory/$(basename "$current_target")"
|
||||
ln -sf "$new_target" "$link"
|
||||
echo "Changed $(basename "$link") from $current_target to $new_target"
|
||||
done
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
|
||||
- name: build CLI
|
||||
run: cargo build --manifest-path ./crates/tauri-cli/Cargo.toml
|
||||
|
||||
- name: move CLI to cargo bin dir
|
||||
if: matrix.platform != 'windows-latest'
|
||||
run: mv ./target/debug/cargo-tauri $HOME/.cargo/bin
|
||||
|
||||
- name: move CLI to cargo bin dir
|
||||
if: matrix.platform == 'windows-latest'
|
||||
run: mv ./target/debug/cargo-tauri.exe $HOME/.cargo/bin
|
||||
|
||||
- run: pnpm i --frozen-lockfile
|
||||
|
||||
- name: build Tauri API
|
||||
working-directory: ./packages/api
|
||||
run: pnpm build
|
||||
|
||||
- name: init Android Studio project
|
||||
working-directory: ./examples/api
|
||||
run: cargo tauri android init
|
||||
env:
|
||||
NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
|
||||
|
||||
- name: build APK
|
||||
working-directory: ./examples/api
|
||||
run: cargo tauri android build
|
||||
env:
|
||||
NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
|
||||
161
.github/workflows/test-bundler.yml
vendored
Normal file
161
.github/workflows/test-bundler.yml
vendored
Normal file
@@ -0,0 +1,161 @@
|
||||
# Copyright 2019-2021 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_INCREMENTAL: 0 # This is set to 0 by the https://github.com/Swatinem/rust-cache
|
||||
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
|
||||
|
||||
- name: Get current date
|
||||
run: echo "CURRENT_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
|
||||
if: matrix.platform == 'macos-latest' || matrix.platform == 'ubuntu-latest'
|
||||
|
||||
- name: Get current date
|
||||
if: matrix.platform == 'windows-latest'
|
||||
run: echo "CURRENT_DATE=$(Get-Date -Format "yyyy-MM-dd")" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||
|
||||
- name: Cache cargo state
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: cargo_state
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/registry
|
||||
~/.cargo/git
|
||||
~/.cargo/bin
|
||||
key: ${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('**/Cargo.toml') }}-${{ env.CURRENT_DATE }}
|
||||
restore-keys: |
|
||||
${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('**/Cargo.toml') }}-
|
||||
${{ matrix.platform }}-stable-${{ env.cache-name }}-
|
||||
${{ matrix.platform }}-stable-
|
||||
${{ matrix.platform }}-
|
||||
|
||||
- name: Cache bundler cargo target
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: cargo_bundler
|
||||
with:
|
||||
path: tooling/bundler/target
|
||||
# Add date to the cache to keep it up to date
|
||||
key: ${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('tooling/bundler/Cargo.lock') }}-${{ env.CURRENT_DATE }}
|
||||
# Restore from outdated cache for speed
|
||||
restore-keys: |
|
||||
${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('tooling/bundler/Cargo.lock') }}
|
||||
${{ matrix.platform }}-stable-${{ env.cache-name }}-
|
||||
${{ matrix.platform }}-stable-
|
||||
${{ matrix.platform }}-
|
||||
|
||||
- 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
|
||||
components: rustfmt, clippy
|
||||
|
||||
- name: Get current date
|
||||
run: echo "CURRENT_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
|
||||
if: matrix.platform == 'macos-latest' || matrix.platform == 'ubuntu-latest'
|
||||
|
||||
- name: Get current date
|
||||
if: matrix.platform == 'windows-latest'
|
||||
run: echo "CURRENT_DATE=$(Get-Date -Format "yyyy-MM-dd")" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||
|
||||
- name: Cache cargo state
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: cargo_state
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/registry
|
||||
~/.cargo/git
|
||||
~/.cargo/bin
|
||||
key: ${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('**/Cargo.toml') }}-${{ env.CURRENT_DATE }}
|
||||
restore-keys: |
|
||||
${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('**/Cargo.toml') }}-
|
||||
${{ matrix.platform }}-stable-${{ env.cache-name }}-
|
||||
${{ matrix.platform }}-stable-
|
||||
${{ matrix.platform }}-
|
||||
|
||||
- name: Cache bundler cargo target
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: cargo_bundler
|
||||
with:
|
||||
path: tooling/bundler/target
|
||||
# Add date to the cache to keep it up to date
|
||||
key: ${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('tooling/bundler/Cargo.lock') }}-${{ env.CURRENT_DATE }}
|
||||
# Restore from outdated cache for speed
|
||||
restore-keys: |
|
||||
${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('tooling/bundler/Cargo.lock') }}
|
||||
${{ matrix.platform }}-stable-${{ env.cache-name }}-
|
||||
${{ matrix.platform }}-stable-
|
||||
${{ matrix.platform }}-
|
||||
|
||||
- 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
|
||||
96
.github/workflows/test-cli-js.yml
vendored
96
.github/workflows/test-cli-js.yml
vendored
@@ -1,22 +1,23 @@
|
||||
# Copyright 2019-2024 Tauri Programme within The Commons Conservancy
|
||||
# Copyright 2019-2021 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
|
||||
CARGO_INCREMENTAL: 0 # This is set to 0 by the https://github.com/Swatinem/rust-cache
|
||||
CARGO_PROFILE_DEV_DEBUG: 0 # This would add unnecessary bloat to the target folder, decreasing cache efficiency.
|
||||
|
||||
concurrency:
|
||||
@@ -24,7 +25,7 @@ concurrency:
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
test:
|
||||
test-tauri-js-cli:
|
||||
runs-on: ${{ matrix.platform }}
|
||||
|
||||
strategy:
|
||||
@@ -33,30 +34,83 @@ 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 libgtk-3-dev webkit2gtk-4.0 libayatana-appindicator3-dev librsvg2-dev patchelf
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
- name: Get current date
|
||||
run: echo "CURRENT_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
|
||||
if: matrix.platform == 'macos-latest' || matrix.platform == 'ubuntu-latest'
|
||||
|
||||
- name: Get current date
|
||||
if: matrix.platform == 'windows-latest'
|
||||
run: echo "CURRENT_DATE=$(Get-Date -Format "yyyy-MM-dd")" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||
|
||||
- name: Cache cargo state
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: cargo_state
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/registry
|
||||
~/.cargo/git
|
||||
~/.cargo/bin
|
||||
key: ${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('**/Cargo.toml') }}-${{ env.CURRENT_DATE }}
|
||||
restore-keys: |
|
||||
${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('**/Cargo.toml') }}-
|
||||
${{ matrix.platform }}-stable-${{ env.cache-name }}-
|
||||
${{ matrix.platform }}-stable-
|
||||
${{ matrix.platform }}-
|
||||
|
||||
- name: Cache CLI cargo target
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: cargo_cli
|
||||
with:
|
||||
path: tooling/cli/target
|
||||
# Add date to the cache to keep it up to date
|
||||
key: ${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('tooling/cli/Cargo.lock') }}-${{ env.CURRENT_DATE }}
|
||||
# Restore from outdated cache for speed
|
||||
restore-keys: |
|
||||
${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('tooling/cli/Cargo.lock') }}
|
||||
${{ matrix.platform }}-stable-${{ env.cache-name }}-
|
||||
${{ matrix.platform }}-stable-
|
||||
${{ matrix.platform }}-
|
||||
|
||||
- name: Cache template cargo target
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: cargo_template
|
||||
with:
|
||||
path: tooling/cli/node/test/jest/fixtures/empty/src-tauri/target
|
||||
# Add date to the cache to keep it up to date
|
||||
key: ${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('tooling/cli/templates/app/**') }}-${{ env.CURRENT_DATE }}
|
||||
# Restore from outdated cache for speed
|
||||
restore-keys: |
|
||||
${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('tooling/cli/templates/app/**') }}
|
||||
${{ matrix.platform }}-stable-${{ env.cache-name }}-
|
||||
${{ matrix.platform }}-stable-
|
||||
${{ matrix.platform }}-
|
||||
|
||||
- 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
|
||||
|
||||
84
.github/workflows/test-cli-rs.yml
vendored
84
.github/workflows/test-cli-rs.yml
vendored
@@ -1,22 +1,22 @@
|
||||
# Copyright 2019-2024 Tauri Programme within The Commons Conservancy
|
||||
# Copyright 2019-2021 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
|
||||
CARGO_INCREMENTAL: 0 # This is set to 0 by the https://github.com/Swatinem/rust-cache
|
||||
CARGO_PROFILE_DEV_DEBUG: 0 # This would add unnecessary bloat to the target folder, decreasing cache efficiency.
|
||||
|
||||
concurrency:
|
||||
@@ -24,37 +24,69 @@ 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
|
||||
|
||||
- name: 'Setup Rust'
|
||||
uses: dtolnay/rust-toolchain@1.77.2
|
||||
- uses: actions/checkout@v2
|
||||
- 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
|
||||
- name: Get current date
|
||||
run: echo "CURRENT_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
|
||||
if: matrix.platform == 'macos-latest' || matrix.platform == 'ubuntu-latest'
|
||||
|
||||
- name: test CLI
|
||||
run: cargo test --manifest-path ./crates/tauri-cli/Cargo.toml ${{ matrix.platform.args }}
|
||||
- name: Get current date
|
||||
if: matrix.platform == 'windows-latest'
|
||||
run: echo "CURRENT_DATE=$(Get-Date -Format "yyyy-MM-dd")" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||
|
||||
- name: Cache cargo state
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: cargo_state
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/registry
|
||||
~/.cargo/git
|
||||
~/.cargo/bin
|
||||
key: ${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('**/Cargo.toml') }}-${{ env.CURRENT_DATE }}
|
||||
restore-keys: |
|
||||
${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('**/Cargo.toml') }}-
|
||||
${{ matrix.platform }}-stable-${{ env.cache-name }}-
|
||||
${{ matrix.platform }}-stable-
|
||||
${{ matrix.platform }}-
|
||||
|
||||
- name: Cache CLI cargo target
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: cargo_cli
|
||||
with:
|
||||
path: tooling/cli/target
|
||||
# Add date to the cache to keep it up to date
|
||||
key: ${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('tooling/cli/Cargo.lock') }}-${{ env.CURRENT_DATE }}
|
||||
# Restore from outdated cache for speed
|
||||
restore-keys: |
|
||||
${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('tooling/cli/Cargo.lock') }}
|
||||
${{ matrix.platform }}-stable-${{ env.cache-name }}-
|
||||
${{ matrix.platform }}-stable-
|
||||
${{ matrix.platform }}-
|
||||
|
||||
- name: build CLI
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: build
|
||||
args: --manifest-path ./tooling/cli/Cargo.toml
|
||||
|
||||
122
.github/workflows/test-core.yml
vendored
122
.github/workflows/test-core.yml
vendored
@@ -1,4 +1,4 @@
|
||||
# Copyright 2019-2024 Tauri Programme within The Commons Conservancy
|
||||
# Copyright 2019-2021 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
@@ -8,18 +8,17 @@ 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/**'
|
||||
- 'examples/**'
|
||||
- 'tooling/cli/**'
|
||||
|
||||
env:
|
||||
RUST_BACKTRACE: 1
|
||||
CARGO_INCREMENTAL: 0 # This is set to 0 by the https://github.com/Swatinem/rust-cache
|
||||
CARGO_PROFILE_DEV_DEBUG: 0 # This would add unnecessary bloat to the target folder, decreasing cache efficiency.
|
||||
|
||||
concurrency:
|
||||
@@ -27,78 +26,67 @@ concurrency:
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ${{ matrix.platform.os }}
|
||||
test-tauri-core:
|
||||
runs-on: ${{ matrix.platform }}
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
platform:
|
||||
- {
|
||||
target: x86_64-pc-windows-msvc,
|
||||
os: windows-latest,
|
||||
toolchain: '1.77.2',
|
||||
cross: false,
|
||||
command: 'test'
|
||||
}
|
||||
- {
|
||||
target: x86_64-unknown-linux-gnu,
|
||||
os: ubuntu-latest,
|
||||
toolchain: '1.77.2',
|
||||
cross: false,
|
||||
command: 'test'
|
||||
}
|
||||
- {
|
||||
target: aarch64-apple-darwin,
|
||||
os: macos-14,
|
||||
toolchain: '1.77.2',
|
||||
cross: false,
|
||||
command: 'test'
|
||||
}
|
||||
- {
|
||||
target: aarch64-apple-ios,
|
||||
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'
|
||||
}
|
||||
features:
|
||||
- { args: --no-default-features, key: no-default }
|
||||
- { args: --all-features, key: all }
|
||||
platform: [ubuntu-latest, macos-latest, windows-latest]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: install Rust
|
||||
uses: dtolnay/rust-toolchain@master
|
||||
- uses: actions/checkout@v2
|
||||
- name: install stable
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: ${{ matrix.platform.toolchain }}
|
||||
targets: ${{ matrix.platform.target }}
|
||||
|
||||
toolchain: stable
|
||||
- name: install Linux dependencies
|
||||
if: contains(matrix.platform.target, 'unknown-linux')
|
||||
if: matrix.platform == 'ubuntu-latest'
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y webkit2gtk-4.1 libxdo-dev libayatana-appindicator3-dev
|
||||
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libayatana-appindicator3-dev librsvg2-dev patchelf
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
- name: Get current date
|
||||
run: echo "CURRENT_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
|
||||
if: matrix.platform == 'macos-latest' || matrix.platform == 'ubuntu-latest'
|
||||
|
||||
- name: Get current date
|
||||
if: matrix.platform == 'windows-latest'
|
||||
run: echo "CURRENT_DATE=$(Get-Date -Format "yyyy-MM-dd")" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||
|
||||
- name: Cache cargo state
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: cargo_state
|
||||
with:
|
||||
prefix-key: v3
|
||||
save-if: ${{ matrix.features.key == 'all' }}
|
||||
path: |
|
||||
~/.cargo/registry
|
||||
~/.cargo/git
|
||||
~/.cargo/bin
|
||||
key: ${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('**/Cargo.toml') }}-${{ env.CURRENT_DATE }}
|
||||
restore-keys: |
|
||||
${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('**/Cargo.toml') }}-
|
||||
${{ matrix.platform }}-stable-${{ env.cache-name }}-
|
||||
${{ matrix.platform }}-stable-
|
||||
${{ matrix.platform }}-
|
||||
|
||||
- name: Cache core cargo target
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: cargo_core
|
||||
with:
|
||||
path: target
|
||||
# Add date to the cache to keep it up to date
|
||||
key: ${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('core/**/Cargo.toml') }}-${{ env.CURRENT_DATE }}
|
||||
# Restore from outdated cache for speed
|
||||
restore-keys: |
|
||||
${{ matrix.platform }}-stable-${{ env.cache-name }}-${{ hashFiles('core/**/Cargo.toml') }}
|
||||
${{ matrix.platform }}-stable-${{ env.cache-name }}-
|
||||
${{ matrix.platform }}-stable-
|
||||
${{ matrix.platform }}-
|
||||
|
||||
- name: test
|
||||
if: ${{ !matrix.platform.cross }}
|
||||
run: cargo ${{ 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.platform.command }} --target ${{ matrix.platform.target }} ${{ matrix.features.args }} --manifest-path crates/tauri/Cargo.toml
|
||||
cargo test
|
||||
cargo test --features api-all
|
||||
cargo test --features compression,wry,isolation,custom-protocol,api-all,cli,updater,system-tray,windows7-compat,http-multipart
|
||||
|
||||
220
.github/workflows/udeps.yml
vendored
220
.github/workflows/udeps.yml
vendored
@@ -1,16 +1,20 @@
|
||||
# Copyright 2019-2024 Tauri Programme within The Commons Conservancy
|
||||
# Copyright 2019-2021 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
name: Udeps
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- dev
|
||||
pull_request:
|
||||
paths:
|
||||
- '.github/workflows/udeps.yml'
|
||||
- 'core/**'
|
||||
- 'tooling/bundler/**'
|
||||
- 'tooling/cli/**'
|
||||
|
||||
env:
|
||||
RUST_BACKTRACE: 1
|
||||
CARGO_INCREMENTAL: 0 # This is set to 0 by the https://github.com/Swatinem/rust-cache
|
||||
CARGO_PROFILE_DEV_DEBUG: 0 # This would add unnecessary bloat to the target folder, decreasing cache efficiency.
|
||||
|
||||
concurrency:
|
||||
@@ -18,137 +22,115 @@ concurrency:
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
changes:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
tauri: ${{ steps.filter.outputs.tauri }}
|
||||
build: ${{ steps.filter.outputs.build }}
|
||||
codegen: ${{ steps.filter.outputs.codegen }}
|
||||
macros: ${{ steps.filter.outputs.macros }}
|
||||
runtime: ${{ steps.filter.outputs.runtime }}
|
||||
wry: ${{ steps.filter.outputs.wry }}
|
||||
utils: ${{ steps.filter.outputs.utils }}
|
||||
bundler: ${{ steps.filter.outputs.bundler }}
|
||||
cli: ${{ steps.filter.outputs.cli }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: dorny/paths-filter@v3
|
||||
id: filter
|
||||
with:
|
||||
filters: |
|
||||
tauri:
|
||||
- 'crates/tauri/**'
|
||||
- '!crates/tauri/scripts/**'
|
||||
build:
|
||||
- 'crates/tauri-build/**'
|
||||
codegen:
|
||||
- 'crates/tauri-codegen/**'
|
||||
macros:
|
||||
- 'crates/tauri-macros/**'
|
||||
runtime:
|
||||
- 'crates/tauri-runtime/**'
|
||||
wry:
|
||||
- 'crates/tauri-runtime-wry/**'
|
||||
utils:
|
||||
- 'crates/tauri-utils/**'
|
||||
bundler:
|
||||
- 'crates/tauri-bundler/**'
|
||||
cli:
|
||||
- 'crates/tauri-cli/**'
|
||||
macossign:
|
||||
- 'crates/tauri-macos-sign/**'
|
||||
|
||||
setup:
|
||||
runs-on: ubuntu-latest
|
||||
needs: changes
|
||||
if: |
|
||||
needs.changes.outputs.tauri == 'true' ||
|
||||
needs.changes.outputs.build == 'true' ||
|
||||
needs.changes.outputs.codegen == 'true' ||
|
||||
needs.changes.outputs.macros == 'true' ||
|
||||
needs.changes.outputs.runtime == 'true' ||
|
||||
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'
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install Rust nightly
|
||||
uses: dtolnay/rust-toolchain@nightly
|
||||
|
||||
- name: Install udeps
|
||||
run: cargo install cargo-udeps --locked --force
|
||||
|
||||
- name: Upload udeps
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: udeps
|
||||
path: '~/.cargo/bin/cargo-udeps'
|
||||
if-no-files-found: error
|
||||
|
||||
- name: Create udeps matrix
|
||||
id: create-matrix
|
||||
env:
|
||||
TAURI: ${{ needs.changes.outputs.tauri == 'true' }}
|
||||
BUILD: ${{ needs.changes.outputs.build == 'true' }}
|
||||
CODEGEN: ${{ needs.changes.outputs.codegen == 'true' }}
|
||||
MACROS: ${{ needs.changes.outputs.macros == 'true' }}
|
||||
RUNTIME: ${{ needs.changes.outputs.runtime == 'true' }}
|
||||
WRY: ${{ needs.changes.outputs.wry == 'true' }}
|
||||
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"
|
||||
outputs:
|
||||
matrix: ${{ steps.create-matrix.outputs.matrix }}
|
||||
|
||||
udeps:
|
||||
runs-on: ubuntu-latest
|
||||
needs: setup
|
||||
strategy:
|
||||
matrix:
|
||||
path: ${{ fromJson(needs.setup.outputs.matrix) }}
|
||||
clippy:
|
||||
- {
|
||||
path: './core/tauri/Cargo.toml',
|
||||
args: '--features compression,wry,isolation,custom-protocol,api-all,cli,updater,system-tray,windows7-compat,http-multipart'
|
||||
}
|
||||
- { path: './core/tauri-build/Cargo.toml', args: '--all-features' }
|
||||
- { path: './core/tauri-codegen/Cargo.toml', args: '--all-features' }
|
||||
- { path: './core/tauri-macros/Cargo.toml', args: '--all-features' }
|
||||
- { path: './core/tauri-runtime/Cargo.toml', args: '--all-features' }
|
||||
- {
|
||||
path: './core/tauri-runtime-wry/Cargo.toml',
|
||||
args: '--features devtools,system-tray,macos-private-api,objc-exception'
|
||||
}
|
||||
- { path: './core/tauri-utils/Cargo.toml', args: '--all-features' }
|
||||
- { path: './tooling/bundler/Cargo.toml', args: '--all-features' }
|
||||
- { path: './tooling/cli/Cargo.toml', args: '--all-features' }
|
||||
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
|
||||
- name: install Linux dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y libgtk-3-dev
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
- name: Get current date
|
||||
run: echo "CURRENT_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
|
||||
|
||||
- name: Download udeps
|
||||
uses: actions/download-artifact@v4.1.7
|
||||
- name: Cache cargo state
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: cargo_state
|
||||
with:
|
||||
name: udeps
|
||||
path: '~/.cargo/bin'
|
||||
path: |
|
||||
~/.cargo/registry
|
||||
~/.cargo/git
|
||||
~/.cargo/bin
|
||||
key: ubuntu-latest-nightly-${{ env.cache-name }}-${{ hashFiles('**/Cargo.toml') }}-${{ env.CURRENT_DATE }}
|
||||
restore-keys: |
|
||||
ubuntu-latest-nightly-${{ env.cache-name }}-${{ hashFiles('**/Cargo.toml') }}-
|
||||
ubuntu-latest-nightly-${{ env.cache-name }}-
|
||||
ubuntu-latest-nightly-
|
||||
ubuntu-latest-
|
||||
|
||||
- run: chmod +x $HOME/.cargo/bin/cargo-udeps
|
||||
- name: Cache core cargo target
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: cargo_core
|
||||
with:
|
||||
path: target
|
||||
# Add date to the cache to keep it up to date
|
||||
key: ubuntu-latest-nightly-${{ env.cache-name }}-${{ hashFiles('core/**/Cargo.toml') }}-${{ env.CURRENT_DATE }}
|
||||
# Restore from outdated cache for speed
|
||||
restore-keys: |
|
||||
ubuntu-latest-nightly-${{ env.cache-name }}-${{ hashFiles('core/**/Cargo.toml') }}
|
||||
ubuntu-latest-nightly-${{ env.cache-name }}-
|
||||
ubuntu-latest-nightly-
|
||||
ubuntu-latest-
|
||||
|
||||
- name: Cache bundler cargo target
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: cargo_bundler
|
||||
with:
|
||||
path: tooling/bundler/target
|
||||
# Add date to the cache to keep it up to date
|
||||
key: ubuntu-latest-nightly-${{ env.cache-name }}-${{ hashFiles('tooling/bundler/Cargo.lock') }}-${{ env.CURRENT_DATE }}
|
||||
# Restore from outdated cache for speed
|
||||
restore-keys: |
|
||||
ubuntu-latest-nightly-${{ env.cache-name }}-${{ hashFiles('tooling/bundler/Cargo.lock') }}
|
||||
ubuntu-latest-nightly-${{ env.cache-name }}-
|
||||
ubuntu-latest-nightly-
|
||||
ubuntu-latest-
|
||||
|
||||
- name: Cache CLI cargo target
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: cargo_cli
|
||||
with:
|
||||
path: tooling/cli/target
|
||||
# Add date to the cache to keep it up to date
|
||||
key: ubuntu-latest-nightly-${{ env.cache-name }}-${{ hashFiles('tooling/cli/Cargo.lock') }}-${{ env.CURRENT_DATE }}
|
||||
# Restore from outdated cache for speed
|
||||
restore-keys: |
|
||||
ubuntu-latest-nightly-${{ env.cache-name }}-${{ hashFiles('tooling/cli/Cargo.lock') }}
|
||||
ubuntu-latest-nightly-${{ env.cache-name }}-
|
||||
ubuntu-latest-nightly-
|
||||
ubuntu-latest-
|
||||
|
||||
- uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: install
|
||||
args: cargo-udeps --locked --force
|
||||
|
||||
- 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 libgtk-3-dev webkit2gtk-4.0 libayatana-appindicator3-dev librsvg2-dev patchelf
|
||||
|
||||
- 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.clippy.path }} --all-targets ${{ matrix.clippy.args }}
|
||||
|
||||
144
.gitignore
vendored
144
.gitignore
vendored
@@ -1,55 +1,89 @@
|
||||
# dependency directories
|
||||
node_modules/
|
||||
|
||||
# Optional npm and yarn cache directory
|
||||
.npm/
|
||||
.yarn/
|
||||
|
||||
# Output of 'npm pack'
|
||||
*.tgz
|
||||
|
||||
# dotenv environment variables file
|
||||
.env
|
||||
|
||||
# .vscode workspace settings file
|
||||
.vscode/settings.json
|
||||
.vscode/launch.json
|
||||
.vscode/tasks.json
|
||||
|
||||
# npm, yarn and bun lock files
|
||||
package-lock.json
|
||||
yarn.lock
|
||||
bun.lockb
|
||||
|
||||
# rust compiled folders
|
||||
target/
|
||||
|
||||
# test video for streaming example
|
||||
streaming_example_test_video.mp4
|
||||
|
||||
# examples /gen directory
|
||||
/examples/**/src-tauri/gen/
|
||||
/bench/**/src-tauri/gen/
|
||||
|
||||
# logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
|
||||
# runtime data
|
||||
pids
|
||||
*.pid
|
||||
*.seed
|
||||
*.pid.lock
|
||||
|
||||
# miscellaneous
|
||||
/.vs
|
||||
.DS_Store
|
||||
.Thumbs.db
|
||||
*.sublime*
|
||||
.idea
|
||||
debug.log
|
||||
TODO.md
|
||||
.aider*
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
|
||||
# smoke-tests repo
|
||||
/smoke-tests
|
||||
|
||||
# Runtime data
|
||||
pids
|
||||
*.pid
|
||||
*.seed
|
||||
*.pid.lock
|
||||
|
||||
# Directory for instrumented libs generated by jscoverage/JSCover
|
||||
lib-cov
|
||||
|
||||
# Coverage directory used by tools like istanbul
|
||||
coverage
|
||||
|
||||
# nyc test coverage
|
||||
.nyc_output
|
||||
|
||||
# node-waf configuration
|
||||
.lock-wscript
|
||||
|
||||
# Compiled binary addons (http://nodejs.org/api/addons.html)
|
||||
build/Release
|
||||
|
||||
# Dependency directories
|
||||
node_modules/
|
||||
jspm_packages/
|
||||
|
||||
# Typescript v1 declaration files
|
||||
typings/
|
||||
|
||||
# Optional npm cache directory
|
||||
.npm
|
||||
|
||||
# Optional yarn cache directory
|
||||
.yarn
|
||||
|
||||
# Optional eslint cache
|
||||
.eslintcache
|
||||
|
||||
# Optional REPL history
|
||||
.node_repl_history
|
||||
|
||||
# Output of 'npm pack'
|
||||
*.tgz
|
||||
|
||||
# Yarn Integrity file
|
||||
.yarn-integrity
|
||||
|
||||
# dotenv environment variables file
|
||||
.env
|
||||
|
||||
/.vs
|
||||
.DS_Store
|
||||
.Thumbs.db
|
||||
*.sublime*
|
||||
.idea
|
||||
debug.log
|
||||
package-lock.json
|
||||
.vscode/settings.json
|
||||
*/.vscode/
|
||||
proptest-regressions/
|
||||
TODO.md
|
||||
|
||||
# rust compiled folders
|
||||
target
|
||||
|
||||
# lock for libs
|
||||
/Cargo.lock
|
||||
/tooling/bench/tests/Cargo.lock
|
||||
/yarn.lock
|
||||
|
||||
# ignore frida handlers
|
||||
__handlers__/
|
||||
|
||||
# benches
|
||||
gh-pages
|
||||
test_video.mp4
|
||||
|
||||
# old cli directories
|
||||
/tooling/cli.js
|
||||
/tooling/cli.rs
|
||||
|
||||
1
.husky/.gitignore
vendored
Normal file
1
.husky/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
_
|
||||
24
.husky/pre-commit
Executable file
24
.husky/pre-commit
Executable file
@@ -0,0 +1,24 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Copyright 2019-2021 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
|
||||
@@ -1,40 +0,0 @@
|
||||
/audits
|
||||
/.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
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"singleQuote": true,
|
||||
"semi": false,
|
||||
"trailingComma": "none",
|
||||
"experimentalOperatorPosition": "start"
|
||||
}
|
||||
5
.prettierrc.js
Normal file
5
.prettierrc.js
Normal file
@@ -0,0 +1,5 @@
|
||||
module.exports = {
|
||||
singleQuote: true,
|
||||
semi: false,
|
||||
trailingComma: 'none'
|
||||
}
|
||||
54
.scripts/cargo-check.ps1
Executable file
54
.scripts/cargo-check.ps1
Executable file
@@ -0,0 +1,54 @@
|
||||
#!/usr/bin/env pwsh
|
||||
# Copyright 2019-2021 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
44
.scripts/cargo-check.sh
Executable file
@@ -0,0 +1,44 @@
|
||||
#!/usr/bin/env sh
|
||||
# Copyright 2019-2021 Tauri Programme within The Commons Conservancy
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
# note: you can pass in the cargo sub-commands used to check manually.
|
||||
# allowed commands: check, clippy, fmt, test
|
||||
# default: clippy, fmt, test
|
||||
|
||||
# exit the script early if any of the commands return an error
|
||||
set -e
|
||||
|
||||
# set the script arguments if none are found
|
||||
if [ -z "$*" ]; then
|
||||
set -- "clippy" "fmt" "test"
|
||||
fi
|
||||
|
||||
# run n+1 times, where n is the amount of mutually exclusive features.
|
||||
# the extra run is for all the crates without mutually exclusive features.
|
||||
# as many features as possible are enabled at for each command
|
||||
run() {
|
||||
command=$1
|
||||
shift 1
|
||||
cargo "$command" --workspace --all-targets --all-features "$@"
|
||||
}
|
||||
|
||||
for command in "$@"; do
|
||||
case "$command" in
|
||||
check | test)
|
||||
run "$command"
|
||||
;;
|
||||
clippy)
|
||||
run clippy -- -D warnings
|
||||
;;
|
||||
fmt)
|
||||
echo "[$command] checking formatting"
|
||||
cargo +nightly fmt -- --check
|
||||
;;
|
||||
*)
|
||||
echo "[cargo-check.sh] Unknown cargo sub-command: $command"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
@@ -1,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 uknown 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)
|
||||
}
|
||||
@@ -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)
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
#!/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" ];
|
||||
then
|
||||
echo "✔ working directory is clean"
|
||||
else
|
||||
echo "✘ found diff:"
|
||||
echo "$git_output"
|
||||
exit 1
|
||||
fi
|
||||
@@ -1,23 +0,0 @@
|
||||
#!/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 .
|
||||
|
||||
target=$(basename "$o" | cut -d. -f1)
|
||||
if grep -qE '(apple|windows)' <<< "$target"; then
|
||||
zip "../${target}.zip" *
|
||||
else
|
||||
tar cv * | gzip -9 > "../${target}.tgz"
|
||||
fi
|
||||
|
||||
popd
|
||||
done
|
||||
@@ -1,74 +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
|
||||
|
||||
/*
|
||||
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
|
||||
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 bump = process.argv[3]
|
||||
let index = null
|
||||
|
||||
switch (bump) {
|
||||
case 'major':
|
||||
case 'premajor':
|
||||
index = 0
|
||||
break
|
||||
case 'minor':
|
||||
index = 1
|
||||
break
|
||||
case 'patch':
|
||||
index = 2
|
||||
break
|
||||
case 'prerelease':
|
||||
case 'prepatch':
|
||||
index = 3
|
||||
break
|
||||
default:
|
||||
throw new Error('unexpected bump ' + bump)
|
||||
}
|
||||
|
||||
const inc = (version) => {
|
||||
const v = version.split('.')
|
||||
for (let i = 0; i < v.length; i++) {
|
||||
if (i === index) {
|
||||
v[i] = String(Number(v[i]) + 1)
|
||||
} else if (i > index) {
|
||||
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('.')
|
||||
}
|
||||
|
||||
// read file into js object
|
||||
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
|
||||
} 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.dir(metadata)
|
||||
54
.scripts/covector/package-latest-version.js
Normal file
54
.scripts/covector/package-latest-version.js
Normal 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')
|
||||
}
|
||||
})
|
||||
})
|
||||
59
.scripts/covector/sync-cli-metadata.js
Normal file
59
.scripts/covector/sync-cli-metadata.js
Normal file
@@ -0,0 +1,59 @@
|
||||
#!/usr/bin/env node
|
||||
// Copyright 2019-2021 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 `../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 packageNickname = process.argv[2]
|
||||
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':
|
||||
index = 0;
|
||||
break;
|
||||
case 'minor':
|
||||
index = 1;
|
||||
break;
|
||||
case 'patch':
|
||||
index = 2;
|
||||
break;
|
||||
default:
|
||||
throw new Error('unexpected bump ' + bump)
|
||||
}
|
||||
|
||||
const inc = (version) => {
|
||||
const v = version.split('.')
|
||||
const n = v[index]
|
||||
v[index] = String(Number(n) + 1)
|
||||
return v.join('.')
|
||||
}
|
||||
|
||||
// read file into js object
|
||||
const metadata = JSON.parse(readFileSync(filePath, 'utf-8'))
|
||||
|
||||
// set field version
|
||||
let 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.json`)
|
||||
console.dir(metadata)
|
||||
29
.scripts/setup.ps1
Normal file
29
.scripts/setup.ps1
Normal file
@@ -0,0 +1,29 @@
|
||||
#!/usr/bin/env pwsh
|
||||
# Copyright 2019-2021 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
28
.scripts/setup.sh
Executable file
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env bash
|
||||
# Copyright 2019-2021 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
23
.scripts/update-lockfiles.sh
Executable file
@@ -0,0 +1,23 @@
|
||||
#!/usr/bin/env sh
|
||||
# Copyright 2019-2021 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")
|
||||
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
|
||||
62
.scripts/utils/batch_to_exe.cmd
Normal file
62
.scripts/utils/batch_to_exe.cmd
Normal file
@@ -0,0 +1,62 @@
|
||||
@ECHO OFF
|
||||
|
||||
REM Copyright 2019-2021 Tauri Programme within The Commons Conservancy
|
||||
REM SPDX-License-Identifier: Apache-2.0
|
||||
REM SPDX-License-Identifier: MIT
|
||||
|
||||
ECHO Make EXE From BAT
|
||||
ECHO.
|
||||
ECHO.
|
||||
|
||||
REM Usage:
|
||||
REM MakeExeFromBat BatFileToConvert [IncludeFile1] [IncludeFile2] [...]
|
||||
REM
|
||||
REM Required Parameters:
|
||||
REM BatFileToConvert
|
||||
REM Source batch file to use to produce the output Exe file.
|
||||
REM
|
||||
REM Optional Parameters:
|
||||
REM IncludeFile
|
||||
REM Additional files to include in the Exe file.
|
||||
REM You can include external tools used by the batch file so they are available on the executing machine.
|
||||
|
||||
SETLOCAL
|
||||
|
||||
REM Configuration (no quotes needed):
|
||||
SET PathTo7Zip=
|
||||
|
||||
|
||||
REM ---- Do not modify anything below this line ----
|
||||
|
||||
SET OutputFile="%~n1.exe"
|
||||
SET SourceFiles="%TEMP%MakeEXE_files.txt"
|
||||
SET Config="%TEMP%MakeEXE_config.txt"
|
||||
SET Source7ZFile="%Temp%MakeEXE.7z"
|
||||
|
||||
REM Remove existing files
|
||||
IF EXIST %OutputFile% DEL %OutputFile%
|
||||
|
||||
REM Build source archive
|
||||
ECHO "%~dpnx1" > %SourceFiles%
|
||||
:AddInclude
|
||||
IF {%2}=={} GOTO EndInclude
|
||||
ECHO "%~dpnx2" >> %SourceFiles%
|
||||
SHIFT /2
|
||||
GOTO AddInclude
|
||||
:EndInclude
|
||||
"%PathTo7Zip%7za.exe" a %Source7ZFile% @%SourceFiles%
|
||||
|
||||
REM Build config file
|
||||
ECHO ;!@Install@!UTF-8! > %Config%
|
||||
ECHO RunProgram="%~nx1" >> %Config%
|
||||
ECHO ;!@InstallEnd@! >> %Config%
|
||||
|
||||
REM Build EXE
|
||||
COPY /B "%PathTo7Zip%7zsd.sfx" + %Config% + %Source7ZFile% %OutputFile%
|
||||
|
||||
REM Clean up
|
||||
IF EXIST %SourceFiles% DEL %SourceFiles%
|
||||
IF EXIST %Config% DEL %Config%
|
||||
IF EXIST %Source7ZFile% DEL %Source7ZFile%
|
||||
|
||||
ENDLOCAL
|
||||
16
.taurignore
16
.taurignore
@@ -1,16 +0,0 @@
|
||||
.changes
|
||||
.devcontainer
|
||||
.docker
|
||||
.github
|
||||
.scripts
|
||||
.vscode
|
||||
audits
|
||||
bench
|
||||
packages/api
|
||||
packages/cli
|
||||
crates/tauri-cli
|
||||
crates/tauri-bundler
|
||||
crates/tauri-driver
|
||||
crates/tauri-macos-sign
|
||||
crates/tauri-schema-generator
|
||||
crates/tests
|
||||
5
.vscode/extensions.json
vendored
5
.vscode/extensions.json
vendored
@@ -1,8 +1,7 @@
|
||||
{
|
||||
"recommendations": [
|
||||
"rust-lang.rust-analyzer",
|
||||
"ms-vscode-remote.vscode-remote-extensionpack",
|
||||
"EditorConfig.EditorConfig",
|
||||
"esbenp.prettier-vscode",
|
||||
"tamasfe.even-better-toml"
|
||||
"esbenp.prettier-vscode"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,134 +1,107 @@
|
||||
# The Tauri Architecture
|
||||
|
||||
<https://tauri.app>
|
||||
|
||||
<https://github.com/tauri-apps/tauri>
|
||||
https://tauri.studio
|
||||
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
|
||||
#### [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.
|
||||
|
||||
#### [@tauri-apps/api](https://github.com/tauri-apps/tauri/tree/dev/packages/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.studio/en/docs/guides/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 +109,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 +127,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 +138,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).
|
||||
|
||||
11350
Cargo.lock
generated
11350
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
79
Cargo.toml
79
Cargo.toml
@@ -1,73 +1,32 @@
|
||||
[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",
|
||||
|
||||
# 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"
|
||||
]
|
||||
|
||||
# default to small, optimized workspace release binaries
|
||||
[profile.release]
|
||||
strip = true
|
||||
panic = "abort"
|
||||
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" }
|
||||
|
||||
@@ -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-2021, 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>
|
||||
@@ -17,4 +17,4 @@ Created: 2019-05-20T09:00:00Z
|
||||
PackageDownloadLocation: git://github.com/tauri-apps/tauri
|
||||
PackageDownloadLocation: git+https://github.com/tauri-apps/tauri.git
|
||||
PackageDownloadLocation: git+ssh://github.com/tauri-apps/tauri.git
|
||||
Creator: Person: Daniel Thompson-Yvetot
|
||||
Creator: Person: Daniel Thompson-Yvetot
|
||||
219
README.md
219
README.md
@@ -1,57 +1,177 @@
|
||||
<img src=".github/splash.png" alt="Tauri" />
|
||||
|
||||
[](https://github.com/tauri-apps/tauri/tree/dev)
|
||||
[](https://github.com/tauri-apps/tauri/tree/dev)
|
||||
[](https://opencollective.com/tauri)
|
||||
[](https://github.com/tauri-apps/tauri/actions/workflows/test-core.yml)
|
||||
[](https://github.com/tauri-apps/tauri/actions?query=workflow%3A%22test+library%22)
|
||||
[](https://app.fossa.com/projects/git%2Bgithub.com%2Ftauri-apps%2Ftauri?ref=badge_shield)
|
||||
[](https://discord.com/invite/tauri)
|
||||
[](https://tauri.app)
|
||||
|
||||
[](https://discord.gg/SpmNs4S)
|
||||
[](https://dev.to/tauri)
|
||||
[](https://tauri.app)
|
||||
[](https://good-labs.github.io/greater-good-affirmation)
|
||||
[](https://opencollective.com/tauri)
|
||||
[](https://opencollective.com/tauri)
|
||||
|
||||
## Current Releases
|
||||
|
||||
### Core
|
||||
|
||||
| Component | Description | Version | Lin | Win | Mac |
|
||||
| -------------------------------------------------------------------------------------------- | ----------------------------------------- | -------------------------------------------------------------------------------------------------------- | --- | --- | --- |
|
||||
| [**tauri**](https://github.com/tauri-apps/tauri/tree/dev/core/tauri) | runtime core | [](https://crates.io/crates/tauri) | ✅ | ✅ | ✅ |
|
||||
| [**tauri-build**](https://github.com/tauri-apps/tauri/tree/dev/core/tauri-build) | applies macros at build-time | [](https://crates.io/crates/tauri-build) | ✅ | ✅ | ✅ |
|
||||
| [**tauri-codegen**](https://github.com/tauri-apps/tauri/tree/dev/core/tauri-codegen) | handles assets, parses tauri.conf.json | [](https://crates.io/crates/tauri-codegen) | ✅ | ✅ | ✅ |
|
||||
| [**tauri-macros**](https://github.com/tauri-apps/tauri/tree/dev/core/tauri-macros) | creates macros using tauri-codegen | [](https://crates.io/crates/tauri-macros) | ✅ | ✅ | ✅ |
|
||||
| [**tauri-runtime**](https://github.com/tauri-apps/tauri/tree/dev/core/tauri-runtime) | layer between Tauri and webview libraries | [](https://crates.io/crates/tauri-runtime) | ✅ | ✅ | ✅ |
|
||||
| [**tauri-runtime-wry**](https://github.com/tauri-apps/tauri/tree/dev/core/tauri-runtime-wry) | enables system-level interaction via WRY | [](https://crates.io/crates/tauri-runtime-wry) | ✅ | ✅ | ✅ |
|
||||
| [**tauri-utils**](https://github.com/tauri-apps/tauri/tree/dev/core/tauri-utils) | common code used across the tauri crates | [](https://crates.io/crates/tauri-utils) | ✅ | ✅ | ✅ |
|
||||
|
||||
### Tooling
|
||||
|
||||
| Component | Description | Version | Lin | Win | Mac |
|
||||
| --------------------------------------------------------------------------- | ---------------------------------------- | ------------------------------------------------------------------------------------------------------ | --- | --- | --- |
|
||||
| [**bundler**](https://github.com/tauri-apps/tauri/tree/dev/tooling/bundler) | manufacture the final binaries | [](https://crates.io/crates/tauri-bundler) | ✅ | ✅ | ✅ |
|
||||
| [**api.js**](https://github.com/tauri-apps/tauri/tree/dev/tooling/api) | JS API for interaction with Rust backend | [](https://www.npmjs.com/package/@tauri-apps/api) | ✅ | ✅ | ✅ |
|
||||
| [**cli.rs**](https://github.com/tauri-apps/tauri/tree/dev/tooling/cli) | create, develop and build apps | [](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://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://www.npmjs.com/package/create-tauri-app) | ✅ | ✅ | ✅ |
|
||||
| [**vue-cli-plugin-tauri**](https://github.com/tauri-apps/vue-cli-plugin-tauri/) | Vue CLI plugin for Tauri | [](https://www.npmjs.com/package/vue-cli-plugin-tauri) | ✅ | ✅ | ✅ |
|
||||
|
||||
## Introduction
|
||||
|
||||
Tauri is a framework for building tiny, blazingly fast binaries for all major desktop platforms. Developers can integrate any front-end framework that compiles to HTML, JS and CSS for building their user interface. The backend of the application is a rust-sourced binary with an API that the front-end can interact with.
|
||||
|
||||
The user interface in Tauri apps currently leverages [`tao`](https://docs.rs/tao) as a window handling library on macOS, Windows, Linux, Android and iOS. To render your application, Tauri uses [WRY](https://github.com/tauri-apps/wry), a library which provides a unified interface to the system webview, leveraging WKWebView on macOS & iOS, WebView2 on Windows, WebKitGTK on Linux and Android System WebView on Android.
|
||||
The user interface in Tauri apps currently leverages [`tao`](https://docs.rs/tao) as a window handling library on macOS and Windows, and [`gtk`](https://gtk-rs.org/docs/gtk/) on Linux via the **Tauri-team** incubated and maintained [WRY](https://github.com/tauri-apps/wry), which creates a unified interface to the system webview (and other goodies like Menu and Taskbar), leveraging WebKit on macOS, WebView2 on Windows and WebKitGTK on Linux.
|
||||
|
||||
To learn more about the details of how all of these pieces fit together, please consult this [ARCHITECTURE.md](https://github.com/tauri-apps/tauri/blob/dev/ARCHITECTURE.md) document.
|
||||
|
||||
## Getting Started
|
||||
## Get Started
|
||||
|
||||
If you are interested in making a tauri app, please visit the [documentation website](https://tauri.app).
|
||||
|
||||
The quickest way to get started is to install the [prerequisites](https://v2.tauri.app/start/prerequisites/) for your system and create a new project with [`create-tauri-app`](https://github.com/tauri-apps/create-tauri-app/#usage). For example with `npm`:
|
||||
|
||||
```sh
|
||||
npm create tauri-app@latest
|
||||
```
|
||||
|
||||
## Features
|
||||
|
||||
The list of Tauri's features includes, but is not limited to:
|
||||
|
||||
- Built-in app bundler to create app bundles in formats like `.app`, `.dmg`, `.deb`, `.rpm`, `.AppImage` and Windows installers like `.exe` (via NSIS) and `.msi` (via WiX).
|
||||
- Built-in self updater (desktop only)
|
||||
- System tray icons
|
||||
- Native notifications
|
||||
- Native WebView Protocol (tauri doesn't create a localhost http(s) server to serve the WebView contents)
|
||||
- GitHub action for streamlined CI
|
||||
- VS Code extension
|
||||
If you are interested in making a tauri app, please visit the [documentation website](https://tauri.studio). 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
|
||||
|
||||
### App Bundles
|
||||
|
||||
- [x] App Icons
|
||||
- [x] Build on macOS (.app, .dmg)
|
||||
- [x] Build on Linux (.deb, AppImage)
|
||||
- [x] Build on Windows (.exe, .msi)
|
||||
- [x] Copy Buffer
|
||||
- [x] Device Notifications (toast)
|
||||
- [x] Self Updater
|
||||
- [x] App Signing
|
||||
- [x] Frameless Mode
|
||||
- [x] Transparent Mode
|
||||
- [x] Multiwindow Mode
|
||||
- [x] Tray
|
||||
- [ ] deeplink RPC (in progress)
|
||||
- [ ] One-Time commands (coming soon)
|
||||
|
||||
### 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] GH Action for creating binaries for all platforms
|
||||
- [x] VS Code Extension
|
||||
- [x] Tauri Core Plugins
|
||||
- [x] Update core dependencies automatically from the command line
|
||||
- [x] Rust-based CLI
|
||||
|
||||
### Comparison between Tauri and Electron
|
||||
|
||||
| Detail | Tauri | Electron |
|
||||
| -------------------------- | ------ | -------------------- |
|
||||
| Installer Size Linux | 3.1 MB | 52.1 MB |
|
||||
| Memory Consumption Linux | 180 MB | 462 MB |
|
||||
| Launch Time Linux | 0.39s | 0.80s |
|
||||
| Interface Service Provider | WRY | Chromium |
|
||||
| Backend Binding | Rust | Node.js (ECMAScript) |
|
||||
| Underlying Engine | Rust | V8 (C/C++) |
|
||||
| FLOSS | Yes | No |
|
||||
| Multithreading | Yes | Yes |
|
||||
| Bytecode Delivery | Yes | No |
|
||||
| Multiple Windows | Yes | Yes |
|
||||
| Auto Updater | Yes | Yes<sup>1</sup> |
|
||||
| Custom App Icon | Yes | Yes |
|
||||
| Windows Binary | Yes | Yes |
|
||||
| macOS Binary | Yes | Yes |
|
||||
| Linux Binary | Yes | Yes |
|
||||
| iOS Binary | Soon | No |
|
||||
| Android Binary | Soon | No |
|
||||
| Desktop Tray | Yes | Yes |
|
||||
| Sidecar Binaries | Yes | No |
|
||||
|
||||
#### Notes
|
||||
|
||||
1. Electron has no native auto updater on Linux, but is offered by electron-packager
|
||||
|
||||
## 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
|
||||
|
||||
### Major Runtimes
|
||||
|
||||
- Node.js for running the CLI (deno and pure rust are on the roadmap)
|
||||
- Cargo for testing, running the dev service, building binaries and as the runtime harness for the webview
|
||||
|
||||
### Major Languages
|
||||
|
||||
- Rust for the CLI
|
||||
- ECMAScript bindings to the Rust API, written in typescript
|
||||
- Rust for bindings, rust side of the API, harnesses
|
||||
- Rust plugins to Tauri backend
|
||||
|
||||
### 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 +181,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
|
||||
- TS (`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](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.
|
||||
|
||||
|
||||
17
SECURITY.md
17
SECURITY.md
@@ -10,19 +10,10 @@
|
||||
## Reporting a Vulnerability
|
||||
|
||||
If you have found a potential security threat, vulnerability or exploit in Tauri
|
||||
or one of its upstream dependencies, please DON'T create a pull-request, DON'T
|
||||
file an issue on GitHub, DON'T mention it on Discord and DON'T create a forum thread.
|
||||
or one of its upstream dependencies, please DON’T create a pull-request, DON’T
|
||||
file an issue on GitHub, DON’T mention it on Discord and DON’T create a forum thread.
|
||||
|
||||
Please submit your report via the GitHub Private Vulnerability Disclosure functionality.
|
||||
We will be adding contact information to this page very soon.
|
||||
|
||||
Find out more about the reporting process [here](https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing/privately-reporting-a-security-vulnerability#privately-reporting-a-security-vulnerability).
|
||||
|
||||
Our team will triage your report and keep you informed about the progress.
|
||||
We may ask questions or request further guidance on reproduction of the vulnerability in the comments of the advisory, which will be publicized.
|
||||
|
||||
Additionally, we may ask you to independently verify our patch, which will be available in the private advisory branch. Please do not publish your vulnerability during the process or before coordinated public disclosure from our side. We try to adhere to common standards of publication within 90-Days of disclosure.
|
||||
|
||||
Depending on your decision to accept or deny credit for the vulnerability, you will be publicly attributed to the vulnerability and may be mentioned in our announcements.
|
||||
|
||||
At the current time we do not have the financial ability to reward bounties,
|
||||
At the current time we do not have the financial ability to reward bounties,
|
||||
but in extreme cases will at our discretion consider a reward.
|
||||
|
||||
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
Binary file not shown.
@@ -1,64 +0,0 @@
|
||||
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
//! This Rust binary runs on CI and provides internal metrics results of Tauri. To learn more see [benchmark_results](https://github.com/tauri-apps/benchmark_results) repository.
|
||||
//!
|
||||
//! ***_Internal use only_**
|
||||
|
||||
#![doc(
|
||||
html_logo_url = "https://github.com/tauri-apps/tauri/raw/dev/.github/icon.png",
|
||||
html_favicon_url = "https://github.com/tauri-apps/tauri/raw/dev/.github/icon.png"
|
||||
)]
|
||||
|
||||
use std::{fs::File, io::BufReader};
|
||||
mod utils;
|
||||
|
||||
fn main() {
|
||||
let tauri_data = &utils::tauri_root_path()
|
||||
.join("gh-pages")
|
||||
.join("tauri-data.json");
|
||||
let tauri_recent = &utils::tauri_root_path()
|
||||
.join("gh-pages")
|
||||
.join("tauri-recent.json");
|
||||
|
||||
// current data
|
||||
let current_data_buffer = BufReader::new(
|
||||
File::open(utils::target_dir().join("bench.json")).expect("Unable to read current data file"),
|
||||
);
|
||||
let current_data: utils::BenchResult =
|
||||
serde_json::from_reader(current_data_buffer).expect("Unable to read current data buffer");
|
||||
|
||||
// all data's
|
||||
let all_data_buffer =
|
||||
BufReader::new(File::open(tauri_data).expect("Unable to read all data file"));
|
||||
let mut all_data: Vec<utils::BenchResult> =
|
||||
serde_json::from_reader(all_data_buffer).expect("Unable to read all data buffer");
|
||||
|
||||
// add current data to all data
|
||||
all_data.push(current_data);
|
||||
|
||||
// use only latest 20 elements from all data
|
||||
let recent: Vec<utils::BenchResult> = if all_data.len() > 20 {
|
||||
all_data[all_data.len() - 20..].to_vec()
|
||||
} else {
|
||||
all_data.clone()
|
||||
};
|
||||
|
||||
// write json's
|
||||
utils::write_json(
|
||||
tauri_data
|
||||
.to_str()
|
||||
.expect("Something wrong with tauri_data"),
|
||||
&serde_json::to_value(all_data).expect("Unable to build final json (all)"),
|
||||
)
|
||||
.unwrap_or_else(|_| panic!("Unable to write {tauri_data:?}"));
|
||||
|
||||
utils::write_json(
|
||||
tauri_recent
|
||||
.to_str()
|
||||
.expect("Something wrong with tauri_recent"),
|
||||
&serde_json::to_value(recent).expect("Unable to build final json (recent)"),
|
||||
)
|
||||
.unwrap_or_else(|_| panic!("Unable to write {tauri_recent:?}"));
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
body {
|
||||
font-family:
|
||||
-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial,
|
||||
sans-serif;
|
||||
margin: auto;
|
||||
max-width: 38rem;
|
||||
padding: 2rem;
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
[package]
|
||||
name = "bench_cpu_intensive"
|
||||
version = "0.1.0"
|
||||
description = "A very simple Tauri Application"
|
||||
edition = "2021"
|
||||
rust-version = "1.77.2"
|
||||
|
||||
[build-dependencies]
|
||||
tauri-build = { path = "../../../../crates/tauri-build", features = [
|
||||
"codegen",
|
||||
] }
|
||||
|
||||
[dependencies]
|
||||
serde_json = "1"
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
tauri = { path = "../../../../crates/tauri", features = [] }
|
||||
@@ -1,33 +0,0 @@
|
||||
{
|
||||
"$schema": "../../../../crates/tauri-schema-generator/schemas/config.schema.json",
|
||||
"identifier": "com.tauri.dev",
|
||||
"build": {
|
||||
"frontendDist": "../public"
|
||||
},
|
||||
"app": {
|
||||
"withGlobalTauri": true,
|
||||
"windows": [
|
||||
{
|
||||
"title": "Welcome to Tauri!",
|
||||
"width": 800,
|
||||
"height": 600,
|
||||
"resizable": true,
|
||||
"fullscreen": false
|
||||
}
|
||||
],
|
||||
"security": {
|
||||
"csp": "default-src blob: data: filesystem: ws: wss: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self'; connect-src ipc: http://ipc.localhost"
|
||||
}
|
||||
},
|
||||
"bundle": {
|
||||
"active": true,
|
||||
"targets": "all",
|
||||
"icon": [
|
||||
"../../../../examples/.icons/32x32.png",
|
||||
"../../../../examples/.icons/128x128.png",
|
||||
"../../../../examples/.icons/128x128@2x.png",
|
||||
"../../../../examples/.icons/icon.icns",
|
||||
"../../../../examples/.icons/icon.ico"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Welcome to Tauri!</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Welcome to Tauri!</h1>
|
||||
|
||||
<script>
|
||||
window.addEventListener('DOMContentLoaded', (event) => {
|
||||
window.__TAURI__.core
|
||||
.invoke('read_file')
|
||||
.then((_data) => {
|
||||
// success
|
||||
window.__TAURI__.core.invoke('app_should_close', {
|
||||
exitCode: 0
|
||||
})
|
||||
})
|
||||
.catch((_error) => {
|
||||
// error
|
||||
window.__TAURI__.core.invoke('app_should_close', {
|
||||
exitCode: 1
|
||||
})
|
||||
})
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,16 +0,0 @@
|
||||
[package]
|
||||
name = "bench_files_transfer"
|
||||
version = "0.1.0"
|
||||
description = "A very simple Tauri Application"
|
||||
edition = "2021"
|
||||
rust-version = "1.77.2"
|
||||
|
||||
[build-dependencies]
|
||||
tauri-build = { path = "../../../../crates/tauri-build", features = [
|
||||
"codegen",
|
||||
] }
|
||||
|
||||
[dependencies]
|
||||
serde_json = "1"
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
tauri = { path = "../../../../crates/tauri", features = [] }
|
||||
@@ -1,30 +0,0 @@
|
||||
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
|
||||
|
||||
use std::fs::read;
|
||||
use tauri::{command, ipc::Response, path::BaseDirectory, AppHandle, Manager, Runtime};
|
||||
|
||||
#[command]
|
||||
fn app_should_close(exit_code: i32) {
|
||||
std::process::exit(exit_code);
|
||||
}
|
||||
|
||||
#[command]
|
||||
async fn read_file<R: Runtime>(app: AppHandle<R>) -> Result<Response, String> {
|
||||
let path = app
|
||||
.path()
|
||||
.resolve(".tauri_3mb.json", BaseDirectory::Home)
|
||||
.map_err(|e| e.to_string())?;
|
||||
let contents = read(path).map_err(|e| e.to_string())?;
|
||||
Ok(Response::new(contents))
|
||||
}
|
||||
|
||||
fn main() {
|
||||
tauri::Builder::default()
|
||||
.invoke_handler(tauri::generate_handler![app_should_close, read_file])
|
||||
.run(tauri::generate_context!())
|
||||
.expect("error while running tauri application");
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
{
|
||||
"$schema": "../../../../crates/tauri-schema-generator/schemas/config.schema.json",
|
||||
"identifier": "com.tauri.dev",
|
||||
"build": {
|
||||
"frontendDist": "../public"
|
||||
},
|
||||
"app": {
|
||||
"withGlobalTauri": true,
|
||||
"windows": [
|
||||
{
|
||||
"title": "Welcome to Tauri!",
|
||||
"width": 800,
|
||||
"height": 600,
|
||||
"resizable": true,
|
||||
"fullscreen": false
|
||||
}
|
||||
],
|
||||
"security": {
|
||||
"csp": "default-src blob: data: filesystem: ws: wss: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self'; connect-src ipc: http://ipc.localhost"
|
||||
}
|
||||
},
|
||||
"bundle": {
|
||||
"active": true,
|
||||
"targets": "all",
|
||||
"icon": [
|
||||
"../../../../examples/.icons/32x32.png",
|
||||
"../../../../examples/.icons/128x128.png",
|
||||
"../../../../examples/.icons/128x128@2x.png",
|
||||
"../../../../examples/.icons/icon.icns",
|
||||
"../../../../examples/.icons/icon.ico"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
[package]
|
||||
name = "bench_helloworld"
|
||||
version = "0.1.0"
|
||||
description = "A very simple Tauri Application"
|
||||
edition = "2021"
|
||||
rust-version = "1.77.2"
|
||||
|
||||
[build-dependencies]
|
||||
tauri-build = { path = "../../../../crates/tauri-build", features = [
|
||||
"codegen",
|
||||
] }
|
||||
|
||||
[dependencies]
|
||||
serde_json = "1"
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
tauri = { path = "../../../../crates/tauri", features = [] }
|
||||
@@ -1,35 +0,0 @@
|
||||
{
|
||||
"$schema": "../../../../crates/tauri-schema-generator/schemas/config.schema.json",
|
||||
"identifier": "com.tauri.dev",
|
||||
"build": {
|
||||
"frontendDist": "../public",
|
||||
"beforeDevCommand": "",
|
||||
"beforeBuildCommand": ""
|
||||
},
|
||||
"app": {
|
||||
"withGlobalTauri": true,
|
||||
"windows": [
|
||||
{
|
||||
"title": "Welcome to Tauri!",
|
||||
"width": 800,
|
||||
"height": 600,
|
||||
"resizable": true,
|
||||
"fullscreen": false
|
||||
}
|
||||
],
|
||||
"security": {
|
||||
"csp": "default-src blob: data: filesystem: ws: wss: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self'; connect-src ipc: http://ipc.localhost"
|
||||
}
|
||||
},
|
||||
"bundle": {
|
||||
"active": true,
|
||||
"targets": "all",
|
||||
"icon": [
|
||||
"../../../../examples/.icons/32x32.png",
|
||||
"../../../../examples/.icons/128x128.png",
|
||||
"../../../../examples/.icons/128x128@2x.png",
|
||||
"../../../../examples/.icons/icon.icns",
|
||||
"../../../../examples/.icons/icon.ico"
|
||||
]
|
||||
}
|
||||
}
|
||||
192
core/tauri-build/CHANGELOG.md
Normal file
192
core/tauri-build/CHANGELOG.md
Normal file
@@ -0,0 +1,192 @@
|
||||
# Changelog
|
||||
|
||||
## \[1.0.4]
|
||||
|
||||
- Reduce the amount of allocations when converting cases.
|
||||
- [bc370e32](https://www.github.com/tauri-apps/tauri/commit/bc370e326810446e15b1f50fb962b980114ba16b) feat: reduce the amount of `heck`-related allocations ([#4634](https://www.github.com/tauri-apps/tauri/pull/4634)) on 2022-07-11
|
||||
|
||||
## \[1.0.3]
|
||||
|
||||
- Improve configuration deserialization error messages.
|
||||
- [9170c920](https://www.github.com/tauri-apps/tauri/commit/9170c9207044fa561535f624916dfdbaa41ff79d) feat(core): improve config deserialization error messages ([#4607](https://www.github.com/tauri-apps/tauri/pull/4607)) on 2022-07-06
|
||||
- The `TAURI_CONFIG` environment variable now represents the configuration to be merged instead of the entire JSON.
|
||||
- [fa028ebf](https://www.github.com/tauri-apps/tauri/commit/fa028ebf3c8ca7b43a70d283a01dbea86217594f) refactor: do not pass entire config from CLI to core, send patch instead ([#4598](https://www.github.com/tauri-apps/tauri/pull/4598)) on 2022-07-06
|
||||
|
||||
## \[1.0.2]
|
||||
|
||||
- Expose `platform::windows_version` function.
|
||||
- Bumped due to a bump in tauri-utils.
|
||||
- [bf764e83](https://www.github.com/tauri-apps/tauri/commit/bf764e83e01e7443e6cc54572001e1c98c357465) feat(utils): expose `windows_version` function ([#4534](https://www.github.com/tauri-apps/tauri/pull/4534)) on 2022-06-30
|
||||
|
||||
## \[1.0.1]
|
||||
|
||||
- Changed the `BundleConfig::targets` to a `BundleTarget` enum to enhance generated documentation.
|
||||
- Bumped due to a bump in tauri-utils.
|
||||
- [31c15cd2](https://www.github.com/tauri-apps/tauri/commit/31c15cd2bd94dbe39fb94982a15cbe02ac5d8925) docs(config): enhance documentation for bundle targets, closes [#3251](https://www.github.com/tauri-apps/tauri/pull/3251) ([#4418](https://www.github.com/tauri-apps/tauri/pull/4418)) on 2022-06-21
|
||||
- Added `platform::is_windows_7`.
|
||||
- Bumped due to a bump in tauri-utils.
|
||||
- [57039fb2](https://www.github.com/tauri-apps/tauri/commit/57039fb2166571de85271b014a8711a29f06be1a) fix(core): add windows 7 notification support ([#4491](https://www.github.com/tauri-apps/tauri/pull/4491)) on 2022-06-28
|
||||
- Suppress unused variable warning in release builds.
|
||||
- Bumped due to a bump in tauri-utils.
|
||||
- [45981851](https://www.github.com/tauri-apps/tauri/commit/45981851e35119266c1a079e1ff27a39f1fdfaed) chore(lint): unused variable warnings for release builds ([#4411](https://www.github.com/tauri-apps/tauri/pull/4411)) on 2022-06-22
|
||||
- Added webview install mode options.
|
||||
- Bumped due to a bump in tauri-utils.
|
||||
- [2ca762d2](https://www.github.com/tauri-apps/tauri/commit/2ca762d207030a892a6d128b519e150e2d733468) feat(bundler): extend webview2 installation options, closes [#2882](https://www.github.com/tauri-apps/tauri/pull/2882) [#2452](https://www.github.com/tauri-apps/tauri/pull/2452) ([#4466](https://www.github.com/tauri-apps/tauri/pull/4466)) on 2022-06-26
|
||||
|
||||
## \[1.0.0]
|
||||
|
||||
- Upgrade to `stable`!
|
||||
- [f4bb30cc](https://www.github.com/tauri-apps/tauri/commit/f4bb30cc73d6ba9b9ef19ef004dc5e8e6bb901d3) feat(covector): prepare for v1 ([#4351](https://www.github.com/tauri-apps/tauri/pull/4351)) on 2022-06-15
|
||||
|
||||
## \[1.0.0-rc.15]
|
||||
|
||||
- Read the tray icon path relatively to the config directory.
|
||||
- Bumped due to a bump in tauri-codegen.
|
||||
- [562e8ca2](https://www.github.com/tauri-apps/tauri/commit/562e8ca23facf1a8e5fa6c8cdf872357d3523a78) fix(codegen): tray icon path is relative to the config directory on 2022-06-15
|
||||
|
||||
## \[1.0.0-rc.14]
|
||||
|
||||
- Do not copy the tray icon to the output directory on Linux since it is embedded in the binary.
|
||||
- [4ce8e228](https://www.github.com/tauri-apps/tauri/commit/4ce8e228134cd3f22973b74ef26ca0d165fbbbd9) refactor(core): use `Icon` for tray icons ([#4342](https://www.github.com/tauri-apps/tauri/pull/4342)) on 2022-06-14
|
||||
|
||||
## \[1.0.0-rc.13]
|
||||
|
||||
- Copy `tauri.conf.json > tauri.bundle.windows.webview_fixed_runtime_path` as a resource to the target directory to fix development usage of a fixed Webview2 runtime path.
|
||||
- [8a634895](https://www.github.com/tauri-apps/tauri/commit/8a63489567b9fa86e404ad42b5b30c64361efe85) fix(build): fixed Webview2 runtime path in development, closes [#4308](https://www.github.com/tauri-apps/tauri/pull/4308) on 2022-06-10
|
||||
- Improve usage of the GNU toolchain on Windows by copying the Webview2Loader.dll file to the target directory.
|
||||
- [58a6879b](https://www.github.com/tauri-apps/tauri/commit/58a6879b82e3a82027604cdd0913caacaaab5c76) feat(tauri-build): improve Windows GNU toolchain usage, closes [#4319](https://www.github.com/tauri-apps/tauri/pull/4319) ([#4323](https://www.github.com/tauri-apps/tauri/pull/4323)) on 2022-06-12
|
||||
- Only statically link the VC runtime when the `STATIC_VCRUNTIME` environment variable is set to `true` (automatically done by the Tauri CLI).
|
||||
- [d703d27a](https://www.github.com/tauri-apps/tauri/commit/d703d27a707edc028f13b35603205da1133fcc2b) fix(build): statically link VC runtime only on `tauri build` ([#4292](https://www.github.com/tauri-apps/tauri/pull/4292)) on 2022-06-07
|
||||
|
||||
## \[1.0.0-rc.12]
|
||||
|
||||
- Statically link the Visual C++ runtime instead of using a merge module on the installer.
|
||||
- [bb061509](https://www.github.com/tauri-apps/tauri/commit/bb061509fb674bef86ecbc1de3aa8f3e367a9907) refactor(core): statically link vcruntime, closes [#4122](https://www.github.com/tauri-apps/tauri/pull/4122) ([#4227](https://www.github.com/tauri-apps/tauri/pull/4227)) on 2022-05-27
|
||||
|
||||
## \[1.0.0-rc.11]
|
||||
|
||||
- Create `dev` cfg alias.
|
||||
- [9cdcf9b3](https://www.github.com/tauri-apps/tauri/commit/9cdcf9b3a8fa27612b3156c1702a4e776627e869) feat(build): create `dev` alias ([#4212](https://www.github.com/tauri-apps/tauri/pull/4212)) on 2022-05-25
|
||||
|
||||
## \[1.0.0-rc.10]
|
||||
|
||||
- Delete existing sidecar before copying new one.
|
||||
- [a737f25c](https://www.github.com/tauri-apps/tauri/commit/a737f25c1078083e0b0f7f338f5c958b86914323) fix(tauri-build): delete existing sidecar file, closes [#4134](https://www.github.com/tauri-apps/tauri/pull/4134) ([#4167](https://www.github.com/tauri-apps/tauri/pull/4167)) on 2022-05-18
|
||||
|
||||
## \[1.0.0-rc.9]
|
||||
|
||||
- Search `tauri.conf.json > tauri > bundle > icons` for a `.ico` file for the window icon instead of simple default `icons/icon.ico` when `WindowsAttributes::window_icon_path` is not set.
|
||||
- [bad85a1f](https://www.github.com/tauri-apps/tauri/commit/bad85a1f11da03421401080531275ba201480cd1) feat(build): find .ico in config instead of default `icons/icon.ico` ([#4115](https://www.github.com/tauri-apps/tauri/pull/4115)) on 2022-05-13
|
||||
|
||||
## \[1.0.0-rc.8]
|
||||
|
||||
- Properly set file version information for the Windows executable.
|
||||
- [1ca2dd67](https://www.github.com/tauri-apps/tauri/commit/1ca2dd677d50b4c724c55b37060c3ba64b81c54a) fix(tauri-build): properly set executable version info on Windows ([#4045](https://www.github.com/tauri-apps/tauri/pull/4045)) on 2022-05-03
|
||||
|
||||
## \[1.0.0-rc.7]
|
||||
|
||||
- Rerun build script if `TAURI_CONFIG` environment variable change.
|
||||
- [7ae9e252](https://www.github.com/tauri-apps/tauri/commit/7ae9e25262376529637cd3b47b1cf84809efaec9) fix(tauri-build): rerun if `TAURI_CONFIG` env var changes on 2022-04-26
|
||||
|
||||
## \[1.0.0-rc.6]
|
||||
|
||||
- Copy system tray icon resource to the target directory on Linux.
|
||||
- [f2a30d8b](https://www.github.com/tauri-apps/tauri/commit/f2a30d8bc54fc3ba49e16f69a413eca5f61a9b1f) refactor(core): use ayatana appindicator by default, keep option to use gtk ([#3916](https://www.github.com/tauri-apps/tauri/pull/3916)) on 2022-04-19
|
||||
|
||||
## \[1.0.0-rc.5]
|
||||
|
||||
- Print error context on the `build` panic.
|
||||
- [49546c52](https://www.github.com/tauri-apps/tauri/commit/49546c5269080f38d57365788eb2592bff8f6d10) feat(build): print error context ([#3644](https://www.github.com/tauri-apps/tauri/pull/3644)) on 2022-03-09
|
||||
|
||||
## \[1.0.0-rc.4]
|
||||
|
||||
- Parse window icons at compile time.
|
||||
- Bumped due to a bump in tauri-codegen.
|
||||
- [8c935872](https://www.github.com/tauri-apps/tauri/commit/8c9358725a17dcc2acaf4d10c3f654afdff586b0) refactor(core): move `png` and `ico` behind Cargo features ([#3588](https://www.github.com/tauri-apps/tauri/pull/3588)) on 2022-03-05
|
||||
|
||||
## \[1.0.0-rc.3]
|
||||
|
||||
- Automatically emit `cargo:rustc-env=MACOSX_DEPLOYMENT_TARGET` with the value set on `tauri.conf.json > tauri > bundle > macos > minimumSystemVersion`.
|
||||
- [4bacea5b](https://www.github.com/tauri-apps/tauri/commit/4bacea5bf48ea5ca6c9bdd10e28e85e67a0c6ef9) feat(core): set `MACOSX_DEPLOYMENT_TARGET` environment variable, closes [#2732](https://www.github.com/tauri-apps/tauri/pull/2732) ([#3496](https://www.github.com/tauri-apps/tauri/pull/3496)) on 2022-02-17
|
||||
|
||||
## \[1.0.0-rc.2]
|
||||
|
||||
- Rerun if sidecar or resource change.
|
||||
- [afcc3ec5](https://www.github.com/tauri-apps/tauri/commit/afcc3ec50148074293350aaa26a05812207716be) fix(build): rerun if resource or sidecar change ([#3460](https://www.github.com/tauri-apps/tauri/pull/3460)) on 2022-02-14
|
||||
|
||||
## \[1.0.0-rc.1]
|
||||
|
||||
- Remove `cargo:rerun-if-changed` check for non-existent file that caused projects to *always* rebuild.
|
||||
- [65287cd6](https://www.github.com/tauri-apps/tauri/commit/65287cd6148feeba91df86217b261770fed34608) remove non-existent cargo rerun check ([#3412](https://www.github.com/tauri-apps/tauri/pull/3412)) on 2022-02-11
|
||||
|
||||
## \[1.0.0-rc.0]
|
||||
|
||||
- Allow user to specify windows sdk path in build.rs.
|
||||
- [59b6ee87](https://www.github.com/tauri-apps/tauri/commit/59b6ee87932d341433032befe3babd897ed8f7d0) fix(tauri-build): allow user to specify win sdk path (fix: [#2871](https://www.github.com/tauri-apps/tauri/pull/2871)) ([#2893](https://www.github.com/tauri-apps/tauri/pull/2893)) on 2021-11-16
|
||||
- Adds support for using JSON5 format for the `tauri.conf.json` file, along with also supporting the `.json5` extension.
|
||||
|
||||
Here is the logic flow that determines if JSON or JSON5 will be used to parse the config:
|
||||
|
||||
1. Check if `tauri.conf.json` exists
|
||||
a. Parse it with `serde_json`
|
||||
b. Parse it with `json5` if `serde_json` fails
|
||||
c. Return original `serde_json` error if all above steps failed
|
||||
2. Check if `tauri.conf.json5` exists
|
||||
a. Parse it with `json5`
|
||||
b. Return error if all above steps failed
|
||||
3. Return error if all above steps failed
|
||||
|
||||
- [995de57a](https://www.github.com/tauri-apps/tauri/commit/995de57a76cf51215277673e526d7ec32b86b564) Add seamless support for using JSON5 in the config file ([#47](https://www.github.com/tauri-apps/tauri/pull/47)) on 2022-02-03
|
||||
- Move the copying of resources and sidecars from `cli.rs` to `tauri-build` so using the Cargo CLI directly processes the files for the application execution in development.
|
||||
- [5eb72c24](https://www.github.com/tauri-apps/tauri/commit/5eb72c24deddf5a01093bea96b90c0d8806afc3f) refactor: copy resources and sidecars on the Cargo build script ([#3357](https://www.github.com/tauri-apps/tauri/pull/3357)) on 2022-02-08
|
||||
- The minimum Rust version is now `1.56`.
|
||||
- [a9dfc015](https://www.github.com/tauri-apps/tauri/commit/a9dfc015505afe91281c2027954ffcc588b1a59c) feat: update to edition 2021 and set minimum rust to 1.56 ([#2789](https://www.github.com/tauri-apps/tauri/pull/2789)) on 2021-10-22
|
||||
- Validate `tauri` dependency `features` under `Cargo.toml` matching `tauri.conf.json`'s `allowlist`.
|
||||
- [4de285c3](https://www.github.com/tauri-apps/tauri/commit/4de285c3967d32250d73acdd5d171a6fd332d2b3) feat(core): validate Cargo features matching allowlist \[TRI-023] on 2022-01-09
|
||||
|
||||
## \[1.0.0-beta.4]
|
||||
|
||||
- Implement `Debug` on public API structs and enums.
|
||||
- [fa9341ba](https://www.github.com/tauri-apps/tauri/commit/fa9341ba18ba227735341530900714dba0f27291) feat(core): implement `Debug` on public API structs/enums, closes [#2292](https://www.github.com/tauri-apps/tauri/pull/2292) ([#2387](https://www.github.com/tauri-apps/tauri/pull/2387)) on 2021-08-11
|
||||
|
||||
## \[1.0.0-beta.3]
|
||||
|
||||
- Improve ESM detection with regexes.
|
||||
- Bumped due to a bump in tauri-codegen.
|
||||
- [4b0ec018](https://www.github.com/tauri-apps/tauri/commit/4b0ec0188078a8fefd4119fe5e19ebc30191f802) fix(core): improve JS ESM detection ([#2139](https://www.github.com/tauri-apps/tauri/pull/2139)) on 2021-07-02
|
||||
- Inject invoke key on `script` tags with `type="module"`.
|
||||
- Bumped due to a bump in tauri-codegen.
|
||||
- [f03eea9c](https://www.github.com/tauri-apps/tauri/commit/f03eea9c9b964709532afbc4d1dd343b3fd96081) feat(core): inject invoke key on `<script type="module">` ([#2120](https://www.github.com/tauri-apps/tauri/pull/2120)) on 2021-06-29
|
||||
|
||||
## \[1.0.0-beta.2]
|
||||
|
||||
- Detect ESM scripts and inject the invoke key directly instead of using an IIFE.
|
||||
- Bumped due to a bump in tauri-codegen.
|
||||
- [7765c7fa](https://www.github.com/tauri-apps/tauri/commit/7765c7fa281853ddfb26b6b17534df95eaede804) fix(core): invoke key injection on ES module, improve performance ([#2094](https://www.github.com/tauri-apps/tauri/pull/2094)) on 2021-06-27
|
||||
- Improve invoke key code injection performance time rewriting code at compile time.
|
||||
- Bumped due to a bump in tauri-codegen.
|
||||
- [7765c7fa](https://www.github.com/tauri-apps/tauri/commit/7765c7fa281853ddfb26b6b17534df95eaede804) fix(core): invoke key injection on ES module, improve performance ([#2094](https://www.github.com/tauri-apps/tauri/pull/2094)) on 2021-06-27
|
||||
|
||||
## \[1.0.0-beta.1]
|
||||
|
||||
- Pull Windows resource information (`FileVersion`, `ProductVersion`, `ProductName` and `FileDescription`) from `tauri.conf.json > package` configuration.
|
||||
- [dc6b0d85](https://www.github.com/tauri-apps/tauri/commit/dc6b0d8522ca9f0962aa7c6fe446743889470b8c) feat(core): set .rc values from tauri.conf.json, closes [#1849](https://www.github.com/tauri-apps/tauri/pull/1849) ([#1951](https://www.github.com/tauri-apps/tauri/pull/1951)) on 2021-06-05
|
||||
|
||||
## \[1.0.0-beta.0]
|
||||
|
||||
- The `try_build` method now has a `Attributes` argument to allow specifying the window icon path used on Windows.
|
||||
- [c91105f](https://www.github.com/tauri-apps/tauri/commit/c91105ff965cceb2dfb402004c12799bf3b1c2f6) refactor(build): allow setting window icon path on `try_build` ([#1686](https://www.github.com/tauri-apps/tauri/pull/1686)) on 2021-05-03
|
||||
|
||||
## \[1.0.0-beta-rc.1]
|
||||
|
||||
- The package info APIs now checks the `package` object on `tauri.conf.json`.
|
||||
- Bumped due to a bump in tauri-codegen.
|
||||
- [8fd1baf](https://www.github.com/tauri-apps/tauri/commit/8fd1baf69b14bb81d7be9d31605ed7f02058b392) fix(core): pull package info from tauri.conf.json if set ([#1581](https://www.github.com/tauri-apps/tauri/pull/1581)) on 2021-04-22
|
||||
- [f575aaa](https://www.github.com/tauri-apps/tauri/commit/f575aaad71f23d44b2f89cf9ee5d84817dc3bb7a) fix: change files not referencing core packages ([#1619](https://www.github.com/tauri-apps/tauri/pull/1619)) on 2021-04-25
|
||||
|
||||
## \[1.0.0-beta-rc.0]
|
||||
|
||||
- Update all code files to have our license header.
|
||||
- [bf82136](https://www.github.com/tauri-apps/tauri/commit/bf8213646689175f8a158b956911f3a43e360690) feat(license): SPDX Headers ([#1449](https://www.github.com/tauri-apps/tauri/pull/1449)) on 2021-04-11
|
||||
- [a6def70](https://www.github.com/tauri-apps/tauri/commit/a6def7066eec19c889b0f14cc1e475bf209a332e) Refactor(tauri): move tauri-api and tauri-updater to tauri ([#1455](https://www.github.com/tauri-apps/tauri/pull/1455)) on 2021-04-11
|
||||
- [aea6145](https://www.github.com/tauri-apps/tauri/commit/aea614587bddab930d552512b54e18624fbf573e) refactor(repo): add /tooling folder ([#1457](https://www.github.com/tauri-apps/tauri/pull/1457)) on 2021-04-12
|
||||
36
core/tauri-build/Cargo.toml
Normal file
36
core/tauri-build/Cargo.toml
Normal file
@@ -0,0 +1,36 @@
|
||||
[package]
|
||||
name = "tauri-build"
|
||||
version = "1.0.4"
|
||||
authors = [ "Tauri Programme within The Commons Conservancy" ]
|
||||
categories = [ "gui", "web-programming" ]
|
||||
license = "Apache-2.0 OR MIT"
|
||||
homepage = "https://tauri.app"
|
||||
repository = "https://github.com/tauri-apps/tauri/tree/dev/core/tauri-build"
|
||||
description = "build time code to pair with https://crates.io/crates/tauri"
|
||||
edition = "2021"
|
||||
rust-version = "1.57"
|
||||
exclude = [ ".license_template", "CHANGELOG.md", "/target" ]
|
||||
readme = "README.md"
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
all-features = true
|
||||
rustdoc-args = [ "--cfg", "doc_cfg" ]
|
||||
|
||||
[dependencies]
|
||||
anyhow = "1"
|
||||
quote = { version = "1", optional = true }
|
||||
tauri-codegen = { version = "1.0.4", path = "../tauri-codegen", optional = true }
|
||||
tauri-utils = { version = "1.0.3", path = "../tauri-utils", features = [ "build", "resources" ] }
|
||||
cargo_toml = "0.11"
|
||||
serde_json = "1"
|
||||
heck = "0.4"
|
||||
json-patch = "0.2"
|
||||
|
||||
[target."cfg(windows)".dependencies]
|
||||
winres = "0.1"
|
||||
semver = "1"
|
||||
|
||||
[features]
|
||||
codegen = [ "tauri-codegen", "quote" ]
|
||||
isolation = [ "tauri-codegen/isolation", "tauri-utils/isolation" ]
|
||||
config-json5 = [ "tauri-utils/config-json5" ]
|
||||
@@ -1,15 +1,16 @@
|
||||
# tauri-build
|
||||
|
||||
<img align="right" src="https://github.com/tauri-apps/tauri/raw/dev/.github/icon.png" height="128" width="128">
|
||||
<img align="right" src="https://github.com/tauri-apps/tauri/raw/dev/app-icon.png" height="128" width="128">
|
||||
|
||||
[](https://github.com/tauri-apps/tauri)
|
||||
[](https://discord.gg/SpmNs4S)
|
||||
[](https://dev.to/tauri)
|
||||
|
||||

|
||||
[](https://tauri.app)
|
||||
|
||||
[](https://github.com/tauri-apps/tauri/tree/dev)
|
||||
[](https://opencollective.com/tauri)
|
||||
[](https://github.com/tauri-apps/tauri/actions/workflows/test-core.yml)
|
||||
[](https://app.fossa.com/projects/git%2Bgithub.com%2Ftauri-apps%2Ftauri?ref=badge_shield)
|
||||
[](https://discord.gg/SpmNs4S)
|
||||
[](https://tauri.app)
|
||||
[](https://good-labs.github.io/greater-good-affirmation)
|
||||
[](https://opencollective.com/tauri)
|
||||
[](https://opencollective.com/tauri)
|
||||
|
||||
| Component | Version |
|
||||
| ----------- | ---------------------------------------------------------------------------------------------------------- |
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy
|
||||
// Copyright 2019-2021 Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
@@ -7,27 +7,26 @@ use std::{
|
||||
env::var,
|
||||
fs::{create_dir_all, File},
|
||||
io::{BufWriter, Write},
|
||||
path::{Path, PathBuf},
|
||||
path::PathBuf,
|
||||
};
|
||||
use tauri_codegen::{context_codegen, ContextData};
|
||||
use tauri_utils::config::FrontendDist;
|
||||
|
||||
// TODO docs
|
||||
/// A builder for generating a Tauri application context during compile time.
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "codegen")))]
|
||||
#[cfg_attr(doc_cfg, doc(cfg(feature = "codegen")))]
|
||||
#[derive(Debug)]
|
||||
pub struct CodegenContext {
|
||||
dev: bool,
|
||||
config_path: PathBuf,
|
||||
out_file: PathBuf,
|
||||
capabilities: Option<Vec<PathBuf>>,
|
||||
}
|
||||
|
||||
impl Default for CodegenContext {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
dev: false,
|
||||
config_path: PathBuf::from("tauri.conf.json"),
|
||||
out_file: PathBuf::from("tauri-build-context.rs"),
|
||||
capabilities: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -53,26 +52,24 @@ impl CodegenContext {
|
||||
///
|
||||
/// **Note:** This path should be relative to the `OUT_DIR`.
|
||||
///
|
||||
/// Don't set this if you are using [`tauri::tauri_build_context!`] as that helper macro
|
||||
/// Don't set this if you are using [`tauri::include_codegen_context!`] as that helper macro
|
||||
/// expects the default value. This option can be useful if you are not using the helper and
|
||||
/// instead using [`std::include!`] on the generated code yourself.
|
||||
///
|
||||
/// Defaults to `tauri-build-context.rs`.
|
||||
///
|
||||
/// [`tauri::tauri_build_context!`]: https://docs.rs/tauri/latest/tauri/macro.tauri_build_context.html
|
||||
/// [`tauri::include_codegen_context!`]: https://docs.rs/tauri/0.12/tauri/macro.include_codegen_context.html
|
||||
#[must_use]
|
||||
pub fn out_file(mut self, filename: PathBuf) -> Self {
|
||||
self.out_file = filename;
|
||||
self
|
||||
}
|
||||
|
||||
/// Adds a capability file to the generated context.
|
||||
/// Run the codegen in a `dev` context, meaning that Tauri is using a dev server or local file for development purposes,
|
||||
/// usually with the `tauri dev` CLI command.
|
||||
#[must_use]
|
||||
pub fn capability<P: AsRef<Path>>(mut self, path: P) -> Self {
|
||||
self
|
||||
.capabilities
|
||||
.get_or_insert_with(Default::default)
|
||||
.push(path.as_ref().to_path_buf());
|
||||
pub fn dev(mut self) -> Self {
|
||||
self.dev = true;
|
||||
self
|
||||
}
|
||||
|
||||
@@ -80,58 +77,28 @@ impl CodegenContext {
|
||||
///
|
||||
/// Unless you are doing something special with this builder, you don't need to do anything with
|
||||
/// the returned output path.
|
||||
pub(crate) fn try_build(self) -> Result<PathBuf> {
|
||||
///
|
||||
/// # Panics
|
||||
///
|
||||
/// If any parts of the codegen fail, this will panic with the related error message. This is
|
||||
/// typically desirable when running inside a build script; see [`Self::try_build`] for no panics.
|
||||
pub fn build(self) -> PathBuf {
|
||||
match self.try_build() {
|
||||
Ok(out) => out,
|
||||
Err(error) => panic!("Error found during Codegen::build: {}", error),
|
||||
}
|
||||
}
|
||||
|
||||
/// Non-panicking [`Self::build`]
|
||||
pub fn try_build(self) -> Result<PathBuf> {
|
||||
let (config, config_parent) = tauri_codegen::get_config(&self.config_path)?;
|
||||
|
||||
// rerun if changed
|
||||
match &config.build.frontend_dist {
|
||||
Some(FrontendDist::Directory(p)) => {
|
||||
let dist_path = config_parent.join(p);
|
||||
if dist_path.exists() {
|
||||
println!("cargo:rerun-if-changed={}", dist_path.display());
|
||||
}
|
||||
}
|
||||
Some(FrontendDist::Files(files)) => {
|
||||
for path in files {
|
||||
println!(
|
||||
"cargo:rerun-if-changed={}",
|
||||
config_parent.join(path).display()
|
||||
);
|
||||
}
|
||||
}
|
||||
_ => (),
|
||||
}
|
||||
for icon in &config.bundle.icon {
|
||||
println!(
|
||||
"cargo:rerun-if-changed={}",
|
||||
config_parent.join(icon).display()
|
||||
);
|
||||
}
|
||||
if let Some(tray_icon) = config.app.tray_icon.as_ref().map(|t| &t.icon_path) {
|
||||
println!(
|
||||
"cargo:rerun-if-changed={}",
|
||||
config_parent.join(tray_icon).display()
|
||||
);
|
||||
}
|
||||
|
||||
#[cfg(target_os = "macos")]
|
||||
{
|
||||
let info_plist_path = config_parent.join("Info.plist");
|
||||
if info_plist_path.exists() {
|
||||
println!("cargo:rerun-if-changed={}", info_plist_path.display());
|
||||
}
|
||||
}
|
||||
|
||||
let code = context_codegen(ContextData {
|
||||
dev: crate::is_dev(),
|
||||
dev: self.dev,
|
||||
config,
|
||||
config_parent,
|
||||
// it's very hard to have a build script for unit tests, so assume this is always called from
|
||||
// outside the tauri crate, making the ::tauri root valid.
|
||||
root: quote::quote!(::tauri),
|
||||
capabilities: self.capabilities,
|
||||
assets: None,
|
||||
test: false,
|
||||
root: quote::quote!(::tauri::Context),
|
||||
})?;
|
||||
|
||||
// get the full output file path
|
||||
@@ -153,7 +120,7 @@ impl CodegenContext {
|
||||
)
|
||||
})?;
|
||||
|
||||
writeln!(file, "{code}").with_context(|| {
|
||||
writeln!(file, "{}", code).with_context(|| {
|
||||
format!(
|
||||
"Unable to write tokenstream to out file during tauri-build {}",
|
||||
out.display()
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2019-2024 Tauri Programme within The Commons Conservancy
|
||||
// Copyright 2019-2021 Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
450
core/tauri-build/src/lib.rs
Normal file
450
core/tauri-build/src/lib.rs
Normal file
@@ -0,0 +1,450 @@
|
||||
// Copyright 2019-2021 Tauri Programme within The Commons Conservancy
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#![cfg_attr(doc_cfg, feature(doc_cfg))]
|
||||
|
||||
pub use anyhow::Result;
|
||||
use heck::AsShoutySnakeCase;
|
||||
|
||||
use tauri_utils::resources::{external_binaries, resource_relpath, ResourcePaths};
|
||||
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
#[cfg(feature = "codegen")]
|
||||
mod codegen;
|
||||
#[cfg(windows)]
|
||||
mod static_vcruntime;
|
||||
|
||||
#[cfg(feature = "codegen")]
|
||||
#[cfg_attr(doc_cfg, doc(cfg(feature = "codegen")))]
|
||||
pub use codegen::context::CodegenContext;
|
||||
|
||||
fn copy_file(from: impl AsRef<Path>, to: impl AsRef<Path>) -> Result<()> {
|
||||
let from = from.as_ref();
|
||||
let to = to.as_ref();
|
||||
if !from.exists() {
|
||||
return Err(anyhow::anyhow!("{:?} does not exist", from));
|
||||
}
|
||||
if !from.is_file() {
|
||||
return Err(anyhow::anyhow!("{:?} is not a file", from));
|
||||
}
|
||||
let dest_dir = to.parent().expect("No data in parent");
|
||||
std::fs::create_dir_all(dest_dir)?;
|
||||
std::fs::copy(from, to)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn copy_binaries<'a>(binaries: ResourcePaths<'a>, target_triple: &str, path: &Path) -> Result<()> {
|
||||
for src in binaries {
|
||||
let src = src?;
|
||||
println!("cargo:rerun-if-changed={}", src.display());
|
||||
let dest = path.join(
|
||||
src
|
||||
.file_name()
|
||||
.expect("failed to extract external binary filename")
|
||||
.to_string_lossy()
|
||||
.replace(&format!("-{}", target_triple), ""),
|
||||
);
|
||||
if dest.exists() {
|
||||
std::fs::remove_file(&dest).unwrap();
|
||||
}
|
||||
copy_file(&src, &dest)?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Copies resources to a path.
|
||||
fn copy_resources(resources: ResourcePaths<'_>, path: &Path) -> Result<()> {
|
||||
for src in resources {
|
||||
let src = src?;
|
||||
println!("cargo:rerun-if-changed={}", src.display());
|
||||
let dest = path.join(resource_relpath(&src));
|
||||
copy_file(&src, &dest)?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
// checks if the given Cargo feature is enabled.
|
||||
fn has_feature(feature: &str) -> bool {
|
||||
// when a feature is enabled, Cargo sets the `CARGO_FEATURE_<name` env var to 1
|
||||
// https://doc.rust-lang.org/cargo/reference/environment-variables.html#environment-variables-cargo-sets-for-build-scripts
|
||||
std::env::var(format!("CARGO_FEATURE_{}", AsShoutySnakeCase(feature)))
|
||||
.map(|x| x == "1")
|
||||
.unwrap_or(false)
|
||||
}
|
||||
|
||||
// creates a cfg alias if `has_feature` is true.
|
||||
// `alias` must be a snake case string.
|
||||
fn cfg_alias(alias: &str, has_feature: bool) {
|
||||
if has_feature {
|
||||
println!("cargo:rustc-cfg={}", alias);
|
||||
}
|
||||
}
|
||||
|
||||
/// Attributes used on Windows.
|
||||
#[allow(dead_code)]
|
||||
#[derive(Debug, Default)]
|
||||
pub struct WindowsAttributes {
|
||||
window_icon_path: Option<PathBuf>,
|
||||
/// The path to the sdk location.
|
||||
///
|
||||
/// For the GNU toolkit this has to be the path where MinGW put windres.exe and ar.exe.
|
||||
/// This could be something like: "C:\Program Files\mingw-w64\x86_64-5.3.0-win32-seh-rt_v4-rev0\mingw64\bin"
|
||||
///
|
||||
/// For MSVC the Windows SDK has to be installed. It comes with the resource compiler rc.exe.
|
||||
/// This should be set to the root directory of the Windows SDK, e.g., "C:\Program Files (x86)\Windows Kits\10" or,
|
||||
/// if multiple 10 versions are installed, set it directly to the corret bin directory "C:\Program Files (x86)\Windows Kits\10\bin\10.0.14393.0\x64"
|
||||
///
|
||||
/// If it is left unset, it will look up a path in the registry, i.e. HKLM\SOFTWARE\Microsoft\Windows Kits\Installed Roots
|
||||
sdk_dir: Option<PathBuf>,
|
||||
}
|
||||
|
||||
impl WindowsAttributes {
|
||||
/// Creates the default attribute set.
|
||||
pub fn new() -> Self {
|
||||
Self::default()
|
||||
}
|
||||
|
||||
/// Sets the icon to use on the window. Currently only used on Windows.
|
||||
/// It must be in `ico` format. Defaults to `icons/icon.ico`.
|
||||
#[must_use]
|
||||
pub fn window_icon_path<P: AsRef<Path>>(mut self, window_icon_path: P) -> Self {
|
||||
self
|
||||
.window_icon_path
|
||||
.replace(window_icon_path.as_ref().into());
|
||||
self
|
||||
}
|
||||
|
||||
/// Sets the sdk dir for windows. Currently only used on Windows. This must be a valid UTF-8
|
||||
/// path. Defaults to whatever the `winres` crate determines is best.
|
||||
#[must_use]
|
||||
pub fn sdk_dir<P: AsRef<Path>>(mut self, sdk_dir: P) -> Self {
|
||||
self.sdk_dir = Some(sdk_dir.as_ref().into());
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
/// The attributes used on the build.
|
||||
#[derive(Debug, Default)]
|
||||
pub struct Attributes {
|
||||
#[allow(dead_code)]
|
||||
windows_attributes: WindowsAttributes,
|
||||
}
|
||||
|
||||
impl Attributes {
|
||||
/// Creates the default attribute set.
|
||||
pub fn new() -> Self {
|
||||
Self::default()
|
||||
}
|
||||
|
||||
/// Sets the icon to use on the window. Currently only used on Windows.
|
||||
#[must_use]
|
||||
pub fn windows_attributes(mut self, windows_attributes: WindowsAttributes) -> Self {
|
||||
self.windows_attributes = windows_attributes;
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
/// Run all build time helpers for your Tauri Application.
|
||||
///
|
||||
/// The current helpers include the following:
|
||||
/// * Generates a Windows Resource file when targeting Windows.
|
||||
///
|
||||
/// # Platforms
|
||||
///
|
||||
/// [`build()`] should be called inside of `build.rs` regardless of the platform:
|
||||
/// * New helpers may target more platforms in the future.
|
||||
/// * Platform specific code is handled by the helpers automatically.
|
||||
/// * A build script is required in order to activate some cargo environmental variables that are
|
||||
/// used when generating code and embedding assets - so [`build()`] may as well be called.
|
||||
///
|
||||
/// In short, this is saying don't put the call to [`build()`] behind a `#[cfg(windows)]`.
|
||||
///
|
||||
/// # Panics
|
||||
///
|
||||
/// If any of the build time helpers fail, they will [`std::panic!`] with the related error message.
|
||||
/// This is typically desirable when running inside a build script; see [`try_build`] for no panics.
|
||||
pub fn build() {
|
||||
if let Err(error) = try_build(Attributes::default()) {
|
||||
let error = format!("{:#}", error);
|
||||
println!("{}", error);
|
||||
if error.starts_with("unknown field") {
|
||||
print!("found an unknown configuration field. This usually means that you are using a CLI version that is newer than `tauri-build` and is incompatible. ");
|
||||
println!(
|
||||
"Please try updating the Rust crates by running `cargo update` in the Tauri app folder."
|
||||
);
|
||||
}
|
||||
std::process::exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
/// Non-panicking [`build()`].
|
||||
#[allow(unused_variables)]
|
||||
pub fn try_build(attributes: Attributes) -> Result<()> {
|
||||
use anyhow::anyhow;
|
||||
use cargo_toml::{Dependency, Manifest};
|
||||
use tauri_utils::config::{Config, TauriConfig};
|
||||
|
||||
println!("cargo:rerun-if-env-changed=TAURI_CONFIG");
|
||||
println!("cargo:rerun-if-changed=tauri.conf.json");
|
||||
#[cfg(feature = "config-json5")]
|
||||
println!("cargo:rerun-if-changed=tauri.conf.json5");
|
||||
|
||||
let mut config = serde_json::from_value(tauri_utils::config::parse::read_from(
|
||||
std::env::current_dir().unwrap(),
|
||||
)?)?;
|
||||
if let Ok(env) = std::env::var("TAURI_CONFIG") {
|
||||
let merge_config: serde_json::Value = serde_json::from_str(&env)?;
|
||||
json_patch::merge(&mut config, &merge_config);
|
||||
}
|
||||
let config: Config = serde_json::from_value(config)?;
|
||||
|
||||
cfg_alias("dev", !has_feature("custom-protocol"));
|
||||
|
||||
let mut manifest = Manifest::from_path("Cargo.toml")?;
|
||||
if let Some(tauri) = manifest.dependencies.remove("tauri") {
|
||||
let features = match tauri {
|
||||
Dependency::Simple(_) => Vec::new(),
|
||||
Dependency::Detailed(dep) => dep.features,
|
||||
};
|
||||
|
||||
let all_cli_managed_features = TauriConfig::all_features();
|
||||
let diff = features_diff(
|
||||
&features
|
||||
.into_iter()
|
||||
.filter(|f| all_cli_managed_features.contains(&f.as_str()))
|
||||
.collect::<Vec<String>>(),
|
||||
&config
|
||||
.tauri
|
||||
.features()
|
||||
.into_iter()
|
||||
.map(|f| f.to_string())
|
||||
.collect::<Vec<String>>(),
|
||||
);
|
||||
|
||||
let mut error_message = String::new();
|
||||
if !diff.remove.is_empty() {
|
||||
error_message.push_str("remove the `");
|
||||
error_message.push_str(&diff.remove.join(", "));
|
||||
error_message.push_str(if diff.remove.len() == 1 {
|
||||
"` feature"
|
||||
} else {
|
||||
"` features"
|
||||
});
|
||||
if !diff.add.is_empty() {
|
||||
error_message.push_str(" and ");
|
||||
}
|
||||
}
|
||||
if !diff.add.is_empty() {
|
||||
error_message.push_str("add the `");
|
||||
error_message.push_str(&diff.add.join(", "));
|
||||
error_message.push_str(if diff.add.len() == 1 {
|
||||
"` feature"
|
||||
} else {
|
||||
"` features"
|
||||
});
|
||||
}
|
||||
|
||||
if !error_message.is_empty() {
|
||||
return Err(anyhow!("
|
||||
The `tauri` dependency features on the `Cargo.toml` file does not match the allowlist defined under `tauri.conf.json`.
|
||||
Please run `tauri dev` or `tauri build` or {}.
|
||||
", error_message));
|
||||
}
|
||||
}
|
||||
|
||||
let target_triple = std::env::var("TARGET").unwrap();
|
||||
let out_dir = PathBuf::from(std::env::var("OUT_DIR").unwrap());
|
||||
// TODO: far from ideal, but there's no other way to get the target dir, see <https://github.com/rust-lang/cargo/issues/5457>
|
||||
let target_dir = out_dir
|
||||
.parent()
|
||||
.unwrap()
|
||||
.parent()
|
||||
.unwrap()
|
||||
.parent()
|
||||
.unwrap();
|
||||
|
||||
if let Some(paths) = &config.tauri.bundle.external_bin {
|
||||
copy_binaries(
|
||||
ResourcePaths::new(external_binaries(paths, &target_triple).as_slice(), true),
|
||||
&target_triple,
|
||||
target_dir,
|
||||
)?;
|
||||
}
|
||||
|
||||
#[allow(unused_mut, clippy::redundant_clone)]
|
||||
let mut resources = config.tauri.bundle.resources.clone().unwrap_or_default();
|
||||
#[cfg(windows)]
|
||||
if let Some(fixed_webview2_runtime_path) = &config.tauri.bundle.windows.webview_fixed_runtime_path
|
||||
{
|
||||
resources.push(fixed_webview2_runtime_path.display().to_string());
|
||||
}
|
||||
copy_resources(ResourcePaths::new(resources.as_slice(), true), target_dir)?;
|
||||
|
||||
#[cfg(target_os = "macos")]
|
||||
{
|
||||
if let Some(version) = config.tauri.bundle.macos.minimum_system_version {
|
||||
println!("cargo:rustc-env=MACOSX_DEPLOYMENT_TARGET={}", version);
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
{
|
||||
use anyhow::Context;
|
||||
use semver::Version;
|
||||
use winres::{VersionInfo, WindowsResource};
|
||||
|
||||
fn find_icon<F: Fn(&&String) -> bool>(config: &Config, predicate: F, default: &str) -> PathBuf {
|
||||
let icon_path = config
|
||||
.tauri
|
||||
.bundle
|
||||
.icon
|
||||
.iter()
|
||||
.find(|i| predicate(i))
|
||||
.cloned()
|
||||
.unwrap_or_else(|| default.to_string());
|
||||
icon_path.into()
|
||||
}
|
||||
|
||||
let window_icon_path = attributes
|
||||
.windows_attributes
|
||||
.window_icon_path
|
||||
.unwrap_or_else(|| find_icon(&config, |i| i.ends_with(".ico"), "icons/icon.ico"));
|
||||
|
||||
if window_icon_path.exists() {
|
||||
let mut res = WindowsResource::new();
|
||||
if let Some(sdk_dir) = &attributes.windows_attributes.sdk_dir {
|
||||
if let Some(sdk_dir_str) = sdk_dir.to_str() {
|
||||
res.set_toolkit_path(sdk_dir_str);
|
||||
} else {
|
||||
return Err(anyhow!(
|
||||
"sdk_dir path is not valid; only UTF-8 characters are allowed"
|
||||
));
|
||||
}
|
||||
}
|
||||
if let Some(version) = &config.package.version {
|
||||
if let Ok(v) = Version::parse(version) {
|
||||
let version = v.major << 48 | v.minor << 32 | v.patch << 16;
|
||||
res.set_version_info(VersionInfo::FILEVERSION, version);
|
||||
res.set_version_info(VersionInfo::PRODUCTVERSION, version);
|
||||
}
|
||||
res.set("FileVersion", version);
|
||||
res.set("ProductVersion", version);
|
||||
}
|
||||
if let Some(product_name) = &config.package.product_name {
|
||||
res.set("ProductName", product_name);
|
||||
res.set("FileDescription", product_name);
|
||||
}
|
||||
res.set_icon_with_id(&window_icon_path.display().to_string(), "32512");
|
||||
res.compile().with_context(|| {
|
||||
format!(
|
||||
"failed to compile `{}` into a Windows Resource file during tauri-build",
|
||||
window_icon_path.display()
|
||||
)
|
||||
})?;
|
||||
} else {
|
||||
return Err(anyhow!(format!(
|
||||
"`{}` not found; required for generating a Windows Resource file during tauri-build",
|
||||
window_icon_path.display()
|
||||
)));
|
||||
}
|
||||
|
||||
let target_env = std::env::var("CARGO_CFG_TARGET_ENV").unwrap();
|
||||
match target_env.as_str() {
|
||||
"gnu" => {
|
||||
let target_arch = match std::env::var("CARGO_CFG_TARGET_ARCH").unwrap().as_str() {
|
||||
"x86_64" => Some("x64"),
|
||||
"x86" => Some("x86"),
|
||||
"aarch64" => Some("arm64"),
|
||||
arch => None,
|
||||
};
|
||||
if let Some(target_arch) = target_arch {
|
||||
for entry in std::fs::read_dir(target_dir.join("build"))? {
|
||||
let path = entry?.path();
|
||||
let webview2_loader_path = path
|
||||
.join("out")
|
||||
.join(target_arch)
|
||||
.join("WebView2Loader.dll");
|
||||
if path.to_string_lossy().contains("webview2-com-sys") && webview2_loader_path.exists()
|
||||
{
|
||||
std::fs::copy(webview2_loader_path, target_dir.join("WebView2Loader.dll"))?;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
"msvc" => {
|
||||
if std::env::var("STATIC_VCRUNTIME").map_or(false, |v| v == "true") {
|
||||
static_vcruntime::build();
|
||||
}
|
||||
}
|
||||
_ => (),
|
||||
}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[derive(Debug, Default, PartialEq, Eq)]
|
||||
struct Diff {
|
||||
remove: Vec<String>,
|
||||
add: Vec<String>,
|
||||
}
|
||||
|
||||
fn features_diff(current: &[String], expected: &[String]) -> Diff {
|
||||
let mut remove = Vec::new();
|
||||
let mut add = Vec::new();
|
||||
for feature in current {
|
||||
if !expected.contains(feature) {
|
||||
remove.push(feature.clone());
|
||||
}
|
||||
}
|
||||
|
||||
for feature in expected {
|
||||
if !current.contains(feature) {
|
||||
add.push(feature.clone());
|
||||
}
|
||||
}
|
||||
|
||||
Diff { remove, add }
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::Diff;
|
||||
|
||||
#[test]
|
||||
fn array_diff() {
|
||||
for (current, expected, result) in [
|
||||
(vec![], vec![], Default::default()),
|
||||
(
|
||||
vec!["a".into()],
|
||||
vec![],
|
||||
Diff {
|
||||
remove: vec!["a".into()],
|
||||
add: vec![],
|
||||
},
|
||||
),
|
||||
(vec!["a".into()], vec!["a".into()], Default::default()),
|
||||
(
|
||||
vec!["a".into(), "b".into()],
|
||||
vec!["a".into()],
|
||||
Diff {
|
||||
remove: vec!["b".into()],
|
||||
add: vec![],
|
||||
},
|
||||
),
|
||||
(
|
||||
vec!["a".into(), "b".into()],
|
||||
vec!["a".into(), "c".into()],
|
||||
Diff {
|
||||
remove: vec!["b".into()],
|
||||
add: vec!["c".into()],
|
||||
},
|
||||
),
|
||||
] {
|
||||
assert_eq!(super::features_diff(¤t, &expected), result);
|
||||
}
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user