refactor!: drop support for tauri<2.0.0 (#1167)
5
.changes/drop-tauri-v1.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
action: major
|
||||
---
|
||||
|
||||
**Breaking Change**: Drop support for Tauri v1 and unstable v2 (alpha, beta, rc) versions.
|
||||
1
.github/fixtures/example-v1/.gitignore
vendored
@@ -1 +0,0 @@
|
||||
dist/index.tauri.html
|
||||
7
.github/fixtures/example-v1/dist/index.html
vendored
@@ -1,7 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head></head>
|
||||
<body>
|
||||
<h3>Hello!</h3>
|
||||
</body>
|
||||
</html>
|
||||
BIN
.github/fixtures/example-v1/icon.png
vendored
|
Before Width: | Height: | Size: 16 KiB |
14
.github/fixtures/example-v1/package.json
vendored
@@ -1,14 +0,0 @@
|
||||
{
|
||||
"name": "example",
|
||||
"version": "0.0.1",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"author": "",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@tauri-apps/cli": "^1.6.3"
|
||||
}
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
dist/index.tauri.html
|
||||
@@ -1,7 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head></head>
|
||||
<body>
|
||||
<h3>Hello!</h3>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,11 +0,0 @@
|
||||
{
|
||||
"name": "example-with-tauri",
|
||||
"version": "0.1.1",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"author": "",
|
||||
"license": "MIT"
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
# Generated by Cargo
|
||||
# will have compiled files and executables
|
||||
/target/
|
||||
WixTools
|
||||
|
||||
# These are backup files generated by rustfmt
|
||||
**/*.rs.bk
|
||||
|
||||
config.json
|
||||
bundle.json
|
||||
@@ -1,28 +0,0 @@
|
||||
[package]
|
||||
name = "test-app"
|
||||
version = "0.1.0"
|
||||
description = "A Tauri App"
|
||||
authors = ["you"]
|
||||
license = ""
|
||||
repository = ""
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
serde_json = "1"
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
tauri = { version = "1", features = ["api-all", "updater"] }
|
||||
|
||||
[build-dependencies]
|
||||
tauri-build = { version = "1", features = [] }
|
||||
|
||||
[features]
|
||||
custom-protocol = ["tauri/custom-protocol"]
|
||||
|
||||
[profile.dev]
|
||||
opt-level = 0
|
||||
lto = false
|
||||
debug = false
|
||||
|
||||
[profile.release]
|
||||
opt-level = 0
|
||||
lto = false
|
||||
@@ -1,3 +0,0 @@
|
||||
fn main() {
|
||||
tauri_build::build()
|
||||
}
|
||||
|
Before Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 37 KiB |
|
Before Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 41 KiB |
|
Before Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 45 KiB |
|
Before Width: | Height: | Size: 3.7 KiB |
|
Before Width: | Height: | Size: 7.2 KiB |
|
Before Width: | Height: | Size: 9.6 KiB |
|
Before Width: | Height: | Size: 4.4 KiB |
|
Before Width: | Height: | Size: 56 KiB |
|
Before Width: | Height: | Size: 88 KiB |
@@ -1,7 +0,0 @@
|
||||
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
|
||||
|
||||
fn main() {
|
||||
tauri::Builder::default()
|
||||
.run(tauri::generate_context!())
|
||||
.expect("error while running tauri application");
|
||||
}
|
||||
@@ -1,64 +0,0 @@
|
||||
{
|
||||
"build": {
|
||||
"distDir": "../dist",
|
||||
"devPath": "http://localhost:4000",
|
||||
"beforeDevCommand": "",
|
||||
"beforeBuildCommand": ""
|
||||
},
|
||||
"package": {
|
||||
"productName": "TauriExample App (v1)",
|
||||
"version": "0.1.1"
|
||||
},
|
||||
"tauri": {
|
||||
"bundle": {
|
||||
"active": true,
|
||||
"targets": "all",
|
||||
"identifier": "com.tauri.actiontest",
|
||||
"icon": [
|
||||
"icons/32x32.png",
|
||||
"icons/128x128.png",
|
||||
"icons/128x128@2x.png",
|
||||
"icons/icon.icns",
|
||||
"icons/icon.ico"
|
||||
],
|
||||
"resources": [],
|
||||
"externalBin": [],
|
||||
"copyright": "",
|
||||
"category": "DeveloperTool",
|
||||
"shortDescription": "",
|
||||
"longDescription": "",
|
||||
"deb": {
|
||||
"depends": []
|
||||
},
|
||||
"macOS": {
|
||||
"frameworks": [],
|
||||
"minimumSystemVersion": "",
|
||||
"exceptionDomain": ""
|
||||
},
|
||||
"windows": {
|
||||
"nsis": {
|
||||
"compression": "zlib"
|
||||
}
|
||||
}
|
||||
},
|
||||
"updater": {
|
||||
"active": true,
|
||||
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDE5QzMxNjYwNTM5OEUwNTgKUldSWTRKaFRZQmJER1h4d1ZMYVA3dnluSjdpN2RmMldJR09hUFFlZDY0SlFqckkvRUJhZDJVZXAK"
|
||||
},
|
||||
"allowlist": {
|
||||
"all": true
|
||||
},
|
||||
"windows": [
|
||||
{
|
||||
"title": "Tauri App",
|
||||
"width": 800,
|
||||
"height": 600,
|
||||
"resizable": true,
|
||||
"fullscreen": false
|
||||
}
|
||||
],
|
||||
"security": {
|
||||
"csp": "default-src blob: data: filesystem: ws: http: https: 'unsafe-eval' 'unsafe-inline'"
|
||||
}
|
||||
}
|
||||
}
|
||||
203
.github/workflows/test-action.yml
vendored
@@ -8,101 +8,6 @@ on:
|
||||
- dev
|
||||
|
||||
jobs:
|
||||
v1:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- platform: 'macos-latest'
|
||||
args: '--verbose --target universal-apple-darwin'
|
||||
- platform: 'ubuntu-22.04'
|
||||
args: '--verbose'
|
||||
- platform: 'windows-latest'
|
||||
args: '--verbose'
|
||||
|
||||
runs-on: ${{ matrix.platform }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
# node
|
||||
- name: install pnpm
|
||||
uses: pnpm/action-setup@v4
|
||||
with:
|
||||
version: 10.x.x
|
||||
|
||||
- name: setup node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: lts/*
|
||||
cache: pnpm
|
||||
|
||||
- name: install example dependencies
|
||||
run: |
|
||||
cd ./.github/fixtures/example-v1
|
||||
pnpm install
|
||||
# Testing cli fallback install
|
||||
# cd ../example-with-tauri-v1
|
||||
# pnpm install
|
||||
|
||||
# rust
|
||||
- name: install Rust stable
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
targets: aarch64-apple-darwin,x86_64-apple-darwin
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
cache-on-failure: true
|
||||
workspaces: |
|
||||
./.github/fixtures/example-v1/src-tauri -> ../../target
|
||||
./.github/fixtures/example-with-tauri-v1/src-tauri -> ../../target
|
||||
|
||||
# system
|
||||
- name: install dependencies (ubuntu only)
|
||||
if: matrix.platform == 'ubuntu-22.04'
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev
|
||||
|
||||
- name: Preconfigured Tauri Project
|
||||
uses: ./
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
# Updater signature is exposed here to make sure it works in PR's
|
||||
TAURI_PRIVATE_KEY: dW50cnVzdGVkIGNvbW1lbnQ6IHJzaWduIGVuY3J5cHRlZCBzZWNyZXQga2V5ClJXUlRZMEl5YTBGV3JiTy9lRDZVd3NkL0RoQ1htZmExNDd3RmJaNmRMT1ZGVjczWTBKZ0FBQkFBQUFBQUFBQUFBQUlBQUFBQWdMekUzVkE4K0tWQ1hjeGt1Vkx2QnRUR3pzQjVuV0ZpM2czWXNkRm9hVUxrVnB6TUN3K1NheHJMREhQbUVWVFZRK3NIL1VsMDBHNW5ET1EzQno0UStSb21nRW4vZlpTaXIwZFh5ZmRlL1lSN0dKcHdyOUVPclVvdzFhVkxDVnZrbHM2T1o4Tk1NWEU9Cg==
|
||||
with:
|
||||
projectPath: ./.github/fixtures/example-with-tauri-v1
|
||||
includeDebug: true
|
||||
includeRelease: false
|
||||
tagName: ${{ !github.event.pull_request.head.repo.fork && 'example-with-tauri-v__VERSION__' || '' }}
|
||||
releaseName: 'Release example with preconfigured Tauri app v__VERSION__ for tauri-v1'
|
||||
releaseBody: 'See the assets to download this version and install.'
|
||||
releaseDraft: true
|
||||
uploadPlainBinary: true
|
||||
args: ${{ matrix.args }}
|
||||
|
||||
- name: Frontend-only Project
|
||||
uses: ./
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
# Updater signature is exposed here to make sure it works in PR's
|
||||
TAURI_PRIVATE_KEY: dW50cnVzdGVkIGNvbW1lbnQ6IHJzaWduIGVuY3J5cHRlZCBzZWNyZXQga2V5ClJXUlRZMEl5YTBGV3JiTy9lRDZVd3NkL0RoQ1htZmExNDd3RmJaNmRMT1ZGVjczWTBKZ0FBQkFBQUFBQUFBQUFBQUlBQUFBQWdMekUzVkE4K0tWQ1hjeGt1Vkx2QnRUR3pzQjVuV0ZpM2czWXNkRm9hVUxrVnB6TUN3K1NheHJMREhQbUVWVFZRK3NIL1VsMDBHNW5ET1EzQno0UStSb21nRW4vZlpTaXIwZFh5ZmRlL1lSN0dKcHdyOUVPclVvdzFhVkxDVnZrbHM2T1o4Tk1NWEU9Cg==
|
||||
with:
|
||||
projectPath: ./.github/fixtures/example-v1
|
||||
distPath: ../dist # relative to tauri.conf.json
|
||||
iconPath: ./icon.png # relative to projectPath
|
||||
bundleIdentifier: com.tauri.actiontest
|
||||
appName: example
|
||||
appVersion: ../package.json # relative to tauri.conf.json
|
||||
includeDebug: true
|
||||
includeRelease: false
|
||||
tagName: ${{ !github.event.pull_request.head.repo.fork && 'example-v__VERSION__' || '' }}
|
||||
releaseName: 'Release example app v__VERSION__ for tauri-v1'
|
||||
releaseBody: 'See the assets to download this version and install.'
|
||||
releaseDraft: true
|
||||
uploadPlainBinary: true
|
||||
args: ${{ matrix.args }}
|
||||
|
||||
v2:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
@@ -114,98 +19,6 @@ jobs:
|
||||
args: '--verbose'
|
||||
- platform: 'windows-latest'
|
||||
args: '--verbose'
|
||||
|
||||
runs-on: ${{ matrix.platform }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
# node
|
||||
- name: install pnpm
|
||||
uses: pnpm/action-setup@v4
|
||||
with:
|
||||
version: 10.x.x
|
||||
|
||||
- name: setup node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: lts/*
|
||||
cache: pnpm
|
||||
|
||||
- name: install example dependencies
|
||||
run: |
|
||||
cd ./.github/fixtures/example-v2
|
||||
pnpm install
|
||||
# Testing cli fallback install
|
||||
# cd ../example-with-tauri-v2
|
||||
# pnpm install
|
||||
|
||||
# rust
|
||||
- name: install Rust stable
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
targets: aarch64-apple-darwin,x86_64-apple-darwin
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
cache-on-failure: true
|
||||
workspaces: |
|
||||
./.github/fixtures/example-v2/src-tauri -> ../../target
|
||||
./.github/fixtures/example-with-tauri-v2/src-tauri -> ../../target
|
||||
|
||||
# system
|
||||
- name: install dependencies (ubuntu only)
|
||||
if: matrix.platform == 'ubuntu-22.04'
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev
|
||||
|
||||
- name: Preconfigured Tauri Project
|
||||
uses: ./
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
# Updater signature is exposed here to make sure it works in PR's
|
||||
TAURI_SIGNING_PRIVATE_KEY: dW50cnVzdGVkIGNvbW1lbnQ6IHJzaWduIGVuY3J5cHRlZCBzZWNyZXQga2V5ClJXUlRZMEl5YTBGV3JiTy9lRDZVd3NkL0RoQ1htZmExNDd3RmJaNmRMT1ZGVjczWTBKZ0FBQkFBQUFBQUFBQUFBQUlBQUFBQWdMekUzVkE4K0tWQ1hjeGt1Vkx2QnRUR3pzQjVuV0ZpM2czWXNkRm9hVUxrVnB6TUN3K1NheHJMREhQbUVWVFZRK3NIL1VsMDBHNW5ET1EzQno0UStSb21nRW4vZlpTaXIwZFh5ZmRlL1lSN0dKcHdyOUVPclVvdzFhVkxDVnZrbHM2T1o4Tk1NWEU9Cg==
|
||||
with:
|
||||
projectPath: ./.github/fixtures/example-with-tauri-v2
|
||||
includeDebug: true
|
||||
includeRelease: false
|
||||
tagName: ${{ !github.event.pull_request.head.repo.fork && 'example-with-tauri-v__VERSION__' || '' }}
|
||||
releaseName: 'Release example with preconfigured Tauri app v__VERSION__ for tauri-v2'
|
||||
releaseBody: 'See the assets to download this version and install.'
|
||||
releaseDraft: true
|
||||
args: ${{ matrix.args }}
|
||||
updaterJsonKeepUniversal: true
|
||||
retryAttempts: 1
|
||||
assetNamePattern: '[name]x[version]x[platform]x[arch]x[mode]x[setup]x[ext]'
|
||||
uploadPlainBinary: true
|
||||
|
||||
- name: Frontend-only Project
|
||||
uses: ./
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
# Updater signature is exposed here to make sure it works in PR's
|
||||
TAURI_SIGNING_PRIVATE_KEY: dW50cnVzdGVkIGNvbW1lbnQ6IHJzaWduIGVuY3J5cHRlZCBzZWNyZXQga2V5ClJXUlRZMEl5YTBGV3JiTy9lRDZVd3NkL0RoQ1htZmExNDd3RmJaNmRMT1ZGVjczWTBKZ0FBQkFBQUFBQUFBQUFBQUlBQUFBQWdMekUzVkE4K0tWQ1hjeGt1Vkx2QnRUR3pzQjVuV0ZpM2czWXNkRm9hVUxrVnB6TUN3K1NheHJMREhQbUVWVFZRK3NIL1VsMDBHNW5ET1EzQno0UStSb21nRW4vZlpTaXIwZFh5ZmRlL1lSN0dKcHdyOUVPclVvdzFhVkxDVnZrbHM2T1o4Tk1NWEU9Cg==
|
||||
with:
|
||||
projectPath: ./.github/fixtures/example-v2
|
||||
distPath: ../dist # relative to tauri.conf.json
|
||||
iconPath: ./icon.png # relative to projectPath
|
||||
bundleIdentifier: com.tauri.actiontest
|
||||
appName: example
|
||||
appVersion: ../package.json # relative to tauri.conf.json
|
||||
includeDebug: true
|
||||
includeRelease: false
|
||||
tagName: ${{ !github.event.pull_request.head.repo.fork && 'example-v__VERSION__' || '' }}
|
||||
releaseName: 'Release example app v__VERSION__ for tauri-v2'
|
||||
releaseBody: 'See the assets to download this version and install.'
|
||||
releaseDraft: true
|
||||
uploadPlainBinary: true
|
||||
args: ${{ matrix.args }}
|
||||
|
||||
arm:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- platform: 'ubuntu-24.04-arm'
|
||||
args: '--verbose'
|
||||
- platform: 'windows-11-arm'
|
||||
@@ -238,6 +51,8 @@ jobs:
|
||||
# rust
|
||||
- name: install Rust stable
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
targets: aarch64-apple-darwin,x86_64-apple-darwin
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
@@ -248,7 +63,7 @@ jobs:
|
||||
|
||||
# system
|
||||
- name: install dependencies (ubuntu only)
|
||||
if: matrix.platform == 'ubuntu-24.04-arm'
|
||||
if: matrix.platform == 'ubuntu-22.04' || matrix.platform == 'ubuntu-24.04-arm'
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev
|
||||
@@ -263,16 +78,14 @@ jobs:
|
||||
projectPath: ./.github/fixtures/example-with-tauri-v2
|
||||
includeDebug: true
|
||||
includeRelease: false
|
||||
tagName: ${{ !github.event.pull_request.head.repo.fork && 'example-arm-with-tauri-v__VERSION__' || '' }}
|
||||
releaseName: 'Release example with preconfigured Tauri app v__VERSION__ for tauri-v2 on ARM'
|
||||
tagName: ${{ !github.event.pull_request.head.repo.fork && 'example-with-tauri-v__VERSION__' || '' }}
|
||||
releaseName: 'Release example with preconfigured Tauri app v__VERSION__ for tauri-v2'
|
||||
releaseBody: 'See the assets to download this version and install.'
|
||||
releaseDraft: true
|
||||
args: ${{ matrix.args }}
|
||||
updaterJsonKeepUniversal: true
|
||||
retryAttempts: 1
|
||||
assetNamePattern: '[name]x[version]x[platform]x[arch]x[mode]x[setup]x[ext]'
|
||||
uploadPlainBinary: true
|
||||
generateReleaseNotes: true
|
||||
|
||||
- name: Frontend-only Project
|
||||
uses: ./
|
||||
@@ -289,10 +102,10 @@ jobs:
|
||||
appVersion: ../package.json # relative to tauri.conf.json
|
||||
includeDebug: true
|
||||
includeRelease: false
|
||||
tagName: ${{ !github.event.pull_request.head.repo.fork && 'example-arm-v__VERSION__' || '' }}
|
||||
releaseName: 'Release example app v__VERSION__ for tauri-v2 on ARM'
|
||||
tagName: ${{ !github.event.pull_request.head.repo.fork && 'example-v__VERSION__' || '' }}
|
||||
releaseName: 'Release example app v__VERSION__ for tauri-v2'
|
||||
releaseBody: 'See the assets to download this version and install.'
|
||||
releaseDraft: true
|
||||
uploadPlainBinary: true
|
||||
generateReleaseNotes: true
|
||||
args: ${{ matrix.args }}
|
||||
assetNamePattern: '[name]x[version]x[platform]x[arch]x[mode]x[setup]x[ext]'
|
||||
|
||||
252
dist/index.js
vendored
@@ -2058,7 +2058,7 @@ const Context = __importStar(__nccwpck_require__(3077));
|
||||
const Utils = __importStar(__nccwpck_require__(8399));
|
||||
// octokit + plugins
|
||||
const core_1 = __nccwpck_require__(1772);
|
||||
const plugin_rest_endpoint_methods_1 = __nccwpck_require__(6316);
|
||||
const plugin_rest_endpoint_methods_1 = __nccwpck_require__(6363);
|
||||
const plugin_paginate_rest_1 = __nccwpck_require__(8633);
|
||||
exports.context = new Context.Context();
|
||||
const baseUrl = Utils.getApiBaseUrl();
|
||||
@@ -7678,7 +7678,7 @@ paginateRest.VERSION = VERSION;
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 6316:
|
||||
/***/ 6363:
|
||||
/***/ ((module) => {
|
||||
|
||||
|
||||
@@ -42164,7 +42164,6 @@ async function initProject(root, runner, options) {
|
||||
|
||||
;// CONCATENATED MODULE: ./src/runner.ts
|
||||
|
||||
|
||||
class Runner {
|
||||
constructor(bin, tauriScript) {
|
||||
this.bin = bin;
|
||||
@@ -42199,21 +42198,7 @@ async function getRunner(root, tauriScript) {
|
||||
return new Runner('bun', ['tauri']);
|
||||
return new Runner('npm', ['run', 'tauri']);
|
||||
}
|
||||
// TODO: Change to v2 after a while.
|
||||
let tag = 'v1';
|
||||
try {
|
||||
const tauriDir = (0,utils/* getTauriDir */.Z0)(root);
|
||||
if (tauriDir) {
|
||||
const baseConf = src_config/* TauriConfig */.K.fromBaseConfig(tauriDir);
|
||||
if (baseConf && baseConf.isV2()) {
|
||||
tag = 'v2';
|
||||
}
|
||||
}
|
||||
}
|
||||
catch {
|
||||
// ignore
|
||||
}
|
||||
await (0,utils/* execCommand */.NK)('npm', ['install', '-g', `@tauri-apps/cli@${tag}`], {
|
||||
await (0,utils/* execCommand */.NK)('npm', ['install', '-g', `@tauri-apps/cli@v2`], {
|
||||
cwd: undefined,
|
||||
});
|
||||
return new Runner('tauri');
|
||||
@@ -42252,7 +42237,6 @@ async function buildProject(root, debug, buildOpts, initOpts, retryAttempts, upl
|
||||
mainBinaryName: info.mainBinaryName,
|
||||
version: info.version,
|
||||
wixLanguage: info.wixLanguage,
|
||||
wixAppVersion: info.wixAppVersion,
|
||||
rpmRelease: info.rpmRelease,
|
||||
};
|
||||
await runner.execTauriCommand(['build'], [...tauriArgs], root, targetInfo.platform === 'macos'
|
||||
@@ -42260,15 +42244,6 @@ async function buildProject(root, debug, buildOpts, initOpts, retryAttempts, upl
|
||||
TAURI_BUNDLER_DMG_IGNORE_CI: process.env.TAURI_BUNDLER_DMG_IGNORE_CI ?? 'true',
|
||||
}
|
||||
: undefined, retryAttempts);
|
||||
// on Linux, the app product name is converted to kebab-case and `()[]{}` will be removed
|
||||
// with tauri-cli 2.0.0-beta.19 deb and appimage will now use the product name as on the other platforms.
|
||||
// with tauri-cli 2.0.0-beta.21 rpm will do too.
|
||||
const linuxFileAppName = app.name
|
||||
.replace(/([a-z0-9])([A-Z])/g, '$1-$2')
|
||||
.replace(/([A-Z])([A-Z])(?=[a-z])/g, '$1-$2')
|
||||
.replace(/[ _.]/g, '-')
|
||||
.replace(/[()[\]{}]/g, '')
|
||||
.toLowerCase();
|
||||
const workspacePath = (0,utils/* getWorkspaceDir */.Lw)(app.tauriPath) ?? app.tauriPath;
|
||||
const artifactsPath = (0,external_node_path_.join)((0,utils/* getTargetDir */.d)(workspacePath, info.tauriPath, !!targetPath), targetPath ?? '', profile ? profile : debug ? 'debug' : 'release');
|
||||
let artifacts = [];
|
||||
@@ -42342,44 +42317,6 @@ async function buildProject(root, debug, buildOpts, initOpts, retryAttempts, upl
|
||||
langs = Object.keys(app.wixLanguage);
|
||||
}
|
||||
const winArtifacts = [];
|
||||
// wix v1
|
||||
if (app.version != app.wixAppVersion) {
|
||||
langs.forEach((lang) => {
|
||||
winArtifacts.push((0,utils/* createArtifact */.Dg)({
|
||||
path: (0,external_node_path_.join)(artifactsPath, `bundle/msi/${app.name}_${app.wixAppVersion}_${arch}_${lang}.msi`),
|
||||
name: app.name,
|
||||
debug,
|
||||
platform: targetInfo.platform,
|
||||
arch,
|
||||
bundle: 'msi',
|
||||
version: app.version,
|
||||
}), (0,utils/* createArtifact */.Dg)({
|
||||
path: (0,external_node_path_.join)(artifactsPath, `bundle/msi/${app.name}_${app.wixAppVersion}_${arch}_${lang}.msi.sig`),
|
||||
name: app.name,
|
||||
debug,
|
||||
platform: targetInfo.platform,
|
||||
arch,
|
||||
bundle: 'msi',
|
||||
version: app.version,
|
||||
}), (0,utils/* createArtifact */.Dg)({
|
||||
path: (0,external_node_path_.join)(artifactsPath, `bundle/msi/${app.name}_${app.wixAppVersion}_${arch}_${lang}.msi.zip`),
|
||||
name: app.name,
|
||||
debug,
|
||||
platform: targetInfo.platform,
|
||||
arch,
|
||||
bundle: 'msi',
|
||||
version: app.version,
|
||||
}), (0,utils/* createArtifact */.Dg)({
|
||||
path: (0,external_node_path_.join)(artifactsPath, `bundle/msi/${app.name}_${app.wixAppVersion}_${arch}_${lang}.msi.zip.sig`),
|
||||
name: app.name,
|
||||
debug,
|
||||
platform: targetInfo.platform,
|
||||
arch,
|
||||
bundle: 'msi',
|
||||
version: app.version,
|
||||
}));
|
||||
});
|
||||
}
|
||||
// wix v2
|
||||
langs.forEach((lang) => {
|
||||
winArtifacts.push((0,utils/* createArtifact */.Dg)({
|
||||
@@ -42553,73 +42490,6 @@ async function buildProject(root, debug, buildOpts, initOpts, retryAttempts, upl
|
||||
version: app.version,
|
||||
}),
|
||||
];
|
||||
if (app.name != linuxFileAppName) {
|
||||
artifacts.push((0,utils/* createArtifact */.Dg)({
|
||||
path: (0,external_node_path_.join)(artifactsPath, `bundle/deb/${linuxFileAppName}_${app.version}_${debianArch}.deb`),
|
||||
name: linuxFileAppName,
|
||||
debug,
|
||||
platform: targetInfo.platform,
|
||||
arch: debianArch,
|
||||
bundle: 'deb',
|
||||
version: app.version,
|
||||
}), (0,utils/* createArtifact */.Dg)({
|
||||
path: (0,external_node_path_.join)(artifactsPath, `bundle/deb/${linuxFileAppName}_${app.version}_${debianArch}.deb.sig`),
|
||||
name: linuxFileAppName,
|
||||
debug,
|
||||
platform: targetInfo.platform,
|
||||
arch: debianArch,
|
||||
bundle: 'deb',
|
||||
version: app.version,
|
||||
}), (0,utils/* createArtifact */.Dg)({
|
||||
path: (0,external_node_path_.join)(artifactsPath, `bundle/rpm/${linuxFileAppName}-${app.version}-${app.rpmRelease}.${rpmArch}.rpm`),
|
||||
name: linuxFileAppName,
|
||||
debug,
|
||||
platform: targetInfo.platform,
|
||||
arch: rpmArch,
|
||||
bundle: 'rpm',
|
||||
version: app.version,
|
||||
}), (0,utils/* createArtifact */.Dg)({
|
||||
path: (0,external_node_path_.join)(artifactsPath, `bundle/rpm/${linuxFileAppName}-${app.version}-${app.rpmRelease}.${rpmArch}.rpm.sig`),
|
||||
name: linuxFileAppName,
|
||||
debug,
|
||||
platform: targetInfo.platform,
|
||||
arch: rpmArch,
|
||||
bundle: 'rpm',
|
||||
version: app.version,
|
||||
}), (0,utils/* createArtifact */.Dg)({
|
||||
path: (0,external_node_path_.join)(artifactsPath, `bundle/appimage/${linuxFileAppName}_${app.version}_${appImageArch}.AppImage`),
|
||||
name: linuxFileAppName,
|
||||
debug,
|
||||
platform: targetInfo.platform,
|
||||
arch: appImageArch,
|
||||
bundle: 'appimage',
|
||||
version: app.version,
|
||||
}), (0,utils/* createArtifact */.Dg)({
|
||||
path: (0,external_node_path_.join)(artifactsPath, `bundle/appimage/${linuxFileAppName}_${app.version}_${appImageArch}.AppImage.sig`),
|
||||
name: linuxFileAppName,
|
||||
debug,
|
||||
platform: targetInfo.platform,
|
||||
arch: appImageArch,
|
||||
bundle: 'appimage',
|
||||
version: app.version,
|
||||
}), (0,utils/* createArtifact */.Dg)({
|
||||
path: (0,external_node_path_.join)(artifactsPath, `bundle/appimage/${linuxFileAppName}_${app.version}_${appImageArch}.AppImage.tar.gz`),
|
||||
name: linuxFileAppName,
|
||||
debug,
|
||||
platform: targetInfo.platform,
|
||||
arch: appImageArch,
|
||||
bundle: 'appimage',
|
||||
version: app.version,
|
||||
}), (0,utils/* createArtifact */.Dg)({
|
||||
path: (0,external_node_path_.join)(artifactsPath, `bundle/appimage/${linuxFileAppName}_${app.version}_${appImageArch}.AppImage.tar.gz.sig`),
|
||||
name: linuxFileAppName,
|
||||
debug,
|
||||
platform: targetInfo.platform,
|
||||
arch: appImageArch,
|
||||
bundle: 'appimage',
|
||||
version: app.version,
|
||||
}));
|
||||
}
|
||||
}
|
||||
if (uploadPlainBinary) {
|
||||
const ext = targetInfo.platform === 'windows' ? '.exe' : '';
|
||||
@@ -42666,7 +42536,7 @@ function _tryParseJsonConfig(contents) {
|
||||
// @ts-expect-error Catching errors in typescript is a headache
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||
const msg = e.message;
|
||||
console.error(`Couldn't parse --config flag as inline JSON. This is not an error if it's a file path. Source: "${msg}"`);
|
||||
console.error(`Couldn't parse --config flag as inline JSON. This error can be ignored if it's a file path. Source: "${msg}"`);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -42679,7 +42549,7 @@ function _tryParseJson5Config(contents) {
|
||||
// @ts-expect-error Catching errors in typescript is a headache
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||
const msg = e.message;
|
||||
console.error(`Couldn't parse --config flag as inline JSON. This is not an error if it's a file path. Source: "${msg}"`);
|
||||
console.error(`Couldn't parse --config flag as inline JSON. This error can be ignored if it's a file path. Source: "${msg}"`);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -42692,7 +42562,7 @@ function _tryParseTomlConfig(contents) {
|
||||
// @ts-expect-error Catching errors in typescript is a headache
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||
const msg = e.message;
|
||||
console.error(`Couldn't parse --config flag as inline JSON. This is not an error if it's a file path. Source: "${msg}"`);
|
||||
console.error(`Couldn't parse --config flag as inline JSON. This error can be ignored if it's a file path. Source: "${msg}"`);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -42744,24 +42614,15 @@ function readCustomConfig(customPath) {
|
||||
throw new Error(`Couldn't parse \`${customPath}\` as ${ext.substring(1)}.`);
|
||||
}
|
||||
class TauriConfig {
|
||||
constructor(identifier, isV2 = false) {
|
||||
constructor(identifier) {
|
||||
this.identifier = identifier;
|
||||
this._isV2 = isV2;
|
||||
}
|
||||
isV2() {
|
||||
return this._isV2;
|
||||
}
|
||||
static fromBaseConfig(tauriDir) {
|
||||
if ((0,fs__WEBPACK_IMPORTED_MODULE_0__.existsSync)((0,path__WEBPACK_IMPORTED_MODULE_1__.join)(tauriDir, 'tauri.conf.json'))) {
|
||||
const contents = (0,fs__WEBPACK_IMPORTED_MODULE_0__.readFileSync)((0,path__WEBPACK_IMPORTED_MODULE_1__.join)(tauriDir, 'tauri.conf.json')).toString();
|
||||
const config = _tryParseJsonConfig(contents);
|
||||
if (config) {
|
||||
if ('identifier' in config) {
|
||||
return this.fromV2Base(config);
|
||||
}
|
||||
else {
|
||||
return this.fromV1Base(config);
|
||||
}
|
||||
return this.fromV2Base(config);
|
||||
}
|
||||
console.error("Found tauri.conf.json file but couldn't parse it as JSON.");
|
||||
}
|
||||
@@ -42769,12 +42630,7 @@ class TauriConfig {
|
||||
const contents = (0,fs__WEBPACK_IMPORTED_MODULE_0__.readFileSync)((0,path__WEBPACK_IMPORTED_MODULE_1__.join)(tauriDir, 'tauri.conf.json5')).toString();
|
||||
const config = _tryParseJson5Config(contents);
|
||||
if (config) {
|
||||
if ('identifier' in config) {
|
||||
return this.fromV2Base(config);
|
||||
}
|
||||
else {
|
||||
return this.fromV1Base(config);
|
||||
}
|
||||
return this.fromV2Base(config);
|
||||
}
|
||||
console.error("Found tauri.conf.json5 file but couldn't parse it as JSON5.");
|
||||
}
|
||||
@@ -42782,35 +42638,17 @@ class TauriConfig {
|
||||
const contents = (0,fs__WEBPACK_IMPORTED_MODULE_0__.readFileSync)((0,path__WEBPACK_IMPORTED_MODULE_1__.join)(tauriDir, 'Tauri.toml')).toString();
|
||||
const config = _tryParseTomlConfig(contents);
|
||||
if (config) {
|
||||
if ('identifier' in config) {
|
||||
return this.fromV2Base(config);
|
||||
}
|
||||
else {
|
||||
return this.fromV1Base(config);
|
||||
}
|
||||
return this.fromV2Base(config);
|
||||
}
|
||||
console.error("Found Tauri.toml file but couldn't parse it as TOML.");
|
||||
}
|
||||
throw new Error("Couldn't locate or parse tauri config.");
|
||||
}
|
||||
static fromV1Base(config) {
|
||||
if (!config.tauri?.bundle?.identifier) {
|
||||
throw Error('base config has no bundle identifier.');
|
||||
}
|
||||
const c = new TauriConfig(config.tauri?.bundle?.identifier, false);
|
||||
c.productName = config.package?.productName;
|
||||
c.version = config.package?.version;
|
||||
c.frontendDist = config.build?.distDir;
|
||||
c.beforeBuildCommand = config.build?.beforeBuildCommand;
|
||||
c.rpmRelease = config.tauri.bundle.rpm?.release;
|
||||
c.wixLanguage = config.tauri.bundle.windows?.wix?.language;
|
||||
return c;
|
||||
}
|
||||
static fromV2Base(config) {
|
||||
if (!config.identifier) {
|
||||
throw Error('base config has no bundle identifier.');
|
||||
}
|
||||
const c = new TauriConfig(config.identifier, true);
|
||||
const c = new TauriConfig(config.identifier);
|
||||
c.productName = config.productName;
|
||||
c.mainBinaryName = config.mainBinaryName;
|
||||
c.version = config.version;
|
||||
@@ -42822,34 +42660,20 @@ class TauriConfig {
|
||||
return c;
|
||||
}
|
||||
mergeConfig(config) {
|
||||
if (this._isV2) {
|
||||
const c = config;
|
||||
this.identifier = c.identifier ?? this.identifier;
|
||||
this.productName = c.productName ?? this.productName;
|
||||
this.mainBinaryName = c.mainBinaryName ?? this.mainBinaryName;
|
||||
this.version = c.version ?? this.version;
|
||||
this.frontendDist = c.build?.frontendDist ?? this.frontendDist;
|
||||
this.beforeBuildCommand =
|
||||
c.build?.beforeBuildCommand ?? this.beforeBuildCommand;
|
||||
this.rpmRelease = c.bundle?.linux?.rpm?.release ?? this.rpmRelease;
|
||||
this.wixLanguage = c.bundle?.windows?.wix?.language ?? this.wixLanguage;
|
||||
this.unzippedSigs =
|
||||
c.bundle?.createUpdaterArtifacts != null
|
||||
? c.bundle?.createUpdaterArtifacts === true
|
||||
: this.unzippedSigs;
|
||||
}
|
||||
else {
|
||||
const c = config;
|
||||
this.identifier = c.tauri?.bundle?.identifier ?? this.identifier;
|
||||
this.productName = c.package?.productName ?? this.productName;
|
||||
this.version = c.package?.version ?? this.version;
|
||||
this.frontendDist = c.build?.distDir ?? this.frontendDist;
|
||||
this.beforeBuildCommand =
|
||||
c.build?.beforeBuildCommand ?? this.beforeBuildCommand;
|
||||
this.rpmRelease = c.tauri?.bundle?.rpm?.release ?? this.rpmRelease;
|
||||
this.wixLanguage =
|
||||
c.tauri?.bundle?.windows?.wix?.language ?? this.wixLanguage;
|
||||
}
|
||||
this.identifier = config.identifier ?? this.identifier;
|
||||
this.productName = config.productName ?? this.productName;
|
||||
this.mainBinaryName = config.mainBinaryName ?? this.mainBinaryName;
|
||||
this.version = config.version ?? this.version;
|
||||
this.frontendDist = config.build?.frontendDist ?? this.frontendDist;
|
||||
this.beforeBuildCommand =
|
||||
config.build?.beforeBuildCommand ?? this.beforeBuildCommand;
|
||||
this.rpmRelease = config.bundle?.linux?.rpm?.release ?? this.rpmRelease;
|
||||
this.wixLanguage =
|
||||
config.bundle?.windows?.wix?.language ?? this.wixLanguage;
|
||||
this.unzippedSigs =
|
||||
config.bundle?.createUpdaterArtifacts != null
|
||||
? config.bundle?.createUpdaterArtifacts === true
|
||||
: this.unzippedSigs;
|
||||
}
|
||||
mergePlatformConfig(tauriDir, target) {
|
||||
const config = readPlatformConfig(tauriDir, target);
|
||||
@@ -42882,24 +42706,12 @@ class TauriConfig {
|
||||
// This shouldn't happen. Instead the prior call to fromBaseConfig should fail.
|
||||
throw new Error("Couldn't parse tauri.conf.json");
|
||||
}
|
||||
if (this._isV2) {
|
||||
const c = config;
|
||||
c.identifier = this.identifier;
|
||||
c.productName = this.productName;
|
||||
c.version = this.version;
|
||||
c.build.beforeBuildCommand = this.beforeBuildCommand;
|
||||
c.build.frontendDist = this.frontendDist;
|
||||
(0,fs__WEBPACK_IMPORTED_MODULE_0__.writeFileSync)(configPath, JSON.stringify(c, null, 2));
|
||||
}
|
||||
else {
|
||||
const c = config;
|
||||
c.build.beforeBuildCommand = this.beforeBuildCommand;
|
||||
c.build.distDir = this.frontendDist;
|
||||
c.package.productName = this.productName;
|
||||
c.package.version = this.version;
|
||||
c.tauri.bundle.identifier = this.identifier;
|
||||
(0,fs__WEBPACK_IMPORTED_MODULE_0__.writeFileSync)(configPath, JSON.stringify(c, null, 2));
|
||||
}
|
||||
config.identifier = this.identifier;
|
||||
config.productName = this.productName;
|
||||
config.version = this.version;
|
||||
config.build.beforeBuildCommand = this.beforeBuildCommand;
|
||||
config.build.frontendDist = this.frontendDist;
|
||||
(0,fs__WEBPACK_IMPORTED_MODULE_0__.writeFileSync)(configPath, JSON.stringify(config, null, 2));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53488,7 +53300,6 @@ function getInfo(root, targetInfo, configFlag) {
|
||||
console.error('Could not determine package name and version.');
|
||||
process.exit(1);
|
||||
}
|
||||
const wixAppVersion = version.replace(/[-+]/g, '.');
|
||||
if (config.wixLanguage) {
|
||||
wixLanguage = config.wixLanguage;
|
||||
}
|
||||
@@ -53501,7 +53312,6 @@ function getInfo(root, targetInfo, configFlag) {
|
||||
mainBinaryName: config.mainBinaryName || cargoManifest.package.name,
|
||||
version,
|
||||
wixLanguage,
|
||||
wixAppVersion,
|
||||
rpmRelease,
|
||||
unzippedSigs: config.unzippedSigs === true,
|
||||
};
|
||||
|
||||
168
src/build.ts
@@ -63,7 +63,6 @@ export async function buildProject(
|
||||
mainBinaryName: info.mainBinaryName,
|
||||
version: info.version,
|
||||
wixLanguage: info.wixLanguage,
|
||||
wixAppVersion: info.wixAppVersion,
|
||||
rpmRelease: info.rpmRelease,
|
||||
};
|
||||
|
||||
@@ -80,16 +79,6 @@ export async function buildProject(
|
||||
retryAttempts,
|
||||
);
|
||||
|
||||
// on Linux, the app product name is converted to kebab-case and `()[]{}` will be removed
|
||||
// with tauri-cli 2.0.0-beta.19 deb and appimage will now use the product name as on the other platforms.
|
||||
// with tauri-cli 2.0.0-beta.21 rpm will do too.
|
||||
const linuxFileAppName = app.name
|
||||
.replace(/([a-z0-9])([A-Z])/g, '$1-$2')
|
||||
.replace(/([A-Z])([A-Z])(?=[a-z])/g, '$1-$2')
|
||||
.replace(/[ _.]/g, '-')
|
||||
.replace(/[()[\]{}]/g, '')
|
||||
.toLowerCase();
|
||||
|
||||
const workspacePath = getWorkspaceDir(app.tauriPath) ?? app.tauriPath;
|
||||
|
||||
const artifactsPath = join(
|
||||
@@ -172,62 +161,6 @@ export async function buildProject(
|
||||
|
||||
const winArtifacts: Artifact[] = [];
|
||||
|
||||
// wix v1
|
||||
if (app.version != app.wixAppVersion) {
|
||||
langs.forEach((lang) => {
|
||||
winArtifacts.push(
|
||||
createArtifact({
|
||||
path: join(
|
||||
artifactsPath,
|
||||
`bundle/msi/${app.name}_${app.wixAppVersion}_${arch}_${lang}.msi`,
|
||||
),
|
||||
name: app.name,
|
||||
debug,
|
||||
platform: targetInfo.platform,
|
||||
arch,
|
||||
bundle: 'msi',
|
||||
version: app.version,
|
||||
}),
|
||||
createArtifact({
|
||||
path: join(
|
||||
artifactsPath,
|
||||
`bundle/msi/${app.name}_${app.wixAppVersion}_${arch}_${lang}.msi.sig`,
|
||||
),
|
||||
name: app.name,
|
||||
debug,
|
||||
platform: targetInfo.platform,
|
||||
arch,
|
||||
bundle: 'msi',
|
||||
version: app.version,
|
||||
}),
|
||||
createArtifact({
|
||||
path: join(
|
||||
artifactsPath,
|
||||
`bundle/msi/${app.name}_${app.wixAppVersion}_${arch}_${lang}.msi.zip`,
|
||||
),
|
||||
name: app.name,
|
||||
debug,
|
||||
platform: targetInfo.platform,
|
||||
arch,
|
||||
bundle: 'msi',
|
||||
version: app.version,
|
||||
}),
|
||||
createArtifact({
|
||||
path: join(
|
||||
artifactsPath,
|
||||
`bundle/msi/${app.name}_${app.wixAppVersion}_${arch}_${lang}.msi.zip.sig`,
|
||||
),
|
||||
name: app.name,
|
||||
debug,
|
||||
platform: targetInfo.platform,
|
||||
arch,
|
||||
bundle: 'msi',
|
||||
version: app.version,
|
||||
}),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
// wix v2
|
||||
langs.forEach((lang) => {
|
||||
winArtifacts.push(
|
||||
@@ -464,107 +397,6 @@ export async function buildProject(
|
||||
version: app.version,
|
||||
}),
|
||||
];
|
||||
|
||||
if (app.name != linuxFileAppName) {
|
||||
artifacts.push(
|
||||
createArtifact({
|
||||
path: join(
|
||||
artifactsPath,
|
||||
`bundle/deb/${linuxFileAppName}_${app.version}_${debianArch}.deb`,
|
||||
),
|
||||
name: linuxFileAppName,
|
||||
debug,
|
||||
platform: targetInfo.platform,
|
||||
arch: debianArch,
|
||||
bundle: 'deb',
|
||||
version: app.version,
|
||||
}),
|
||||
createArtifact({
|
||||
path: join(
|
||||
artifactsPath,
|
||||
`bundle/deb/${linuxFileAppName}_${app.version}_${debianArch}.deb.sig`,
|
||||
),
|
||||
name: linuxFileAppName,
|
||||
debug,
|
||||
platform: targetInfo.platform,
|
||||
arch: debianArch,
|
||||
bundle: 'deb',
|
||||
version: app.version,
|
||||
}),
|
||||
createArtifact({
|
||||
path: join(
|
||||
artifactsPath,
|
||||
`bundle/rpm/${linuxFileAppName}-${app.version}-${app.rpmRelease}.${rpmArch}.rpm`,
|
||||
),
|
||||
name: linuxFileAppName,
|
||||
debug,
|
||||
platform: targetInfo.platform,
|
||||
arch: rpmArch,
|
||||
bundle: 'rpm',
|
||||
version: app.version,
|
||||
}),
|
||||
createArtifact({
|
||||
path: join(
|
||||
artifactsPath,
|
||||
`bundle/rpm/${linuxFileAppName}-${app.version}-${app.rpmRelease}.${rpmArch}.rpm.sig`,
|
||||
),
|
||||
name: linuxFileAppName,
|
||||
debug,
|
||||
platform: targetInfo.platform,
|
||||
arch: rpmArch,
|
||||
bundle: 'rpm',
|
||||
version: app.version,
|
||||
}),
|
||||
createArtifact({
|
||||
path: join(
|
||||
artifactsPath,
|
||||
`bundle/appimage/${linuxFileAppName}_${app.version}_${appImageArch}.AppImage`,
|
||||
),
|
||||
name: linuxFileAppName,
|
||||
debug,
|
||||
platform: targetInfo.platform,
|
||||
arch: appImageArch,
|
||||
bundle: 'appimage',
|
||||
version: app.version,
|
||||
}),
|
||||
createArtifact({
|
||||
path: join(
|
||||
artifactsPath,
|
||||
`bundle/appimage/${linuxFileAppName}_${app.version}_${appImageArch}.AppImage.sig`,
|
||||
),
|
||||
name: linuxFileAppName,
|
||||
debug,
|
||||
platform: targetInfo.platform,
|
||||
arch: appImageArch,
|
||||
bundle: 'appimage',
|
||||
version: app.version,
|
||||
}),
|
||||
createArtifact({
|
||||
path: join(
|
||||
artifactsPath,
|
||||
`bundle/appimage/${linuxFileAppName}_${app.version}_${appImageArch}.AppImage.tar.gz`,
|
||||
),
|
||||
name: linuxFileAppName,
|
||||
debug,
|
||||
platform: targetInfo.platform,
|
||||
arch: appImageArch,
|
||||
bundle: 'appimage',
|
||||
version: app.version,
|
||||
}),
|
||||
createArtifact({
|
||||
path: join(
|
||||
artifactsPath,
|
||||
`bundle/appimage/${linuxFileAppName}_${app.version}_${appImageArch}.AppImage.tar.gz.sig`,
|
||||
),
|
||||
name: linuxFileAppName,
|
||||
debug,
|
||||
platform: targetInfo.platform,
|
||||
arch: appImageArch,
|
||||
bundle: 'appimage',
|
||||
version: app.version,
|
||||
}),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (uploadPlainBinary) {
|
||||
|
||||
148
src/config.ts
@@ -4,54 +4,48 @@ import path, { join } from 'path';
|
||||
import { parse as parseToml } from '@iarna/toml';
|
||||
import JSON5 from 'json5';
|
||||
|
||||
import { TargetPlatform, TauriConfigV1, TauriConfigV2 } from './types';
|
||||
import { TargetPlatform, TauriConfigV2 } from './types';
|
||||
|
||||
function _tryParseJsonConfig(
|
||||
contents: string,
|
||||
): TauriConfigV1 | TauriConfigV2 | null {
|
||||
function _tryParseJsonConfig(contents: string): TauriConfigV2 | null {
|
||||
try {
|
||||
const config = JSON.parse(contents) as TauriConfigV1 | TauriConfigV2;
|
||||
const config = JSON.parse(contents) as TauriConfigV2;
|
||||
return config;
|
||||
} catch (e) {
|
||||
// @ts-expect-error Catching errors in typescript is a headache
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||
const msg = e.message;
|
||||
console.error(
|
||||
`Couldn't parse --config flag as inline JSON. This is not an error if it's a file path. Source: "${msg}"`,
|
||||
`Couldn't parse --config flag as inline JSON. This error can be ignored if it's a file path. Source: "${msg}"`,
|
||||
);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
function _tryParseJson5Config(
|
||||
contents: string,
|
||||
): TauriConfigV1 | TauriConfigV2 | null {
|
||||
function _tryParseJson5Config(contents: string): TauriConfigV2 | null {
|
||||
try {
|
||||
const config = JSON5.parse<TauriConfigV1 | TauriConfigV2>(contents);
|
||||
const config = JSON5.parse<TauriConfigV2>(contents);
|
||||
return config;
|
||||
} catch (e) {
|
||||
// @ts-expect-error Catching errors in typescript is a headache
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||
const msg = e.message;
|
||||
console.error(
|
||||
`Couldn't parse --config flag as inline JSON. This is not an error if it's a file path. Source: "${msg}"`,
|
||||
`Couldn't parse --config flag as inline JSON. This error can be ignored if it's a file path. Source: "${msg}"`,
|
||||
);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
function _tryParseTomlConfig(
|
||||
contents: string,
|
||||
): TauriConfigV1 | TauriConfigV2 | null {
|
||||
function _tryParseTomlConfig(contents: string): TauriConfigV2 | null {
|
||||
try {
|
||||
const config = parseToml(contents) as TauriConfigV1 | TauriConfigV2;
|
||||
const config = parseToml(contents) as unknown as TauriConfigV2;
|
||||
return config;
|
||||
} catch (e) {
|
||||
// @ts-expect-error Catching errors in typescript is a headache
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||
const msg = e.message;
|
||||
console.error(
|
||||
`Couldn't parse --config flag as inline JSON. This is not an error if it's a file path. Source: "${msg}"`,
|
||||
`Couldn't parse --config flag as inline JSON. This error can be ignored if it's a file path. Source: "${msg}"`,
|
||||
);
|
||||
return null;
|
||||
}
|
||||
@@ -60,7 +54,7 @@ function _tryParseTomlConfig(
|
||||
function readPlatformConfig(
|
||||
tauriDir: string,
|
||||
platform: string,
|
||||
): TauriConfigV1 | TauriConfigV2 | null {
|
||||
): TauriConfigV2 | null {
|
||||
let path = join(tauriDir, `tauri.${platform}.conf.json`);
|
||||
if (existsSync(path)) {
|
||||
const contents = readFileSync(path).toString();
|
||||
@@ -85,7 +79,7 @@ function readPlatformConfig(
|
||||
return null;
|
||||
}
|
||||
|
||||
function readCustomConfig(customPath: string): TauriConfigV1 | TauriConfigV2 {
|
||||
function readCustomConfig(customPath: string): TauriConfigV2 {
|
||||
if (!existsSync(customPath)) {
|
||||
throw new Error(`Provided config path \`${customPath}\` does not exist.`);
|
||||
}
|
||||
@@ -112,9 +106,6 @@ function readCustomConfig(customPath: string): TauriConfigV1 | TauriConfigV2 {
|
||||
}
|
||||
|
||||
export class TauriConfig {
|
||||
// Non tauri config properties
|
||||
private _isV2: boolean;
|
||||
|
||||
// Required values
|
||||
identifier: string;
|
||||
|
||||
@@ -128,13 +119,8 @@ export class TauriConfig {
|
||||
wixLanguage?: string | string[] | { [language: string]: unknown };
|
||||
unzippedSigs?: boolean;
|
||||
|
||||
constructor(identifier: string, isV2 = false) {
|
||||
constructor(identifier: string) {
|
||||
this.identifier = identifier;
|
||||
this._isV2 = isV2;
|
||||
}
|
||||
|
||||
public isV2(): boolean {
|
||||
return this._isV2;
|
||||
}
|
||||
|
||||
public static fromBaseConfig(tauriDir: string): TauriConfig {
|
||||
@@ -144,11 +130,7 @@ export class TauriConfig {
|
||||
).toString();
|
||||
const config = _tryParseJsonConfig(contents);
|
||||
if (config) {
|
||||
if ('identifier' in config) {
|
||||
return this.fromV2Base(config);
|
||||
} else {
|
||||
return this.fromV1Base(config);
|
||||
}
|
||||
return this.fromV2Base(config);
|
||||
}
|
||||
console.error(
|
||||
"Found tauri.conf.json file but couldn't parse it as JSON.",
|
||||
@@ -161,11 +143,7 @@ export class TauriConfig {
|
||||
).toString();
|
||||
const config = _tryParseJson5Config(contents);
|
||||
if (config) {
|
||||
if ('identifier' in config) {
|
||||
return this.fromV2Base(config);
|
||||
} else {
|
||||
return this.fromV1Base(config);
|
||||
}
|
||||
return this.fromV2Base(config);
|
||||
}
|
||||
console.error(
|
||||
"Found tauri.conf.json5 file but couldn't parse it as JSON5.",
|
||||
@@ -176,11 +154,7 @@ export class TauriConfig {
|
||||
const contents = readFileSync(join(tauriDir, 'Tauri.toml')).toString();
|
||||
const config = _tryParseTomlConfig(contents);
|
||||
if (config) {
|
||||
if ('identifier' in config) {
|
||||
return this.fromV2Base(config);
|
||||
} else {
|
||||
return this.fromV1Base(config);
|
||||
}
|
||||
return this.fromV2Base(config);
|
||||
}
|
||||
console.error("Found Tauri.toml file but couldn't parse it as TOML.");
|
||||
}
|
||||
@@ -188,29 +162,12 @@ export class TauriConfig {
|
||||
throw new Error("Couldn't locate or parse tauri config.");
|
||||
}
|
||||
|
||||
private static fromV1Base(config: TauriConfigV1): TauriConfig {
|
||||
if (!config.tauri?.bundle?.identifier) {
|
||||
throw Error('base config has no bundle identifier.');
|
||||
}
|
||||
|
||||
const c = new TauriConfig(config.tauri?.bundle?.identifier, false);
|
||||
|
||||
c.productName = config.package?.productName;
|
||||
c.version = config.package?.version;
|
||||
c.frontendDist = config.build?.distDir;
|
||||
c.beforeBuildCommand = config.build?.beforeBuildCommand;
|
||||
c.rpmRelease = config.tauri.bundle.rpm?.release;
|
||||
c.wixLanguage = config.tauri.bundle.windows?.wix?.language;
|
||||
|
||||
return c;
|
||||
}
|
||||
|
||||
private static fromV2Base(config: TauriConfigV2): TauriConfig {
|
||||
if (!config.identifier) {
|
||||
throw Error('base config has no bundle identifier.');
|
||||
}
|
||||
|
||||
const c = new TauriConfig(config.identifier, true);
|
||||
const c = new TauriConfig(config.identifier);
|
||||
|
||||
c.productName = config.productName;
|
||||
c.mainBinaryName = config.mainBinaryName;
|
||||
@@ -224,36 +181,21 @@ export class TauriConfig {
|
||||
return c;
|
||||
}
|
||||
|
||||
private mergeConfig(config: TauriConfigV1 | TauriConfigV2) {
|
||||
if (this._isV2) {
|
||||
const c = config as TauriConfigV2;
|
||||
|
||||
this.identifier = c.identifier ?? this.identifier;
|
||||
this.productName = c.productName ?? this.productName;
|
||||
this.mainBinaryName = c.mainBinaryName ?? this.mainBinaryName;
|
||||
this.version = c.version ?? this.version;
|
||||
this.frontendDist = c.build?.frontendDist ?? this.frontendDist;
|
||||
this.beforeBuildCommand =
|
||||
c.build?.beforeBuildCommand ?? this.beforeBuildCommand;
|
||||
this.rpmRelease = c.bundle?.linux?.rpm?.release ?? this.rpmRelease;
|
||||
this.wixLanguage = c.bundle?.windows?.wix?.language ?? this.wixLanguage;
|
||||
this.unzippedSigs =
|
||||
c.bundle?.createUpdaterArtifacts != null
|
||||
? c.bundle?.createUpdaterArtifacts === true
|
||||
: this.unzippedSigs;
|
||||
} else {
|
||||
const c = config as TauriConfigV1;
|
||||
|
||||
this.identifier = c.tauri?.bundle?.identifier ?? this.identifier;
|
||||
this.productName = c.package?.productName ?? this.productName;
|
||||
this.version = c.package?.version ?? this.version;
|
||||
this.frontendDist = c.build?.distDir ?? this.frontendDist;
|
||||
this.beforeBuildCommand =
|
||||
c.build?.beforeBuildCommand ?? this.beforeBuildCommand;
|
||||
this.rpmRelease = c.tauri?.bundle?.rpm?.release ?? this.rpmRelease;
|
||||
this.wixLanguage =
|
||||
c.tauri?.bundle?.windows?.wix?.language ?? this.wixLanguage;
|
||||
}
|
||||
private mergeConfig(config: TauriConfigV2) {
|
||||
this.identifier = config.identifier ?? this.identifier;
|
||||
this.productName = config.productName ?? this.productName;
|
||||
this.mainBinaryName = config.mainBinaryName ?? this.mainBinaryName;
|
||||
this.version = config.version ?? this.version;
|
||||
this.frontendDist = config.build?.frontendDist ?? this.frontendDist;
|
||||
this.beforeBuildCommand =
|
||||
config.build?.beforeBuildCommand ?? this.beforeBuildCommand;
|
||||
this.rpmRelease = config.bundle?.linux?.rpm?.release ?? this.rpmRelease;
|
||||
this.wixLanguage =
|
||||
config.bundle?.windows?.wix?.language ?? this.wixLanguage;
|
||||
this.unzippedSigs =
|
||||
config.bundle?.createUpdaterArtifacts != null
|
||||
? config.bundle?.createUpdaterArtifacts === true
|
||||
: this.unzippedSigs;
|
||||
}
|
||||
|
||||
public mergePlatformConfig(tauriDir: string, target: TargetPlatform) {
|
||||
@@ -294,26 +236,12 @@ export class TauriConfig {
|
||||
throw new Error("Couldn't parse tauri.conf.json");
|
||||
}
|
||||
|
||||
if (this._isV2) {
|
||||
const c = config as TauriConfigV2;
|
||||
config.identifier = this.identifier;
|
||||
config.productName = this.productName;
|
||||
config.version = this.version;
|
||||
config.build!.beforeBuildCommand = this.beforeBuildCommand;
|
||||
config.build!.frontendDist = this.frontendDist;
|
||||
|
||||
c.identifier = this.identifier;
|
||||
c.productName = this.productName;
|
||||
c.version = this.version;
|
||||
c.build!.beforeBuildCommand = this.beforeBuildCommand;
|
||||
c.build!.frontendDist = this.frontendDist;
|
||||
|
||||
writeFileSync(configPath, JSON.stringify(c, null, 2));
|
||||
} else {
|
||||
const c = config as TauriConfigV1;
|
||||
|
||||
c.build!.beforeBuildCommand = this.beforeBuildCommand;
|
||||
c.build!.distDir = this.frontendDist;
|
||||
c.package!.productName = this.productName;
|
||||
c.package!.version = this.version;
|
||||
c.tauri!.bundle!.identifier = this.identifier;
|
||||
|
||||
writeFileSync(configPath, JSON.stringify(c, null, 2));
|
||||
}
|
||||
writeFileSync(configPath, JSON.stringify(config, null, 2));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import { TauriConfig } from './config';
|
||||
import {
|
||||
execCommand,
|
||||
getTauriDir,
|
||||
hasDependency,
|
||||
retry,
|
||||
usesBun,
|
||||
@@ -67,23 +65,7 @@ async function getRunner(
|
||||
return new Runner('npm', ['run', 'tauri']);
|
||||
}
|
||||
|
||||
// TODO: Change to v2 after a while.
|
||||
let tag = 'v1';
|
||||
|
||||
try {
|
||||
const tauriDir = getTauriDir(root);
|
||||
if (tauriDir) {
|
||||
const baseConf = TauriConfig.fromBaseConfig(tauriDir);
|
||||
|
||||
if (baseConf && baseConf.isV2()) {
|
||||
tag = 'v2';
|
||||
}
|
||||
}
|
||||
} catch {
|
||||
// ignore
|
||||
}
|
||||
|
||||
await execCommand('npm', ['install', '-g', `@tauri-apps/cli@${tag}`], {
|
||||
await execCommand('npm', ['install', '-g', `@tauri-apps/cli@v2`], {
|
||||
cwd: undefined,
|
||||
});
|
||||
|
||||
|
||||
25
src/types.d.ts
vendored
@@ -59,7 +59,6 @@ export interface Info {
|
||||
mainBinaryName: string;
|
||||
version: string;
|
||||
wixLanguage: string | string[] | { [language: string]: unknown };
|
||||
wixAppVersion: string;
|
||||
rpmRelease: string;
|
||||
unzippedSigs: boolean;
|
||||
}
|
||||
@@ -70,30 +69,6 @@ export interface TargetInfo {
|
||||
platform: TargetPlatform;
|
||||
}
|
||||
|
||||
export interface TauriConfigV1 {
|
||||
package?: {
|
||||
productName?: string;
|
||||
version?: string;
|
||||
};
|
||||
build?: {
|
||||
distDir?: string;
|
||||
beforeBuildCommand?: string;
|
||||
};
|
||||
tauri?: {
|
||||
bundle?: {
|
||||
identifier: string;
|
||||
rpm?: {
|
||||
release?: string;
|
||||
};
|
||||
windows?: {
|
||||
wix?: {
|
||||
language?: string | string[] | { [language: string]: unknown };
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
export interface TauriConfigV2 {
|
||||
identifier: string;
|
||||
productName?: string;
|
||||
|
||||
@@ -459,8 +459,6 @@ export function getInfo(
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const wixAppVersion = version.replace(/[-+]/g, '.');
|
||||
|
||||
if (config.wixLanguage) {
|
||||
wixLanguage = config.wixLanguage;
|
||||
}
|
||||
@@ -475,7 +473,6 @@ export function getInfo(
|
||||
mainBinaryName: config.mainBinaryName || cargoManifest.package.name,
|
||||
version,
|
||||
wixLanguage,
|
||||
wixAppVersion,
|
||||
rpmRelease,
|
||||
unzippedSigs: config.unzippedSigs === true,
|
||||
};
|
||||
|
||||