feat: Tauri v2 release workflow and frontend API migration
Some checks failed
CI / Rust Format (push) Has been cancelled
CI / Clippy (push) Has been cancelled
CI / Test Server (push) Has been cancelled
CI / Frontend Check (push) Has been cancelled
CI / Tauri Client Check (push) Has been cancelled
CI / Docker Build (push) Has been cancelled
CI / Build Tauri (Linux) (push) Has been cancelled
Some checks failed
CI / Rust Format (push) Has been cancelled
CI / Clippy (push) Has been cancelled
CI / Test Server (push) Has been cancelled
CI / Frontend Check (push) Has been cancelled
CI / Tauri Client Check (push) Has been cancelled
CI / Docker Build (push) Has been cancelled
CI / Build Tauri (Linux) (push) Has been cancelled
- Update release workflow with matrix strategy for Linux/macOS/Windows - Upgrade @tauri-apps/api from v1 to v2 in frontend - Change all tauri/tauri imports to tauri/core (Tauri v2) - Sync tauri.conf.json across project root and src-tauri
This commit is contained in:
83
.github/workflows/release.yml
vendored
83
.github/workflows/release.yml
vendored
@@ -66,7 +66,6 @@ jobs:
|
|||||||
docker-push:
|
docker-push:
|
||||||
name: Docker Push
|
name: Docker Push
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: []
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
@@ -102,16 +101,27 @@ jobs:
|
|||||||
cache-from: type=gha
|
cache-from: type=gha
|
||||||
cache-to: type=gha,mode=max
|
cache-to: type=gha,mode=max
|
||||||
|
|
||||||
build-tauri-linux:
|
build-tauri:
|
||||||
name: Build Tauri (Linux)
|
name: Build Tauri (${{ matrix.platform }})
|
||||||
runs-on: ubuntu-latest
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- platform: linux
|
||||||
|
runner: ubuntu-latest
|
||||||
|
- platform: macos
|
||||||
|
runner: macos-latest
|
||||||
|
- platform: windows
|
||||||
|
runner: windows-latest
|
||||||
|
runs-on: ${{ matrix.runner }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install Rust stable
|
- name: Install Rust stable
|
||||||
uses: dtolnay/rust-toolchain@stable
|
uses: dtolnay/rust-toolchain@stable
|
||||||
|
|
||||||
- name: Install system dependencies
|
- name: Install system dependencies (Linux)
|
||||||
|
if: matrix.platform == 'linux'
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install -y libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev libssl-dev
|
sudo apt-get install -y libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev libssl-dev
|
||||||
@@ -126,72 +136,11 @@ jobs:
|
|||||||
- name: Install frontend deps
|
- name: Install frontend deps
|
||||||
run: cd client/src-ui && npm ci
|
run: cd client/src-ui && npm ci
|
||||||
|
|
||||||
- name: Build Tauri (Linux)
|
- name: Build Tauri
|
||||||
uses: tauri-apps/tauri-action@v0
|
uses: tauri-apps/tauri-action@v0
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
with:
|
||||||
projectPath: client
|
|
||||||
tagName: ${{ github.ref_name }}
|
|
||||||
releaseName: "EifelDC ${{ github.ref_name }}"
|
|
||||||
releaseBody: "See [CHANGELOG.md](CHANGELOG.md) for details."
|
|
||||||
releaseDraft: true
|
|
||||||
|
|
||||||
build-tauri-macos:
|
|
||||||
name: Build Tauri (macOS)
|
|
||||||
runs-on: macos-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Install Rust stable
|
|
||||||
uses: dtolnay/rust-toolchain@stable
|
|
||||||
|
|
||||||
- name: Setup Node
|
|
||||||
uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: 20
|
|
||||||
cache: npm
|
|
||||||
cache-dependency-path: client/src-ui/package-lock.json
|
|
||||||
|
|
||||||
- name: Install frontend deps
|
|
||||||
run: cd client/src-ui && npm ci
|
|
||||||
|
|
||||||
- name: Build Tauri (macOS)
|
|
||||||
uses: tauri-apps/tauri-action@v0
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
with:
|
|
||||||
projectPath: client
|
|
||||||
tagName: ${{ github.ref_name }}
|
|
||||||
releaseName: "EifelDC ${{ github.ref_name }}"
|
|
||||||
releaseBody: "See [CHANGELOG.md](CHANGELOG.md) for details."
|
|
||||||
releaseDraft: true
|
|
||||||
|
|
||||||
build-tauri-windows:
|
|
||||||
name: Build Tauri (Windows)
|
|
||||||
runs-on: windows-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Install Rust stable
|
|
||||||
uses: dtolnay/rust-toolchain@stable
|
|
||||||
|
|
||||||
- name: Setup Node
|
|
||||||
uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: 20
|
|
||||||
cache: npm
|
|
||||||
cache-dependency-path: client/src-ui/package-lock.json
|
|
||||||
|
|
||||||
- name: Install frontend deps
|
|
||||||
run: cd client/src-ui && npm ci
|
|
||||||
|
|
||||||
- name: Build Tauri (Windows)
|
|
||||||
uses: tauri-apps/tauri-action@v0
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
with:
|
|
||||||
projectPath: client
|
|
||||||
tagName: ${{ github.ref_name }}
|
tagName: ${{ github.ref_name }}
|
||||||
releaseName: "EifelDC ${{ github.ref_name }}"
|
releaseName: "EifelDC ${{ github.ref_name }}"
|
||||||
releaseBody: "See [CHANGELOG.md](CHANGELOG.md) for details."
|
releaseBody: "See [CHANGELOG.md](CHANGELOG.md) for details."
|
||||||
|
|||||||
13
client/src-ui/package-lock.json
generated
13
client/src-ui/package-lock.json
generated
@@ -12,7 +12,7 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@sveltejs/vite-plugin-svelte": "^3",
|
"@sveltejs/vite-plugin-svelte": "^3",
|
||||||
"@tauri-apps/api": "^1",
|
"@tauri-apps/api": "^2.10.1",
|
||||||
"svelte": "^4",
|
"svelte": "^4",
|
||||||
"svelte-check": "^3",
|
"svelte-check": "^3",
|
||||||
"svelte-preprocess": "^5.1.4",
|
"svelte-preprocess": "^5.1.4",
|
||||||
@@ -878,16 +878,11 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@tauri-apps/api": {
|
"node_modules/@tauri-apps/api": {
|
||||||
"version": "1.6.0",
|
"version": "2.10.1",
|
||||||
"resolved": "https://registry.npmjs.org/@tauri-apps/api/-/api-1.6.0.tgz",
|
"resolved": "https://registry.npmjs.org/@tauri-apps/api/-/api-2.10.1.tgz",
|
||||||
"integrity": "sha512-rqI++FWClU5I2UBp4HXFvl+sBWkdigBkxnpJDQUWttNyG7IZP4FwQGhTNL5EOw0vI8i6eSAJ5frLqO7n7jbJdg==",
|
"integrity": "sha512-hKL/jWf293UDSUN09rR69hrToyIXBb8CjGaWC7gfinvnQrBVvnLr08FeFi38gxtugAVyVcTa5/FD/Xnkb1siBw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "Apache-2.0 OR MIT",
|
"license": "Apache-2.0 OR MIT",
|
||||||
"engines": {
|
|
||||||
"node": ">= 14.6.0",
|
|
||||||
"npm": ">= 6.6.0",
|
|
||||||
"yarn": ">= 1.19.1"
|
|
||||||
},
|
|
||||||
"funding": {
|
"funding": {
|
||||||
"type": "opencollective",
|
"type": "opencollective",
|
||||||
"url": "https://opencollective.com/tauri"
|
"url": "https://opencollective.com/tauri"
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@sveltejs/vite-plugin-svelte": "^3",
|
"@sveltejs/vite-plugin-svelte": "^3",
|
||||||
"@tauri-apps/api": "^1",
|
"@tauri-apps/api": "^2.10.1",
|
||||||
"svelte": "^4",
|
"svelte": "^4",
|
||||||
"svelte-check": "^3",
|
"svelte-check": "^3",
|
||||||
"svelte-preprocess": "^5.1.4",
|
"svelte-preprocess": "^5.1.4",
|
||||||
|
|||||||
@@ -34,7 +34,7 @@
|
|||||||
|
|
||||||
if (isTauri()) {
|
if (isTauri()) {
|
||||||
try {
|
try {
|
||||||
const { invoke } = await import('@tauri-apps/api/tauri');
|
const { invoke } = await import('@tauri-apps/api/core');
|
||||||
const user: string | null = await invoke('get_current_user');
|
const user: string | null = await invoke('get_current_user');
|
||||||
if (user) {
|
if (user) {
|
||||||
loggedIn = true;
|
loggedIn = true;
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ function clearToken() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function tauriInvoke(cmd: string, args: Record<string, unknown>): Promise<any> {
|
async function tauriInvoke(cmd: string, args: Record<string, unknown>): Promise<any> {
|
||||||
const { invoke } = await import('@tauri-apps/api/tauri');
|
const { invoke } = await import('@tauri-apps/api/core');
|
||||||
return invoke(cmd, args);
|
return invoke(cmd, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -483,7 +483,7 @@ export async function uploadFile(roomId: string, file: File): Promise<UploadResu
|
|||||||
formData.append('file', file);
|
formData.append('file', file);
|
||||||
|
|
||||||
if (isTauri()) {
|
if (isTauri()) {
|
||||||
const { invoke } = await import('@tauri-apps/api/tauri');
|
const { invoke } = await import('@tauri-apps/api/core');
|
||||||
const arrayBuffer = await file.arrayBuffer();
|
const arrayBuffer = await file.arrayBuffer();
|
||||||
const bytes = Array.from(new Uint8Array(arrayBuffer));
|
const bytes = Array.from(new Uint8Array(arrayBuffer));
|
||||||
return invoke('upload_file', { roomId, fileName: file.name, mimeType: file.type, bytes });
|
return invoke('upload_file', { roomId, fileName: file.name, mimeType: file.type, bytes });
|
||||||
@@ -533,7 +533,7 @@ export async function uploadAvatar(file: File): Promise<UserProfile> {
|
|||||||
formData.append('file', file);
|
formData.append('file', file);
|
||||||
|
|
||||||
if (isTauri()) {
|
if (isTauri()) {
|
||||||
const { invoke } = await import('@tauri-apps/api/tauri');
|
const { invoke } = await import('@tauri-apps/api/core');
|
||||||
const arrayBuffer = await file.arrayBuffer();
|
const arrayBuffer = await file.arrayBuffer();
|
||||||
const bytes = Array.from(new Uint8Array(arrayBuffer));
|
const bytes = Array.from(new Uint8Array(arrayBuffer));
|
||||||
return invoke('upload_avatar', { fileName: file.name, mimeType: file.type, bytes });
|
return invoke('upload_avatar', { fileName: file.name, mimeType: file.type, bytes });
|
||||||
@@ -571,7 +571,7 @@ export async function setRoomAvatar(roomId: string, file: File): Promise<boolean
|
|||||||
formData.append('file', file);
|
formData.append('file', file);
|
||||||
|
|
||||||
if (isTauri()) {
|
if (isTauri()) {
|
||||||
const { invoke } = await import('@tauri-apps/api/tauri');
|
const { invoke } = await import('@tauri-apps/api/core');
|
||||||
const arrayBuffer = await file.arrayBuffer();
|
const arrayBuffer = await file.arrayBuffer();
|
||||||
const bytes = Array.from(new Uint8Array(arrayBuffer));
|
const bytes = Array.from(new Uint8Array(arrayBuffer));
|
||||||
return invoke('set_room_avatar', { roomId, fileName: file.name, mimeType: file.type, bytes });
|
return invoke('set_room_avatar', { roomId, fileName: file.name, mimeType: file.type, bytes });
|
||||||
|
|||||||
Reference in New Issue
Block a user