Skip to content

Commit 4b544e0

Browse files
committed
chore: try to fix promote_to_release workflow
1 parent accbeb5 commit 4b544e0

File tree

3 files changed

+38
-14
lines changed

3 files changed

+38
-14
lines changed

.github/workflows/promote_to_release.yml

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -46,20 +46,8 @@ jobs:
4646
Expand-Archive -Path "denort-windows.zip" -DestinationPath "."
4747
4848
- name: Run patchver for Windows
49-
shell: pwsh
5049
run: |
51-
deno install -g -A -n patchver https://deno.land/x/[email protected]/cli.ts
52-
$CHANNEL="${{github.event.inputs.releaseKind}}"
53-
# Patch deno.exe
54-
Move-Item -Path "deno.exe" -Destination "deno_original.exe"
55-
patchver "deno_original.exe" "deno.exe" $CHANNEL
56-
# Patch denort.exe
57-
Move-Item -Path "denort.exe" -Destination "denort_original.exe"
58-
patchver "denort_original.exe" "denort.exe" $CHANNEL
59-
60-
# Rename files to match expected pattern
61-
Move-Item -Path "deno.exe" -Destination "deno-x86_64-pc-windows-msvc-$CHANNEL.exe"
62-
Move-Item -Path "denort.exe" -Destination "denort-x86_64-pc-windows-msvc-$CHANNEL.exe"
50+
deno run -A ./tools/release/promote_to_release_windows.ts ${{github.event.inputs.releaseKind}}
6351
6452
- name: Authenticate with Azure
6553
uses: azure/login@v1

tools/release/promote_to_release.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import { $ } from "jsr:@david/[email protected]";
77
import { gray } from "jsr:@std/fmt@1/colors";
8-
import { patchver } from "jsr:@deno/patchver@0.2.0";
8+
import { patchver } from "jsr:@deno/patchver@0.3.0";
99

1010
const SUPPORTED_TARGETS = [
1111
"aarch64-apple-darwin",
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/usr/bin/env -S deno run -A
2+
// Copyright 2018-2025 the Deno authors. MIT license.
3+
4+
// deno-lint-ignore-file no-console
5+
6+
import { patchver } from "jsr:@deno/[email protected]";
7+
8+
const CHANNEL = Deno.args[0];
9+
if (CHANNEL !== "rc" && CHANNEL !== "lts") {
10+
throw new Error(`Invalid channel: ${CHANNEL}`);
11+
}
12+
13+
const BINARIES = ["deno.exe", "denort.exe"];
14+
15+
async function patchBinary(inputPath: string, channel: string) {
16+
console.log(`Patching ${inputPath}...`);
17+
18+
const input = await Deno.readFile(inputPath);
19+
const output = patchver(input, channel);
20+
21+
// Extract filename without extension and create output name
22+
const baseName = inputPath.replace(/\.exe$/, "");
23+
const outputPath = `${baseName}-x86_64-pc-windows-msvc-${channel}.exe`;
24+
25+
await Deno.writeFile(outputPath, output);
26+
console.log(`Created ${outputPath}`);
27+
}
28+
29+
async function main() {
30+
for (const binary of BINARIES) {
31+
await patchBinary(binary, CHANNEL);
32+
}
33+
console.log("All Windows binaries patched successfully!");
34+
}
35+
36+
await main();

0 commit comments

Comments
 (0)