Skip to content

Commit 3eba60b

Browse files
Merge pull request #709 from denoland/main
Create a new pull request by comparing changes across two branches
2 parents 3bad0e2 + 7cabd02 commit 3eba60b

File tree

3,734 files changed

+77941
-27649
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,734 files changed

+77941
-27649
lines changed

.dprint.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
},
1414
"exec": {
1515
"commands": [{
16-
"command": "rustfmt --config imports_granularity=item",
16+
"command": "rustfmt --config imports_granularity=item --config group_imports=StdExternalCrate",
1717
"exts": ["rs"]
1818
}]
1919
},
@@ -31,6 +31,8 @@
3131
"cli/tsc/dts/lib.scripthost.d.ts",
3232
"cli/tsc/dts/lib.webworker*.d.ts",
3333
"cli/tsc/dts/typescript.d.ts",
34+
"cli/tools/doc/prism.css",
35+
"cli/tools/doc/prism.js",
3436
"ext/websocket/autobahn/reports",
3537
"gh-pages",
3638
"target",

.github/mtime_cache/action.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
1+
// Copyright 2018-2025 the Deno authors. MIT license.
22
// This file contains the implementation of a Github Action. Github uses
33
// Node.js v20.x to run actions, so this is Node code and not Deno code.
44

.github/workflows/cargo_publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
- name: Install deno
3636
uses: denoland/setup-deno@v2
3737
with:
38-
deno-version: v1.x
38+
deno-version: v2.x
3939

4040
- name: Publish
4141
env:

.github/workflows/ci.generate.ts

Lines changed: 58 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#!/usr/bin/env -S deno run --allow-write=. --lock=./tools/deno.lock.json
2-
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
2+
// Copyright 2018-2025 the Deno authors. MIT license.
33
import { stringify } from "jsr:@std/yaml@^0.221/stringify";
44

55
// Bump this number when you want to purge the cache.
66
// Note: the tools/release/01_bump_crate_versions.ts script will update this version
77
// automatically via regex, so ensure that this line maintains this format.
8-
const cacheVersion = 25;
8+
const cacheVersion = 32;
99

1010
const ubuntuX86Runner = "ubuntu-24.04";
1111
const ubuntuX86XlRunner = "ubuntu-24.04-xl";
@@ -59,6 +59,15 @@ const Runners = {
5959

6060
const prCacheKeyPrefix =
6161
`${cacheVersion}-cargo-target-\${{ matrix.os }}-\${{ matrix.arch }}-\${{ matrix.profile }}-\${{ matrix.job }}-`;
62+
const prCacheKey = `${prCacheKeyPrefix}\${{ github.sha }}`;
63+
const prCachePath = [
64+
// this must match for save and restore (https://github.com/actions/cache/issues/1444)
65+
"./target",
66+
"!./target/*/gn_out",
67+
"!./target/*/gn_root",
68+
"!./target/*/*.zip",
69+
"!./target/*/*.tar.gz",
70+
].join("\n");
6271

6372
// Note that you may need to add more version to the `apt-get remove` line below if you change this
6473
const llvmVersion = 19;
@@ -196,7 +205,7 @@ const installNodeStep = {
196205
const installDenoStep = {
197206
name: "Install Deno",
198207
uses: "denoland/setup-deno@v2",
199-
with: { "deno-version": "v1.x" },
208+
with: { "deno-version": "v2.x" },
200209
};
201210

202211
const authenticateWithGoogleCloud = {
@@ -475,6 +484,27 @@ const ci = {
475484
" -czvf target/release/deno_src.tar.gz -C .. deno",
476485
].join("\n"),
477486
},
487+
{
488+
name: "Cache Cargo home",
489+
uses: "actions/cache@v4",
490+
with: {
491+
// See https://doc.rust-lang.org/cargo/guide/cargo-home.html#caching-the-cargo-home-in-ci
492+
// Note that with the new sparse registry format, we no longer have to cache a `.git` dir
493+
path: [
494+
"~/.cargo/.crates.toml",
495+
"~/.cargo/.crates2.json",
496+
"~/.cargo/bin",
497+
"~/.cargo/registry/index",
498+
"~/.cargo/registry/cache",
499+
"~/.cargo/git/db",
500+
].join("\n"),
501+
key:
502+
`${cacheVersion}-cargo-home-\${{ matrix.os }}-\${{ matrix.arch }}-\${{ hashFiles('Cargo.lock') }}`,
503+
// We will try to restore from the closest cargo-home we can find
504+
"restore-keys":
505+
`${cacheVersion}-cargo-home-\${{ matrix.os }}-\${{ matrix.arch }}-`,
506+
},
507+
},
478508
installRustStep,
479509
{
480510
if:
@@ -598,37 +628,14 @@ const ci = {
598628
installBenchTools,
599629
].join("\n"),
600630
},
601-
{
602-
name: "Cache Cargo home",
603-
uses: "actions/cache@v4",
604-
with: {
605-
// See https://doc.rust-lang.org/cargo/guide/cargo-home.html#caching-the-cargo-home-in-ci
606-
// Note that with the new sparse registry format, we no longer have to cache a `.git` dir
607-
path: [
608-
"~/.cargo/registry/index",
609-
"~/.cargo/registry/cache",
610-
].join("\n"),
611-
key:
612-
`${cacheVersion}-cargo-home-\${{ matrix.os }}-\${{ matrix.arch }}-\${{ hashFiles('Cargo.lock') }}`,
613-
// We will try to restore from the closest cargo-home we can find
614-
"restore-keys":
615-
`${cacheVersion}-cargo-home-\${{ matrix.os }}-\${{ matrix.arch }}`,
616-
},
617-
},
618631
{
619632
// Restore cache from the latest 'main' branch build.
620633
name: "Restore cache build output (PR)",
621634
uses: "actions/cache/restore@v4",
622635
if:
623636
"github.ref != 'refs/heads/main' && !startsWith(github.ref, 'refs/tags/')",
624637
with: {
625-
path: [
626-
"./target",
627-
"!./target/*/gn_out",
628-
"!./target/*/gn_root",
629-
"!./target/*/*.zip",
630-
"!./target/*/*.tar.gz",
631-
].join("\n"),
638+
path: prCachePath,
632639
key: "never_saved",
633640
"restore-keys": prCacheKeyPrefix,
634641
},
@@ -709,6 +716,19 @@ const ci = {
709716
"df -h",
710717
].join("\n"),
711718
},
719+
{
720+
name: "Build denort release",
721+
if: [
722+
"matrix.job == 'test' &&",
723+
"matrix.profile == 'release' &&",
724+
"github.repository == 'denoland/deno'",
725+
].join("\n"),
726+
run: [
727+
"df -h",
728+
"cargo build --profile=release-slim --locked --bin denort",
729+
"df -h",
730+
].join("\n"),
731+
},
712732
{
713733
// Run a minimal check to ensure that binary is not corrupted, regardless
714734
// of our build mode
@@ -755,10 +775,11 @@ const ci = {
755775
"cd target/release",
756776
"zip -r deno-${{ matrix.arch }}-unknown-linux-gnu.zip deno",
757777
"shasum -a 256 deno-${{ matrix.arch }}-unknown-linux-gnu.zip > deno-${{ matrix.arch }}-unknown-linux-gnu.zip.sha256sum",
758-
"strip denort",
759-
"zip -r denort-${{ matrix.arch }}-unknown-linux-gnu.zip denort",
760-
"shasum -a 256 denort-${{ matrix.arch }}-unknown-linux-gnu.zip > denort-${{ matrix.arch }}-unknown-linux-gnu.zip.sha256sum",
761778
"./deno types > lib.deno.d.ts",
779+
"cd ../release-slim",
780+
"zip -r ../release/denort-${{ matrix.arch }}-unknown-linux-gnu.zip denort",
781+
"cd ../release",
782+
"shasum -a 256 denort-${{ matrix.arch }}-unknown-linux-gnu.zip > denort-${{ matrix.arch }}-unknown-linux-gnu.zip.sha256sum",
762783
].join("\n"),
763784
},
764785
{
@@ -783,8 +804,9 @@ const ci = {
783804
"cd target/release",
784805
"zip -r deno-${{ matrix.arch }}-apple-darwin.zip deno",
785806
"shasum -a 256 deno-${{ matrix.arch }}-apple-darwin.zip > deno-${{ matrix.arch }}-apple-darwin.zip.sha256sum",
786-
"strip denort",
787-
"zip -r denort-${{ matrix.arch }}-apple-darwin.zip denort",
807+
"cd ../release-slim",
808+
"zip -r ../release/denort-${{ matrix.arch }}-apple-darwin.zip denort",
809+
"cd ../release",
788810
"shasum -a 256 denort-${{ matrix.arch }}-apple-darwin.zip > denort-${{ matrix.arch }}-apple-darwin.zip.sha256sum",
789811
]
790812
.join("\n"),
@@ -801,7 +823,8 @@ const ci = {
801823
run: [
802824
"Compress-Archive -CompressionLevel Optimal -Force -Path target/release/deno.exe -DestinationPath target/release/deno-${{ matrix.arch }}-pc-windows-msvc.zip",
803825
"Get-FileHash target/release/deno-${{ matrix.arch }}-pc-windows-msvc.zip -Algorithm SHA256 | Format-List > target/release/deno-${{ matrix.arch }}-pc-windows-msvc.zip.sha256sum",
804-
"Compress-Archive -CompressionLevel Optimal -Force -Path target/release/denort.exe -DestinationPath target/release/denort-${{ matrix.arch }}-pc-windows-msvc.zip",
826+
827+
"Compress-Archive -CompressionLevel Optimal -Force -Path target/release-slim/denort.exe -DestinationPath target/release/denort-${{ matrix.arch }}-pc-windows-msvc.zip",
805828
"Get-FileHash target/release/denort-${{ matrix.arch }}-pc-windows-msvc.zip -Algorithm SHA256 | Format-List > target/release/denort-${{ matrix.arch }}-pc-windows-msvc.zip.sha256sum",
806829
].join("\n"),
807830
},
@@ -1080,14 +1103,8 @@ const ci = {
10801103
if:
10811104
"(matrix.job == 'test' || matrix.job == 'lint') && github.ref == 'refs/heads/main'",
10821105
with: {
1083-
path: [
1084-
"./target",
1085-
"!./target/*/gn_out",
1086-
"!./target/*/*.zip",
1087-
"!./target/*/*.sha256sum",
1088-
"!./target/*/*.tar.gz",
1089-
].join("\n"),
1090-
key: prCacheKeyPrefix + "${{ github.sha }}",
1106+
path: prCachePath,
1107+
key: prCacheKey,
10911108
},
10921109
},
10931110
]),

.github/workflows/ci.yml

Lines changed: 34 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -174,13 +174,26 @@ jobs:
174174
mkdir -p target/release
175175
tar --exclude=".git*" --exclude=target --exclude=third_party/prebuilt \
176176
-czvf target/release/deno_src.tar.gz -C .. deno
177+
- name: Cache Cargo home
178+
uses: actions/cache@v4
179+
with:
180+
path: |-
181+
~/.cargo/.crates.toml
182+
~/.cargo/.crates2.json
183+
~/.cargo/bin
184+
~/.cargo/registry/index
185+
~/.cargo/registry/cache
186+
~/.cargo/git/db
187+
key: '32-cargo-home-${{ matrix.os }}-${{ matrix.arch }}-${{ hashFiles(''Cargo.lock'') }}'
188+
restore-keys: '32-cargo-home-${{ matrix.os }}-${{ matrix.arch }}-'
189+
if: '!(matrix.skip)'
177190
- uses: dsherret/rust-toolchain-file@v1
178191
if: '!(matrix.skip)'
179192
- if: '!(matrix.skip) && (matrix.job == ''lint'' || matrix.job == ''test'' || matrix.job == ''bench'')'
180193
name: Install Deno
181194
uses: denoland/setup-deno@v2
182195
with:
183-
deno-version: v1.x
196+
deno-version: v2.x
184197
- name: Install Python
185198
uses: actions/setup-python@v5
186199
with:
@@ -355,15 +368,6 @@ jobs:
355368
- name: Install benchmark tools
356369
if: '!(matrix.skip) && (matrix.job == ''bench'')'
357370
run: ./tools/install_prebuilt.js wrk hyperfine
358-
- name: Cache Cargo home
359-
uses: actions/cache@v4
360-
with:
361-
path: |-
362-
~/.cargo/registry/index
363-
~/.cargo/registry/cache
364-
key: '25-cargo-home-${{ matrix.os }}-${{ matrix.arch }}-${{ hashFiles(''Cargo.lock'') }}'
365-
restore-keys: '25-cargo-home-${{ matrix.os }}-${{ matrix.arch }}'
366-
if: '!(matrix.skip)'
367371
- name: Restore cache build output (PR)
368372
uses: actions/cache/restore@v4
369373
if: '!(matrix.skip) && (github.ref != ''refs/heads/main'' && !startsWith(github.ref, ''refs/tags/''))'
@@ -375,7 +379,7 @@ jobs:
375379
!./target/*/*.zip
376380
!./target/*/*.tar.gz
377381
key: never_saved
378-
restore-keys: '25-cargo-target-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.profile }}-${{ matrix.job }}-'
382+
restore-keys: '32-cargo-target-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.profile }}-${{ matrix.job }}-'
379383
- name: Apply and update mtime cache
380384
if: '!(matrix.skip) && (!startsWith(github.ref, ''refs/tags/''))'
381385
uses: ./.github/mtime_cache
@@ -415,6 +419,15 @@ jobs:
415419
df -h
416420
cargo build --release --locked --all-targets
417421
df -h
422+
- name: Build denort release
423+
if: |-
424+
!(matrix.skip) && (matrix.job == 'test' &&
425+
matrix.profile == 'release' &&
426+
github.repository == 'denoland/deno')
427+
run: |-
428+
df -h
429+
cargo build --profile=release-slim --locked --bin denort
430+
df -h
418431
- name: Check deno binary
419432
if: '!(matrix.skip) && (matrix.job == ''test'')'
420433
run: 'target/${{ matrix.profile }}/deno eval "console.log(1+2)" | grep 3'
@@ -444,10 +457,11 @@ jobs:
444457
cd target/release
445458
zip -r deno-${{ matrix.arch }}-unknown-linux-gnu.zip deno
446459
shasum -a 256 deno-${{ matrix.arch }}-unknown-linux-gnu.zip > deno-${{ matrix.arch }}-unknown-linux-gnu.zip.sha256sum
447-
strip denort
448-
zip -r denort-${{ matrix.arch }}-unknown-linux-gnu.zip denort
449-
shasum -a 256 denort-${{ matrix.arch }}-unknown-linux-gnu.zip > denort-${{ matrix.arch }}-unknown-linux-gnu.zip.sha256sum
450460
./deno types > lib.deno.d.ts
461+
cd ../release-slim
462+
zip -r ../release/denort-${{ matrix.arch }}-unknown-linux-gnu.zip denort
463+
cd ../release
464+
shasum -a 256 denort-${{ matrix.arch }}-unknown-linux-gnu.zip > denort-${{ matrix.arch }}-unknown-linux-gnu.zip.sha256sum
451465
- name: Pre-release (mac)
452466
if: |-
453467
!(matrix.skip) && (matrix.os == 'macos' &&
@@ -463,8 +477,9 @@ jobs:
463477
cd target/release
464478
zip -r deno-${{ matrix.arch }}-apple-darwin.zip deno
465479
shasum -a 256 deno-${{ matrix.arch }}-apple-darwin.zip > deno-${{ matrix.arch }}-apple-darwin.zip.sha256sum
466-
strip denort
467-
zip -r denort-${{ matrix.arch }}-apple-darwin.zip denort
480+
cd ../release-slim
481+
zip -r ../release/denort-${{ matrix.arch }}-apple-darwin.zip denort
482+
cd ../release
468483
shasum -a 256 denort-${{ matrix.arch }}-apple-darwin.zip > denort-${{ matrix.arch }}-apple-darwin.zip.sha256sum
469484
- name: Pre-release (windows)
470485
if: |-
@@ -476,7 +491,7 @@ jobs:
476491
run: |-
477492
Compress-Archive -CompressionLevel Optimal -Force -Path target/release/deno.exe -DestinationPath target/release/deno-${{ matrix.arch }}-pc-windows-msvc.zip
478493
Get-FileHash target/release/deno-${{ matrix.arch }}-pc-windows-msvc.zip -Algorithm SHA256 | Format-List > target/release/deno-${{ matrix.arch }}-pc-windows-msvc.zip.sha256sum
479-
Compress-Archive -CompressionLevel Optimal -Force -Path target/release/denort.exe -DestinationPath target/release/denort-${{ matrix.arch }}-pc-windows-msvc.zip
494+
Compress-Archive -CompressionLevel Optimal -Force -Path target/release-slim/denort.exe -DestinationPath target/release/denort-${{ matrix.arch }}-pc-windows-msvc.zip
480495
Get-FileHash target/release/denort-${{ matrix.arch }}-pc-windows-msvc.zip -Algorithm SHA256 | Format-List > target/release/denort-${{ matrix.arch }}-pc-windows-msvc.zip.sha256sum
481496
- name: Upload canary to dl.deno.land
482497
if: |-
@@ -682,10 +697,10 @@ jobs:
682697
path: |-
683698
./target
684699
!./target/*/gn_out
700+
!./target/*/gn_root
685701
!./target/*/*.zip
686-
!./target/*/*.sha256sum
687702
!./target/*/*.tar.gz
688-
key: '25-cargo-target-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.profile }}-${{ matrix.job }}-${{ github.sha }}'
703+
key: '32-cargo-target-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.profile }}-${{ matrix.job }}-${{ github.sha }}'
689704
publish-canary:
690705
name: publish canary
691706
runs-on: ubuntu-24.04

.github/workflows/npm_publish.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: npm_publish
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'Version'
8+
type: string
9+
release:
10+
types: [published]
11+
12+
permissions:
13+
id-token: write
14+
15+
jobs:
16+
build:
17+
name: npm publish
18+
runs-on: ubuntu-latest
19+
timeout-minutes: 30
20+
21+
steps:
22+
- name: Configure git
23+
run: |
24+
git config --global core.symlinks true
25+
git config --global fetch.parallel 32
26+
27+
- name: Clone repository
28+
uses: actions/checkout@v4
29+
with:
30+
submodules: recursive
31+
32+
- name: Install Deno
33+
uses: denoland/setup-deno@v2
34+
with:
35+
deno-version: v2.x
36+
- name: Install Node
37+
uses: actions/setup-node@v4
38+
with:
39+
node-version: '22.x'
40+
registry-url: 'https://registry.npmjs.org'
41+
42+
- name: Publish
43+
env:
44+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
45+
run: ./tools/release/npm/build.ts ${{ github.event.inputs.version }} --publish

.github/workflows/promote_to_release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
- name: Install deno
4343
uses: denoland/setup-deno@v2
4444
with:
45-
deno-version: v1.x
45+
deno-version: v2.x
4646

4747
- name: Install rust-codesign
4848
run: |-

.github/workflows/start_release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
- name: Install deno
3737
uses: denoland/setup-deno@v2
3838
with:
39-
deno-version: v1.x
39+
deno-version: v2.x
4040

4141
- name: Create Gist URL
4242
env:

0 commit comments

Comments
 (0)