-
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.
* Dynamically pull down binary Pull the binary from GitHub releases unless the WEBVIEW_BIN env var is provided. * Bump cargo version * Delete misc file * Add mechanism to automatically upgrade version
- Loading branch information
Showing
10 changed files
with
137 additions
and
35 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 = "deno-webview" | ||
version = "0.1.3" | ||
version = "0.1.4" | ||
edition = "2021" | ||
|
||
[profile.release] | ||
|
This file was deleted.
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
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
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/** | ||
* Keeps the version of the WebView binary in sync with the version in Cargo.toml. | ||
*/ | ||
|
||
import { parse } from "jsr:@std/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/lib.ts"; | ||
const libContent = await Deno.readTextFile(libPath); | ||
|
||
// Replace the version in the URL | ||
const updatedContent = libContent.replace( | ||
/releases\/download\/v\d+\.\d+\.\d+\/deno-webview/, | ||
`releases/download/v${latestVersion}/deno-webview`, | ||
); | ||
|
||
// Write the updated content back to src/lib.ts | ||
await Deno.writeTextFile(libPath, updatedContent); | ||
|
||
console.log(`Updated WebView binary version to ${latestVersion} in src/lib.ts`); |
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