-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prepare Deno Client for v1.0.0-rc release (#131)
* Update sync-versions script to also work on py client * Bump binary to 0.2.0 * Prepare for the 1.0.0-rc.1 release
- Loading branch information
Showing
8 changed files
with
57 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "webview" | ||
version = "0.1.14" | ||
version = "0.2.0" | ||
edition = "2021" | ||
|
||
[profile.release] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,42 @@ | ||
/** | ||
* Keeps the version of the WebView binary in sync with the version in Cargo.toml. | ||
* Synchronizes version numbers across the project: | ||
* - Updates BIN_VERSION in Deno client (main.ts) | ||
* - Updates package version in Python client (pyproject.toml) | ||
* - Updates BIN_VERSION in Python client (__init__.py) | ||
* | ||
* All versions are synchronized with the main version from Cargo.toml | ||
*/ | ||
|
||
import { parse } from "jsr:@std/toml"; | ||
|
||
// Read the source version from Cargo.toml | ||
const latestVersion = await Deno | ||
.readTextFile("./Cargo.toml").then((text) => | ||
parse(text) as { package: { version: string } } | ||
).then((config) => config.package.version); | ||
|
||
// Read the content of src/lib.ts | ||
const libPath = "./src/clients/deno/main.ts"; | ||
const libContent = await Deno.readTextFile(libPath); | ||
// ===== Update Deno Client Version ===== | ||
const denoPath = "./src/clients/deno/main.ts"; | ||
const denoContent = await Deno.readTextFile(denoPath); | ||
|
||
// Replace the version in the URL | ||
const updatedContent = libContent.replace( | ||
const updatedDenoContent = denoContent.replace( | ||
/const BIN_VERSION = "[^"]+"/, | ||
`const BIN_VERSION = "${latestVersion}"`, | ||
); | ||
|
||
// Write the updated content back to src/lib.ts | ||
await Deno.writeTextFile(libPath, updatedContent); | ||
await Deno.writeTextFile(denoPath, updatedDenoContent); | ||
console.log(`✓ Updated Deno BIN_VERSION to ${latestVersion}`); | ||
|
||
console.log(`Updated WebView binary version to ${latestVersion} in src/lib.ts`); | ||
// ===== Update Python Client BIN_VERSION ===== | ||
const pythonInitPath = "./src/clients/python/src/webview_python/__init__.py"; | ||
const pythonInitContent = await Deno.readTextFile(pythonInitPath); | ||
|
||
const updatedPythonInitContent = pythonInitContent.replace( | ||
/BIN_VERSION = "[^"]+"/, | ||
`BIN_VERSION = "${latestVersion}"`, | ||
); | ||
|
||
await Deno.writeTextFile(pythonInitPath, updatedPythonInitContent); | ||
console.log(`✓ Updated Python BIN_VERSION to ${latestVersion}`); | ||
|
||
console.log(`\n🎉 Successfully synchronized all versions to ${latestVersion}`); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters