From 2e0ca8994328a032fb4e53e6352dbb975addba2c Mon Sep 17 00:00:00 2001 From: mofeng-git Date: Wed, 20 May 2026 00:09:31 +0800 Subject: [PATCH] chore: bump version to v0.2.1 --- .github/workflows/build.yml | 7 ++++--- Cargo.toml | 2 +- build/windows/build.ps1 | 21 +++++++++++++++++++++ src/web/static_files.rs | 5 +++-- vcpkg.json | 2 +- web/package.json | 2 +- 6 files changed, 31 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7bdb9921..47b26c5f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -129,13 +129,13 @@ jobs: - name: Build Windows exe shell: pwsh - run: .\build\windows\build.ps1 -Configuration release + run: .\build\windows\build.ps1 -Configuration release -Package - name: Upload exe uses: actions/upload-artifact@v4 with: name: one-kvm-windows-exe - path: target/x86_64-pc-windows-msvc/release/one-kvm.exe + path: target/x86_64-pc-windows-msvc/release/one-kvm_*.exe if-no-files-found: error retention-days: 7 @@ -170,7 +170,8 @@ jobs: uses: softprops/action-gh-release@v2 with: tag_name: ${{ inputs.release_tag }} + prerelease: true generate_release_notes: true files: | release-artifacts/deb/*.deb - release-artifacts/windows/one-kvm.exe + release-artifacts/windows/*.exe diff --git a/Cargo.toml b/Cargo.toml index 62b4f763..935a24e4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "one-kvm" -version = "0.2.0" +version = "0.2.1" edition = "2021" authors = ["SilentWind"] description = "A open and lightweight IP-KVM solution written in Rust" diff --git a/build/windows/build.ps1 b/build/windows/build.ps1 index 40b88b01..2d1a7b62 100644 --- a/build/windows/build.ps1 +++ b/build/windows/build.ps1 @@ -6,6 +6,7 @@ param( [string]$VcpkgInstalledRoot = $env:VCPKG_INSTALLED_DIR, [switch]$NoDefaultFeatures, [string[]]$Features = @(), + [switch]$Package, [Parameter(ValueFromRemainingArguments = $true)] [string[]]$CargoArgs = @() ) @@ -64,3 +65,23 @@ if ($Features.Count -gt 0) { $cargoCommand += $CargoArgs cargo @cargoCommand + +if ($Package) { + $metadata = cargo metadata --no-deps --format-version 1 | ConvertFrom-Json + $packageInfo = $metadata.packages | Where-Object { $_.name -eq "one-kvm" } | Select-Object -First 1 + + if ($null -eq $packageInfo -or [string]::IsNullOrWhiteSpace($packageInfo.version)) { + throw "Failed to resolve version from Cargo metadata" + } + + $sourcePath = Join-Path $repoRoot "target/$Target/release/one-kvm.exe" + $targetName = "one-kvm_{0}_amd64.exe" -f $packageInfo.version + $targetPath = Join-Path $repoRoot "target/$Target/release/$targetName" + + if (-not (Test-Path $sourcePath)) { + throw "Windows binary not found: $sourcePath" + } + + Copy-Item $sourcePath $targetPath + Write-Host $targetPath +} diff --git a/src/web/static_files.rs b/src/web/static_files.rs index 76218ca2..1ac99dd6 100644 --- a/src/web/static_files.rs +++ b/src/web/static_files.rs @@ -149,7 +149,7 @@ fn static_response(path: &str, data: Vec) -> Response { .unwrap() } -pub fn placeholder_html() -> &'static str { +pub fn placeholder_html() -> String { r#" @@ -181,8 +181,9 @@ pub fn placeholder_html() -> &'static str {

One-KVM

Frontend not built yet.

Please build the frontend or access the API directly.

-
v0.2.0
+
v{{VERSION}}
"# + .replace("{{VERSION}}", env!("CARGO_PKG_VERSION")) } diff --git a/vcpkg.json b/vcpkg.json index ad71085c..7f10da27 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -1,7 +1,7 @@ { "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json", "name": "one-kvm", - "version-string": "0.2.0", + "version-string": "0.2.1", "dependencies": [ { "name": "ffmpeg", diff --git a/web/package.json b/web/package.json index 38e8f984..1847406c 100644 --- a/web/package.json +++ b/web/package.json @@ -1,7 +1,7 @@ { "name": "web", "private": true, - "version": "0.2.0", + "version": "0.2.1", "type": "module", "scripts": { "dev": "vite",