-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* v0.1.0 * prosewrap: preserve * fix gen hash * add dax
- Loading branch information
Showing
6 changed files
with
172 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
.zig-cache | ||
zig-out | ||
zig-out | ||
dist |
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 |
---|---|---|
|
@@ -4,8 +4,16 @@ | |
"test": "zig test src/main.zig", | ||
"fmt": "deno fmt && zig fmt src/**/*.zig", | ||
"build": "zig build -Dtarget=x86_64-windows-msvc -Doptimize=ReleaseSmall", | ||
"release": "deno task build && powershell Compress-Archive -Path zig-out\\bin\\rb.exe -DestinationPath zig-out\\rb-x86_64-pc-windows-msvc.zip -Force", | ||
"check:hash": "certutil -hashfile zig-out\\rb-x86_64-pc-windows-msvc.zip SHA256" | ||
"release": "deno task build && deno run -A release.ts", | ||
"check:hash": "certutil -hashfile dist/rb-x86_64-pc-windows-msvc.zip SHA256" | ||
}, | ||
"exclude": ["README.md"] | ||
"imports": { | ||
"@david/dax": "jsr:@david/dax@^0.42.0", | ||
"@std/crypto": "jsr:@std/crypto@^1.0.3", | ||
"@std/encoding": "jsr:@std/encoding@^1.0.6", | ||
"z2j": "npm:[email protected]" | ||
}, | ||
"fmt": { | ||
"proseWrap": "preserve" | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"version": "0.1.0", | ||
"homepage": "https://github.com/ryuapp/rb", | ||
"license": "MIT", | ||
"architecture": { | ||
"64bit": { | ||
"url": "https://github.com/ryuapp/rb/releases/download/v0.1.0/rb-x86_64-pc-windows-msvc.zip", | ||
"hash": "22e9221e578f9a17027cc0f64338a0a661a185bb256511e54cee667a0e6dc11e" | ||
} | ||
}, | ||
"bin": "rb.exe", | ||
"checkver": "github", | ||
"autoupdate": { | ||
"architecture": { | ||
"64bit": { | ||
"url": "https://github.com/ryuapp/rb/releases/download/v$version/rb-x86_64-pc-windows-msvc.zip" | ||
} | ||
} | ||
} | ||
} |
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,45 @@ | ||
import $ from "@david/dax"; | ||
import { crypto } from "@std/crypto"; | ||
import { encodeHex } from "@std/encoding/hex"; | ||
import zonToJson from "z2j"; | ||
|
||
function loadBuildZigZon() { | ||
const zon = zonToJson(Deno.readTextFileSync("build.zig.zon")); | ||
return JSON.parse(zon); | ||
} | ||
|
||
// zip the binary | ||
await $`powershell Compress-Archive -Path zig-out/bin/rb.exe -DestinationPath dist/rb-x86_64-pc-windows-msvc.zip -Force`; | ||
|
||
const buildZigZon = loadBuildZigZon(); | ||
const data = await Deno.readFile("dist/rb-x86_64-pc-windows-msvc.zip"); | ||
const hash = encodeHex(await crypto.subtle.digest("SHA-256", data)); | ||
|
||
const scoopTemplate = { | ||
version: buildZigZon.version, | ||
homepage: "https://github.com/ryuapp/rb", | ||
license: "MIT", | ||
architecture: { | ||
"64bit": { | ||
url: | ||
`https://github.com/ryuapp/rb/releases/download/v${buildZigZon.version}/rb-x86_64-pc-windows-msvc.zip`, | ||
hash: hash, | ||
}, | ||
}, | ||
bin: "rb.exe", | ||
checkver: "github", | ||
autoupdate: { | ||
architecture: { | ||
"64bit": { | ||
url: | ||
"https://github.com/ryuapp/rb/releases/download/v$version/rb-x86_64-pc-windows-msvc.zip", | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
// update scoop config | ||
Deno.writeFileSync( | ||
"rb.json", | ||
new TextEncoder().encode(JSON.stringify(scoopTemplate, null, 2) + "\n"), | ||
); |