denoland/deno

10 workflows · maturity 67% · 11 patterns · GitHub ↗

Security 2.5/100

Security dimensions

permissions
2.5
security scan
0
supply chain
0
secret handling
0
harden runner
0

Workflows (10)

cargo_publish .github/workflows/cargo_publish.yml
Triggers
workflow_dispatch
Runs on
ubuntu-24.04-xl
Jobs
build
Actions
dsherret/rust-toolchain-file, denoland/setup-deno
Commands
  • git config --global core.symlinks true git config --global fetch.parallel 32
  • ./tools/release/03_publish_crates.ts
  • git config user.email "${{ github.actor }}@users.noreply.github.com" git config user.name "${{ github.actor }}" ./tools/release/04_post_publish.ts
View raw YAML
name: cargo_publish

on: workflow_dispatch

# Ensures only one publish is running at a time
concurrency:
  group: ${{ github.workflow }}
  cancel-in-progress: true

jobs:
  build:
    name: cargo publish
    runs-on: ubuntu-24.04-xl
    timeout-minutes: 90

    env:
      CARGO_TERM_COLOR: always
      RUST_BACKTRACE: full
      RUSTC_FORCE_INCREMENTAL: 1

    steps:
      - name: Configure git
        run: |
          git config --global core.symlinks true
          git config --global fetch.parallel 32

      - name: Clone repository
        uses: actions/checkout@v6
        with:
          fetch-depth: 0
          token: ${{ secrets.DENOBOT_PAT }}
          submodules: recursive

      - uses: dsherret/rust-toolchain-file@v1

      - name: Install deno
        uses: denoland/setup-deno@v2
        with:
          deno-version: v2.x

      - name: Publish
        env:
          CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
        run: ./tools/release/03_publish_crates.ts

      - name: Create release tag and check forward commit to main
        env:
          # the default secrets.GITHUB_TOKEN won't trigger a workflow run
          # when tagging, but it will if we provide a custom PAT
          GITHUB_TOKEN: ${{ secrets.DENOBOT_PAT }}
          GH_WORKFLOW_ACTOR: ${{ github.actor }}
        run: |
          git config user.email "${{ github.actor }}@users.noreply.github.com"
          git config user.name "${{ github.actor }}"
          ./tools/release/04_post_publish.ts
ci matrix perms .github/workflows/ci.yml
Triggers
push, pull_request
Runs on
ubuntu-latest, ubuntu-24.04, macos-15-intel, macos-15-intel, ${{ !contains(github.event.pull_request.labels.*.name, 'ci-full') && github.event_name == 'pull_request' && 'ubuntu-24.04' || 'macos-15-intel' }}, ${{ !contains(github.event.pull_request.labels.*.name, 'ci-full') && github.event_name == 'pull_request' && 'ubuntu-24.04' || 'macos-15-intel' }}, macos-14, macos-14, macos-14, ${{ !contains(github.event.pull_request.labels.*.name, 'ci-full') && github.event_name == 'pull_request' && 'ubuntu-24.04' || 'macos-14' }}, ${{ !contains(github.event.pull_request.labels.*.name, 'ci-full') && github.event_name == 'pull_request' && 'ubuntu-24.04' || 'macos-14' }}, windows-2022, windows-2022, windows-2022, ${{ !contains(github.event.pull_request.labels.*.name, 'ci-full') && github.event_name == 'pull_request' && 'ubuntu-24.04' || github.repository == 'denoland/deno' && 'windows-2022-xl' || 'windows-2022' }}, ${{ !contains(github.event.pull_request.labels.*.name, 'ci-full') && github.event_name == 'pull_request' && 'ubuntu-24.04' || 'windows-2022' }}, windows-11-arm, windows-11-arm, ${{ !contains(github.event.pull_request.labels.*.name, 'ci-full') && github.event_name == 'pull_request' && 'ubuntu-24.04' || 'windows-11-arm' }}, ${{ !contains(github.event.pull_request.labels.*.name, 'ci-full') && github.event_name == 'pull_request' && 'ubuntu-24.04' || 'windows-11-arm' }}, ubuntu-24.04, ubuntu-24.04, ubuntu-24.04, ubuntu-24.04, ubuntu-24.04, ubuntu-24.04, ubuntu-24.04-arm, ubuntu-24.04-arm, ubuntu-24.04-arm, ${{ !contains(github.event.pull_request.labels.*.name, 'ci-full') && github.event_name == 'pull_request' && 'ubuntu-24.04' || 'ubuntu-24.04-arm' }}, ${{ !contains(github.event.pull_request.labels.*.name, 'ci-full') && github.event_name == 'pull_request' && 'ubuntu-24.04' || 'ubuntu-24.04-arm' }}, ${{ matrix.runner }}, ubuntu-24.04, ubuntu-24.04, ubuntu-latest, ubuntu-24.04
Jobs
pre_build, bench, build-debug-macos-x86_64, test-debug-macos-x86_64, build-release-macos-x86_64, test-release-macos-x86_64, build-debug-macos-aarch64, test-debug-macos-aarch64, test-libs-debug-macos-aarch64, build-release-macos-aarch64, test-release-macos-aarch64, build-debug-windows-x86_64, test-debug-windows-x86_64, test-libs-debug-windows-x86_64, build-release-windows-x86_64, test-release-windows-x86_64, build-debug-windows-aarch64, test-debug-windows-aarch64, build-release-windows-aarch64, test-release-windows-aarch64, build-release-linux-x86_64, test-release-linux-x86_64, wpt-release-linux-x86_64, build-debug-linux-x86_64, test-debug-linux-x86_64, build-libs-debug-linux-x86_64, build-debug-linux-aarch64, test-debug-linux-aarch64, test-libs-debug-linux-aarch64, build-release-linux-aarch64, test-release-linux-aarch64, lint, deno-core-test, deno-core-miri, ci-status, publish-canary
Matrix
include, include.arch, include.job, include.os, include.profile, include.runner, include.shard_index, include.shard_label, include.shard_total, include.test_crate, include.test_package→ , (1/2) , (2/2) , 0, 1, 2, debug, integration, integration_tests, lint, linux, macos, macos-15-intel, node_compat, node_compat_tests, specs, specs_tests, ubuntu-24.04, unit, unit_node, unit_node_tests, unit_tests, windows, windows-2022, x86_64
Actions
denoland/setup-deno, dsherret/rust-toolchain-file, denoland/setup-deno, dsherret/rust-toolchain-file, dsherret/rust-toolchain-file, denoland/setup-deno, dsherret/rust-toolchain-file, google-github-actions/auth, google-github-actions/setup-gcloud, softprops/action-gh-release, dsherret/rust-toolchain-file, denoland/setup-deno, dsherret/rust-toolchain-file, dsherret/rust-toolchain-file, denoland/setup-deno, dsherret/rust-toolchain-file, denoland/setup-deno, denoland/setup-deno, dsherret/rust-toolchain-file, google-github-actions/auth, google-github-actions/setup-gcloud, softprops/action-gh-release, dsherret/rust-toolchain-file, denoland/setup-deno, dsherret/rust-toolchain-file, dsherret/rust-toolchain-file, dsherret/rust-toolchain-file, dsherret/rust-toolchain-file, azure/login, Azure/artifact-signing-action, google-github-actions/auth, google-github-actions/setup-gcloud, softprops/action-gh-release, dsherret/rust-toolchain-file, dsherret/rust-toolchain-file, dsherret/rust-toolchain-file, dsherret/rust-toolchain-file, azure/login, Azure/artifact-signing-action, google-github-actions/auth, google-github-actions/setup-gcloud, softprops/action-gh-release, dsherret/rust-toolchain-file, dsherret/rust-toolchain-file, google-github-actions/auth, google-github-actions/setup-gcloud, softprops/action-gh-release, dsherret/rust-toolchain-file, denoland/setup-deno, google-github-actions/auth, google-github-actions/setup-gcloud, dsherret/rust-toolchain-file, dsherret/rust-toolchain-file, dsherret/rust-toolchain-file, dsherret/rust-toolchain-file, dsherret/rust-toolchain-file, dsherret/rust-toolchain-file, dsherret/rust-toolchain-file, google-github-actions/auth, google-github-actions/setup-gcloud, softprops/action-gh-release, dsherret/rust-toolchain-file, dsherret/rust-toolchain-file, denoland/setup-deno, dsherret/rust-toolchain-file, denoland/setup-deno, cargo-bins/cargo-binstall, dtolnay/rust-toolchain, google-github-actions/auth, google-github-actions/setup-gcloud
Commands
  • git config --global core.symlinks true git config --global fetch.parallel 32
  • GIT_MESSAGE=$(git log --format=%s -n 1 ${{github.event.after}}) echo Commit message: $GIT_MESSAGE echo $GIT_MESSAGE | grep '\[ci\]' || (echo 'Exiting due to draft PR. Commit with [ci] to bypass or add the ci-draft label.' ; echo 'skip_build=true' >> $GITHUB_OUTPUT)
  • git fetch --depth=1 origin ${{ github.event.pull_request.base.sha }} deno run -A tools/check_deno_core_changes.js ${{ github.event.pull_request.base.sha }}
  • git config --global core.symlinks true git config --global fetch.parallel 32
  • git submodule update --init --recursive --depth=1 -- ./tests/bench/testdata/lsp_benchdata
  • git submodule update --init --recursive --depth=1 -- ./tests/util/std
  • # Setting up sysroot export DEBIAN_FRONTEND=noninteractive # Avoid running man-db triggers, which sometimes takes several minutes # to complete. sudo apt-get -qq remove --purge -y man-db > /dev/null 2> /dev/null # Remove older clang before we install sudo apt-get -qq remove 'clang-12*' 'clang-13*' 'clang-14*' 'clang-15*' 'clang-16*' 'clang-17*' 'clang-18*' 'clang-19*' 'llvm-12*' 'llvm-13*' 'llvm-14*' 'llvm-15*' 'llvm-16*' 'llvm-17*' 'llvm-18*' 'llvm-19*' 'lld-12*' 'lld-13*' 'lld-14*' 'lld-15*' 'lld-16*' 'lld-17*' 'lld-18*' 'lld-19*' > /dev/null 2> /dev/null # Install clang-XXX, lld-XXX, and debootstrap. echo "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-21 main" | sudo dd of=/etc/apt/sources.list.d/llvm-toolchain-noble-21.list curl https://apt.llvm.org/llvm-snapshot.gpg.key | gpg --dearmor | sudo dd of=/etc/apt/trusted.gpg.d/llvm-snapshot.gpg sudo apt-get update # this was unreliable sometimes, so try again if it fails sudo apt-get install -y --no-install-recommends clang-21 lld-21 clang-tools-21 clang-format-21 clang-tidy-21 || (echo 'Failed. Trying again.' && sudo apt-get clean && sudo apt-get update && sudo apt-get install -y --no-install-recommends clang-21 lld-21 clang-tools-21 clang-format-21 clang-tidy-21) # Fix alternatives (yes '' | sudo update-alternatives --force --all) > /dev/null 2> /dev/null || true clang-21 -c -o /tmp/memfd_create_shim.o tools/memfd_create_shim.c -fPIC echo "Decompressing sysroot..." wget -q https://github.com/denoland/deno_sysroot_build/releases/download/sysroot-20250207/sysroot-`uname -m`.tar.xz -O /tmp/sysroot.tar.xz cd / xzcat /tmp/sysroot.tar.xz | sudo tar -x sudo mount --rbind /dev /sysroot/dev sudo mount --rbind /sys /sysroot/sys sudo mount --rbind /home /sysroot/home sudo mount -t proc /proc /sysroot/proc cd echo "Done." # Configure the build environment. Both Rust and Clang will produce # llvm bitcode only, so we can use lld's incremental LTO support. # Load the sysroot's env vars echo "sysroot env:" cat /sysroot/.env . /sysroot/.env # Important notes: # 1. -ldl seems to be required to avoid a failure in FFI tests. This flag seems # to be in the Rust default flags in the smoketest, so uncertain why we need # to be explicit here. # 2. RUSTFLAGS and RUSTDOCFLAGS must be specified, otherwise the doctests fail # to build because the object formats are not compatible. echo " CARGO_PROFILE_BENCH_INCREMENTAL=false CARGO_PROFILE_RELEASE_INCREMENTAL=false RUSTFLAGS<<__1 -C linker-plugin-lto=true -C linker=clang-21 -C link-arg=-fuse-ld=lld-21 -C link-arg=-ldl -C link-arg=-Wl,--allow-shlib-undefined -C link-arg=-Wl,--thinlto-cache-dir=$(pwd)/target/release/lto-cache -C link-arg=-Wl,--thinlto-cache-policy,cache_size_bytes=700m -C link-arg=/tmp/memfd_create_shim.o --cfg tokio_unstable $RUSTFLAGS __1 RUSTDOCFLAGS<<__1 -C linker-plugin-lto=true -C linker=clang-21 -C link-arg=-fuse-ld=lld-21 -C link-arg=-ldl -C link-arg=-Wl,--allow-shlib-undefined -C link-arg=-Wl,--thinlto-cache-dir=$(pwd)/target/release/lto-cache -C link-arg=-Wl,--thinlto-cache-policy,cache_size_bytes=700m -C link-arg=/tmp/memfd_create_shim.o --cfg tokio_unstable $RUSTFLAGS __1 CC=/usr/bin/clang-21 CFLAGS=$CFLAGS " > $GITHUB_ENV
  • ./tools/install_prebuilt.js wrk hyperfine
View raw YAML
# GENERATED BY ./ci.generate.ts -- DO NOT DIRECTLY EDIT

name: ci
on:
  push:
    branches:
      - main
    tags:
      - '*'
  pull_request:
    types:
      - opened
      - reopened
      - synchronize
      - ready_for_review
permissions:
  contents: write
  id-token: write
concurrency:
  group: '${{ github.workflow }}-${{ !contains(github.event.pull_request.labels.*.name, ''ci-test-flaky'') && github.head_ref || github.run_id }}'
  cancel-in-progress: true
jobs:
  pre_build:
    name: pre-build
    runs-on: ubuntu-latest
    outputs:
      skip_build: '${{ steps.check.outputs.skip_build }}'
      skip_deno_core_test: '${{ steps.deno_core_changes.outputs.skip_deno_core_test }}'
    steps:
      - name: Configure git
        if: github.event_name == 'pull_request'
        run: |-
          git config --global core.symlinks true
          git config --global fetch.parallel 32
      - name: Clone repository
        uses: actions/checkout@v6
        if: github.event_name == 'pull_request'
        with:
          fetch-depth: 5
          submodules: false
      - name: Install Deno
        uses: denoland/setup-deno@v2
        if: github.event_name == 'pull_request'
        with:
          deno-version: v2.x
      - id: check
        if: 'github.event_name == ''pull_request'' && github.event.pull_request.draft == true && !contains(github.event.pull_request.labels.*.name, ''ci-draft'')'
        run: |-
          GIT_MESSAGE=$(git log --format=%s -n 1 ${{github.event.after}})
          echo Commit message: $GIT_MESSAGE
          echo $GIT_MESSAGE | grep '\[ci\]' || (echo 'Exiting due to draft PR. Commit with [ci] to bypass or add the ci-draft label.' ; echo 'skip_build=true' >> $GITHUB_OUTPUT)
      - id: deno_core_changes
        if: github.event_name == 'pull_request'
        run: |-
          git fetch --depth=1 origin ${{ github.event.pull_request.base.sha }}
          deno run -A tools/check_deno_core_changes.js ${{ github.event.pull_request.base.sha }}
  bench:
    name: bench release linux-x86_64
    needs:
      - pre_build
    if: needs.pre_build.outputs.skip_build != 'true'
    runs-on: ubuntu-24.04
    timeout-minutes: 240
    defaults:
      run:
        shell: bash
    steps:
      - name: Configure git
        if: '(contains(github.event.pull_request.labels.*.name, ''ci-bench'') || github.ref == ''refs/heads/main'') && !startsWith(github.ref, ''refs/tags/'')'
        run: |-
          git config --global core.symlinks true
          git config --global fetch.parallel 32
      - name: Clone repository
        uses: actions/checkout@v6
        if: '(contains(github.event.pull_request.labels.*.name, ''ci-bench'') || github.ref == ''refs/heads/main'') && !startsWith(github.ref, ''refs/tags/'')'
        with:
          fetch-depth: 5
          submodules: false
      - name: Restore cache cargo home
        uses: actions/cache/restore@v4
        if: '(contains(github.event.pull_request.labels.*.name, ''ci-bench'') || github.ref == ''refs/heads/main'') && !startsWith(github.ref, ''refs/tags/'')'
        with:
          path: |-
            ~/.cargo/.crates.toml
            ~/.cargo/.crates2.json
            ~/.cargo/bin
            ~/.cargo/registry/index
            ~/.cargo/registry/cache
            ~/.cargo/git/db
          key: never_saved
          restore-keys: 106-cargo-home-linux-x86_64-bench-
      - name: Install Node
        uses: actions/setup-node@v6
        if: '(contains(github.event.pull_request.labels.*.name, ''ci-bench'') || github.ref == ''refs/heads/main'') && !startsWith(github.ref, ''refs/tags/'')'
        with:
          node-version: 22
      - uses: dsherret/rust-toolchain-file@v1
        if: '(contains(github.event.pull_request.labels.*.name, ''ci-bench'') || github.ref == ''refs/heads/main'') && !startsWith(github.ref, ''refs/tags/'')'
      - name: Clone submodule ./tests/bench/testdata/lsp_benchdata
        if: '(contains(github.event.pull_request.labels.*.name, ''ci-bench'') || github.ref == ''refs/heads/main'') && !startsWith(github.ref, ''refs/tags/'')'
        run: git submodule update --init --recursive --depth=1 -- ./tests/bench/testdata/lsp_benchdata
      - name: Clone submodule ./tests/util/std
        if: '(contains(github.event.pull_request.labels.*.name, ''ci-bench'') || github.ref == ''refs/heads/main'') && !startsWith(github.ref, ''refs/tags/'')'
        run: git submodule update --init --recursive --depth=1 -- ./tests/util/std
      - name: Set up incremental LTO and sysroot build
        if: '(contains(github.event.pull_request.labels.*.name, ''ci-bench'') || github.ref == ''refs/heads/main'') && !startsWith(github.ref, ''refs/tags/'')'
        run: |-
          # Setting up sysroot
          export DEBIAN_FRONTEND=noninteractive
          # Avoid running man-db triggers, which sometimes takes several minutes
          # to complete.
          sudo apt-get -qq remove --purge -y man-db > /dev/null 2> /dev/null
          # Remove older clang before we install
          sudo apt-get -qq remove   'clang-12*' 'clang-13*' 'clang-14*' 'clang-15*' 'clang-16*' 'clang-17*' 'clang-18*' 'clang-19*' 'llvm-12*' 'llvm-13*' 'llvm-14*' 'llvm-15*' 'llvm-16*' 'llvm-17*' 'llvm-18*' 'llvm-19*' 'lld-12*' 'lld-13*' 'lld-14*' 'lld-15*' 'lld-16*' 'lld-17*' 'lld-18*' 'lld-19*' > /dev/null 2> /dev/null

          # Install clang-XXX, lld-XXX, and debootstrap.
          echo "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-21 main" |
            sudo dd of=/etc/apt/sources.list.d/llvm-toolchain-noble-21.list
          curl https://apt.llvm.org/llvm-snapshot.gpg.key |
            gpg --dearmor                                 |
          sudo dd of=/etc/apt/trusted.gpg.d/llvm-snapshot.gpg
          sudo apt-get update
          # this was unreliable sometimes, so try again if it fails
          sudo apt-get install -y --no-install-recommends clang-21 lld-21 clang-tools-21 clang-format-21 clang-tidy-21 || (echo 'Failed. Trying again.' && sudo apt-get clean && sudo apt-get update && sudo apt-get install -y --no-install-recommends clang-21 lld-21 clang-tools-21 clang-format-21 clang-tidy-21)
          # Fix alternatives
          (yes '' | sudo update-alternatives --force --all) > /dev/null 2> /dev/null || true

          clang-21 -c -o /tmp/memfd_create_shim.o tools/memfd_create_shim.c -fPIC

          echo "Decompressing sysroot..."
          wget -q https://github.com/denoland/deno_sysroot_build/releases/download/sysroot-20250207/sysroot-`uname -m`.tar.xz -O /tmp/sysroot.tar.xz
          cd /
          xzcat /tmp/sysroot.tar.xz | sudo tar -x
          sudo mount --rbind /dev /sysroot/dev
          sudo mount --rbind /sys /sysroot/sys
          sudo mount --rbind /home /sysroot/home
          sudo mount -t proc /proc /sysroot/proc
          cd

          echo "Done."

          # Configure the build environment. Both Rust and Clang will produce
          # llvm bitcode only, so we can use lld's incremental LTO support.

          # Load the sysroot's env vars
          echo "sysroot env:"
          cat /sysroot/.env
          . /sysroot/.env

          # Important notes:
          #   1. -ldl seems to be required to avoid a failure in FFI tests. This flag seems
          #      to be in the Rust default flags in the smoketest, so uncertain why we need
          #      to be explicit here.
          #   2. RUSTFLAGS and RUSTDOCFLAGS must be specified, otherwise the doctests fail
          #      to build because the object formats are not compatible.
          echo "
          CARGO_PROFILE_BENCH_INCREMENTAL=false
          CARGO_PROFILE_RELEASE_INCREMENTAL=false
          RUSTFLAGS<<__1
            -C linker-plugin-lto=true
            -C linker=clang-21
            -C link-arg=-fuse-ld=lld-21
            -C link-arg=-ldl
            -C link-arg=-Wl,--allow-shlib-undefined
            -C link-arg=-Wl,--thinlto-cache-dir=$(pwd)/target/release/lto-cache
            -C link-arg=-Wl,--thinlto-cache-policy,cache_size_bytes=700m
            -C link-arg=/tmp/memfd_create_shim.o
            --cfg tokio_unstable
            $RUSTFLAGS
          __1
          RUSTDOCFLAGS<<__1
            -C linker-plugin-lto=true
            -C linker=clang-21
            -C link-arg=-fuse-ld=lld-21
            -C link-arg=-ldl
            -C link-arg=-Wl,--allow-shlib-undefined
            -C link-arg=-Wl,--thinlto-cache-dir=$(pwd)/target/release/lto-cache
            -C link-arg=-Wl,--thinlto-cache-policy,cache_size_bytes=700m
            -C link-arg=/tmp/memfd_create_shim.o
            --cfg tokio_unstable
            $RUSTFLAGS
          __1
          CC=/usr/bin/clang-21
          CFLAGS=$CFLAGS
          " > $GITHUB_ENV
      - name: Install Deno
        uses: denoland/setup-deno@v2
        if: '(contains(github.event.pull_request.labels.*.name, ''ci-bench'') || github.ref == ''refs/heads/main'') && !startsWith(github.ref, ''refs/tags/'')'
        with:
          deno-version: v2.x
      - name: Install benchmark tools
        if: '(contains(github.event.pull_request.labels.*.name, ''ci-bench'') || github.ref == ''refs/heads/main'') && !startsWith(github.ref, ''refs/tags/'')'
        env:
          GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
        run: ./tools/install_prebuilt.js wrk hyperfine
      - name: Build deno
        if: '(contains(github.event.pull_request.labels.*.name, ''ci-bench'') || github.ref == ''refs/heads/main'') && !startsWith(github.ref, ''refs/tags/'')'
        run: cargo build --release -p deno
      - name: Run benchmarks
        if: '(contains(github.event.pull_request.labels.*.name, ''ci-bench'') || github.ref == ''refs/heads/main'') && !startsWith(github.ref, ''refs/tags/'')'
        run: cargo bench -p bench_tests --bench deno_bench --locked
      - name: Post benchmarks
        if: '!startsWith(github.ref, ''refs/tags/'') && github.repository == ''denoland/deno'' && github.ref == ''refs/heads/main'''
        env:
          DENOBOT_PAT: '${{ secrets.DENOBOT_PAT }}'
        run: |-
          git clone --depth 1 --branch gh-pages                             \
              https://${DENOBOT_PAT}@github.com/denoland/benchmark_data.git \
              gh-pages
          ./target/release/deno run --allow-all ./tools/build_benchmark_jsons.js --release
          cd gh-pages
          git config user.email "propelml@gmail.com"
          git config user.name "denobot"
          git add .
          git commit --message "Update benchmarks"
          git push origin gh-pages
      - name: Worker info
        if: '(contains(github.event.pull_request.labels.*.name, ''ci-bench'') || github.ref == ''refs/heads/main'') && !startsWith(github.ref, ''refs/tags/'')'
        run: |-
          cat /proc/cpuinfo
          cat /proc/meminfo
      - name: Cache cargo home
        uses: actions/cache/save@v4
        if: '!startsWith(github.ref, ''refs/tags/'') && github.ref == ''refs/heads/main'''
        with:
          path: |-
            ~/.cargo/.crates.toml
            ~/.cargo/.crates2.json
            ~/.cargo/bin
            ~/.cargo/registry/index
            ~/.cargo/registry/cache
            ~/.cargo/git/db
          key: '106-cargo-home-linux-x86_64-bench-${{ github.sha }}'
  build-debug-macos-x86_64:
    name: build debug macos-x86_64
    needs:
      - pre_build
    if: needs.pre_build.outputs.skip_build != 'true'
    runs-on: macos-15-intel
    environment:
      name: '${{ (github.ref == ''refs/heads/main'' || startsWith(github.ref, ''refs/tags/'')) && ''build'' || '''' }}'
    timeout-minutes: 240
    defaults:
      run:
        shell: bash
    env:
      CARGO_TERM_COLOR: always
      RUST_BACKTRACE: full
      RUST_LIB_BACKTRACE: 0
    steps:
      - name: Configure git
        run: |-
          git config --global core.symlinks true
          git config --global fetch.parallel 32
      - name: Clone repository
        uses: actions/checkout@v6
        with:
          fetch-depth: 5
          submodules: false
      - name: Clone submodule ./tests/util/std
        run: git submodule update --init --recursive --depth=1 -- ./tests/util/std
      - name: Remove macOS cURL --ipv4 flag
        run: |-
          curl --version
          which curl
          cat /etc/hosts
          rm ~/.curlrc || true
      - name: Restore cache cargo home
        uses: actions/cache/restore@v4
        if: '!startsWith(github.ref, ''refs/tags/'')'
        with:
          path: |-
            ~/.cargo/.crates.toml
            ~/.cargo/.crates2.json
            ~/.cargo/bin
            ~/.cargo/registry/index
            ~/.cargo/registry/cache
            ~/.cargo/git/db
          key: never_saved
          restore-keys: 106-cargo-home-macos-x86_64-build-main-
      - name: Restore cache build output
        uses: actions/cache/restore@v4
        if: 'github.ref != ''refs/heads/main'' && !startsWith(github.ref, ''refs/tags/'')'
        with:
          path: |-
            ./target
            !./target/*/gn_out
            !./target/*/gn_root
            !./target/*/*.zip
            !./target/*/*.tar.gz
          key: never_saved
          restore-keys: 106-cargo-target-macos-x86_64-debug-build-main-
      - name: Apply and update mtime cache
        uses: ./.github/mtime_cache
        with:
          cache-path: ./target
      - uses: dsherret/rust-toolchain-file@v1
      - name: Build debug
        env:
          CARGO_PROFILE_DEV_DEBUG: 0
        run: cargo build --locked --bin deno --bin denort --bin test_server --features=panic-trace
      - name: Log versions
        run: |-
          echo '*** Python'
          command -v python && python --version || echo 'No python found or bad executable'
          echo '*** Rust'
          command -v rustc && rustc --version || echo 'No rustc found or bad executable'
          echo '*** Cargo'
          command -v cargo && cargo --version || echo 'No cargo found or bad executable'
          echo '*** Deno'
          command -v deno && deno --version || echo 'No deno found or bad executable'
          echo '*** Node'
          command -v node && node --version || echo 'No node found or bad executable'
          echo '*** Installed packages'
          command -v dpkg && dpkg -l || echo 'No dpkg found or bad executable'
      - name: Check deno binary
        env:
          NO_COLOR: 1
        run: target/debug/deno eval "console.log(1+2)" | grep 3
      - name: Upload artifact debug-macos-x86_64-deno
        uses: actions/upload-artifact@v6
        with:
          name: debug-macos-x86_64-deno
          path: target/debug/deno
          retention-days: 3
      - name: Upload artifact debug-macos-x86_64-denort
        uses: actions/upload-artifact@v6
        with:
          name: debug-macos-x86_64-denort
          path: target/debug/denort
          retention-days: 3
      - name: Upload artifact debug-macos-x86_64-test-server
        uses: actions/upload-artifact@v6
        with:
          name: debug-macos-x86_64-test-server
          path: target/debug/test_server
          retention-days: 3
      - name: Cache cargo home
        uses: actions/cache/save@v4
        if: 'github.ref == ''refs/heads/main'' && !startsWith(github.ref, ''refs/tags/'')'
        with:
          path: |-
            ~/.cargo/.crates.toml
            ~/.cargo/.crates2.json
            ~/.cargo/bin
            ~/.cargo/registry/index
            ~/.cargo/registry/cache
            ~/.cargo/git/db
          key: '106-cargo-home-macos-x86_64-build-main-${{ github.sha }}'
      - name: Cache build output
        uses: actions/cache/save@v4
        if: 'github.ref == ''refs/heads/main'' && !startsWith(github.ref, ''refs/tags/'')'
        with:
          path: |-
            ./target
            !./target/*/gn_out
            !./target/*/gn_root
            !./target/*/*.zip
            !./target/*/*.tar.gz
          key: '106-cargo-target-macos-x86_64-debug-build-main-${{ github.sha }}'
  test-debug-macos-x86_64:
    name: 'test ${{ matrix.test_crate }} ${{ matrix.shard_label }}debug macos-x86_64'
    needs:
      - build-debug-macos-x86_64
    runs-on: macos-15-intel
    timeout-minutes: 30
    defaults:
      run:
        shell: bash
    strategy:
      matrix:
        include:
          - test_crate: integration
            test_package: integration_tests
            shard_index: '0'
            shard_total: '2'
            shard_label: '(1/2) '
          - test_crate: integration
            test_package: integration_tests
            shard_index: '1'
            shard_total: '2'
            shard_label: '(2/2) '
          - test_crate: node_compat
            test_package: node_compat_tests
            shard_index: '0'
            shard_total: '1'
            shard_label: ''
          - test_crate: specs
            test_package: specs_tests
            shard_index: '0'
            shard_total: '2'
            shard_label: '(1/2) '
          - test_crate: specs
            test_package: specs_tests
            shard_index: '1'
            shard_total: '2'
            shard_label: '(2/2) '
          - test_crate: unit
            test_package: unit_tests
            shard_index: '0'
            shard_total: '1'
            shard_label: ''
          - test_crate: unit_node
            test_package: unit_node_tests
            shard_index: '0'
            shard_total: '1'
            shard_label: ''
      fail-fast: false
    env:
      CARGO_TERM_COLOR: always
      RUST_BACKTRACE: full
      RUST_LIB_BACKTRACE: 0
    steps:
      - name: Configure git
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        run: |-
          git config --global core.symlinks true
          git config --global fetch.parallel 32
      - name: Clone repository
        uses: actions/checkout@v6
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        with:
          fetch-depth: 5
          submodules: false
      - name: Clone submodule ./tests/node_compat/runner/suite
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && matrix.test_crate == ''node_compat'''
        run: git submodule update --init --recursive --depth=1 -- ./tests/node_compat/runner/suite
      - name: Clone submodule ./tests/util/std
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        run: git submodule update --init --recursive --depth=1 -- ./tests/util/std
      - name: Restore cache cargo home
        uses: actions/cache/restore@v4
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        with:
          path: |-
            ~/.cargo/.crates.toml
            ~/.cargo/.crates2.json
            ~/.cargo/bin
            ~/.cargo/registry/index
            ~/.cargo/registry/cache
            ~/.cargo/git/db
          key: never_saved
          restore-keys: '106-cargo-home-macos-x86_64-test-${{ matrix.test_crate }}-'
      - name: Restore cache build output
        uses: actions/cache/restore@v4
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && github.ref != ''refs/heads/main'''
        with:
          path: |-
            ./target
            !./target/*/gn_out
            !./target/*/gn_root
            !./target/*/*.zip
            !./target/*/*.tar.gz
          key: never_saved
          restore-keys: '106-cargo-target-macos-x86_64-debug-test-${{ matrix.test_crate }}-'
      - name: Apply and update mtime cache
        uses: ./.github/mtime_cache
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        with:
          cache-path: ./target
      - name: Install Node
        uses: actions/setup-node@v6
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        with:
          node-version: 22
      - uses: dsherret/rust-toolchain-file@v1
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
      - name: Download artifact debug-macos-x86_64-deno
        uses: actions/download-artifact@v6
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        with:
          name: debug-macos-x86_64-deno
          path: target/debug
      - name: Set target/debug/deno permissions
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        run: chmod +x target/debug/deno
      - name: Download artifact debug-macos-x86_64-denort
        uses: actions/download-artifact@v6
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && (matrix.test_crate == ''integration'' || matrix.test_crate == ''specs'')'
        with:
          name: debug-macos-x86_64-denort
          path: target/debug
      - name: Set target/debug/denort permissions
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && (matrix.test_crate == ''integration'' || matrix.test_crate == ''specs'')'
        run: chmod +x target/debug/denort
      - name: Download artifact debug-macos-x86_64-test-server
        uses: actions/download-artifact@v6
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && (matrix.test_crate == ''integration'' || matrix.test_crate == ''specs'' || matrix.test_crate == ''unit'' || matrix.test_crate == ''unit_node'')'
        with:
          name: debug-macos-x86_64-test-server
          path: target/debug
      - name: Set target/debug/test_server permissions
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && (matrix.test_crate == ''integration'' || matrix.test_crate == ''specs'' || matrix.test_crate == ''unit'' || matrix.test_crate == ''unit_node'')'
        run: chmod +x target/debug/test_server
      - name: Set up playwright cache
        uses: actions/cache@v5
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        with:
          path: ./.ms-playwright
          key: 'playwright-${{ runner.os }}-${{ runner.arch }}'
      - name: Build ffi (debug)
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && matrix.test_crate == ''specs'''
        run: cargo build -p test_ffi
      - name: Test (debug)
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        env:
          CARGO_PROFILE_DEV_DEBUG: 0
          CI_SHARD_INDEX: '${{ github.event_name == ''pull_request'' && matrix.shard_index || '''' }}'
          CI_SHARD_TOTAL: '${{ github.event_name == ''pull_request'' && matrix.shard_total || '''' }}'
        run: 'cargo test -p ${{ matrix.test_package }} --test ${{ matrix.test_crate }}'
      - name: Ensure no git changes
        if: '!startsWith(github.ref, ''refs/tags/'') && github.event_name == ''pull_request'''
        run: "if [[ -n \"$(git status --porcelain)\" ]]; then\necho \"❌ Git working directory is dirty. Ensure `cargo test` is not modifying git tracked files.\"\necho \"\"\necho \"\U0001F4CB Status:\"\ngit status\necho \"\"\nexit 1\nfi"
      - name: Upload test results
        uses: actions/upload-artifact@v6
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && always()'
        with:
          name: 'test-results-macos-x86_64-debug-${{ matrix.test_crate }}${{ matrix.shard_total > 1 && format(''-shard-{0}'', matrix.shard_index) || '''' }}.json'
          path: 'target/test_results_${{ matrix.test_crate }}.json'
      - name: Cache cargo home
        uses: actions/cache/save@v4
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && github.ref == ''refs/heads/main'''
        with:
          path: |-
            ~/.cargo/.crates.toml
            ~/.cargo/.crates2.json
            ~/.cargo/bin
            ~/.cargo/registry/index
            ~/.cargo/registry/cache
            ~/.cargo/git/db
          key: '106-cargo-home-macos-x86_64-test-${{ matrix.test_crate }}-${{ github.sha }}'
      - name: Cache build output
        uses: actions/cache/save@v4
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && github.ref == ''refs/heads/main'''
        with:
          path: |-
            ./target
            !./target/*/gn_out
            !./target/*/gn_root
            !./target/*/*.zip
            !./target/*/*.tar.gz
          key: '106-cargo-target-macos-x86_64-debug-test-${{ matrix.test_crate }}-${{ github.sha }}'
  build-release-macos-x86_64:
    name: build release macos-x86_64
    needs:
      - pre_build
    if: needs.pre_build.outputs.skip_build != 'true'
    runs-on: '${{ !contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'' && ''ubuntu-24.04'' || ''macos-15-intel'' }}'
    environment:
      name: '${{ (github.ref == ''refs/heads/main'' || startsWith(github.ref, ''refs/tags/'')) && ''build'' || '''' }}'
    timeout-minutes: 240
    defaults:
      run:
        shell: bash
    env:
      CARGO_TERM_COLOR: always
      RUST_BACKTRACE: full
      RUST_LIB_BACKTRACE: 0
    steps:
      - name: Configure git
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'')'
        run: |-
          git config --global core.symlinks true
          git config --global fetch.parallel 32
      - name: Clone repository
        uses: actions/checkout@v6
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'')'
        with:
          fetch-depth: 5
          submodules: false
      - name: Clone submodule ./tests/util/std
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'')'
        run: git submodule update --init --recursive --depth=1 -- ./tests/util/std
      - name: Remove macOS cURL --ipv4 flag
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'')'
        run: |-
          curl --version
          which curl
          cat /etc/hosts
          rm ~/.curlrc || true
      - if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'''
        env:
          GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
        run: echo $GITHUB_WORKSPACE/third_party/prebuilt/mac >> $GITHUB_PATH
      - name: Install Deno
        uses: denoland/setup-deno@v2
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'''
        with:
          deno-version: v2.x
      - name: Restore cache cargo home
        uses: actions/cache/restore@v4
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && !startsWith(github.ref, ''refs/tags/'')'
        with:
          path: |-
            ~/.cargo/.crates.toml
            ~/.cargo/.crates2.json
            ~/.cargo/bin
            ~/.cargo/registry/index
            ~/.cargo/registry/cache
            ~/.cargo/git/db
          key: never_saved
          restore-keys: 106-cargo-home-macos-x86_64-build-main-
      - name: Restore cache build output
        uses: actions/cache/restore@v4
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.ref != ''refs/heads/main'' && !startsWith(github.ref, ''refs/tags/'')'
        with:
          path: |-
            ./target
            !./target/*/gn_out
            !./target/*/gn_root
            !./target/*/*.zip
            !./target/*/*.tar.gz
          key: never_saved
          restore-keys: 106-cargo-target-macos-x86_64-release-build-main-
      - name: Apply and update mtime cache
        uses: ./.github/mtime_cache
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'')'
        with:
          cache-path: ./target
      - uses: dsherret/rust-toolchain-file@v1
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'')'
      - name: Configure canary build
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'' && !startsWith(github.ref, ''refs/tags/'')'
        run: echo "DENO_CANARY=true" >> $GITHUB_ENV
      - name: Build release
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'''
        run: |-
          df -h
          cargo build --release --locked --bin deno --bin denort --bin test_server --features=panic-trace
          df -h
      - name: Generate symcache
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'''
        env:
          NO_COLOR: 1
        run: |-
          target/release/deno -A tools/release/create_symcache.ts ./deno.symcache
          du -h deno.symcache
          du -h target/release/deno
      - name: Install rust-codesign
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'''
        env:
          GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
        run: ./tools/install_prebuilt.js rcodesign
      - name: Pre-release (mac)
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'''
        env:
          APPLE_CODESIGN_KEY: '${{ secrets.APPLE_CODESIGN_KEY }}'
          APPLE_CODESIGN_PASSWORD: '${{ secrets.APPLE_CODESIGN_PASSWORD }}'
        run: |-
          target/release/deno -A tools/release/create_symcache.ts target/release/deno-x86_64-apple-darwin.symcache
          strip -x -S target/release/deno
          echo "Key is $(echo $APPLE_CODESIGN_KEY | base64 -d | wc -c) bytes"
          rcodesign sign target/release/deno --code-signature-flags=runtime --p12-password="$APPLE_CODESIGN_PASSWORD" --p12-file=<(echo $APPLE_CODESIGN_KEY | base64 -d) --entitlements-xml-file=cli/entitlements.plist
          cd target/release
          zip -r deno-x86_64-apple-darwin.zip deno
          shasum -a 256 deno-x86_64-apple-darwin.zip > deno-x86_64-apple-darwin.zip.sha256sum
          strip -x -S ./denort
          zip -r denort-x86_64-apple-darwin.zip denort
          shasum -a 256 denort-x86_64-apple-darwin.zip > denort-x86_64-apple-darwin.zip.sha256sum
      - name: Authenticate with Google Cloud
        uses: google-github-actions/auth@v3
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'' && (github.ref == ''refs/heads/main'' || startsWith(github.ref, ''refs/tags/''))'
        with:
          project_id: denoland
          credentials_json: '${{ secrets.GCP_SA_KEY }}'
          export_environment_variables: true
          create_credentials_file: true
      - name: Setup gcloud (unix)
        uses: google-github-actions/setup-gcloud@v3
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'' && (github.ref == ''refs/heads/main'' || startsWith(github.ref, ''refs/tags/''))'
        with:
          project_id: denoland
      - name: Log versions
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'')'
        run: |-
          echo '*** Python'
          command -v python && python --version || echo 'No python found or bad executable'
          echo '*** Rust'
          command -v rustc && rustc --version || echo 'No rustc found or bad executable'
          echo '*** Cargo'
          command -v cargo && cargo --version || echo 'No cargo found or bad executable'
          echo '*** Deno'
          command -v deno && deno --version || echo 'No deno found or bad executable'
          echo '*** Node'
          command -v node && node --version || echo 'No node found or bad executable'
          echo '*** Installed packages'
          command -v dpkg && dpkg -l || echo 'No dpkg found or bad executable'
      - name: Upload canary to dl.deno.land
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'' && github.ref == ''refs/heads/main'''
        env:
          AWS_ACCESS_KEY_ID: '${{ vars.S3_ACCESS_KEY_ID }}'
          AWS_SECRET_ACCESS_KEY: '${{ secrets.S3_SECRET_ACCESS_KEY }}'
          AWS_ENDPOINT_URL_S3: '${{ vars.S3_ENDPOINT }}'
          AWS_DEFAULT_REGION: '${{ vars.S3_REGION }}'
        run: |-
          gsutil -h "Cache-Control: public, max-age=3600" cp ./target/release/*.zip gs://dl.deno.land/canary/$(git rev-parse HEAD)/
          gsutil -h "Cache-Control: public, max-age=3600" cp ./target/release/*.sha256sum gs://dl.deno.land/canary/$(git rev-parse HEAD)/
          gsutil -h "Cache-Control: public, max-age=3600" cp ./target/release/*.symcache gs://dl.deno.land/canary/$(git rev-parse HEAD)/
          aws s3 sync ./target/release/ s3://dl-deno-land/canary/$(git rev-parse HEAD)/ --exclude "*" --include "*.zip"
          aws s3 sync ./target/release/ s3://dl-deno-land/canary/$(git rev-parse HEAD)/ --exclude "*" --include "*.sha256sum"
          aws s3 sync ./target/release/ s3://dl-deno-land/canary/$(git rev-parse HEAD)/ --exclude "*" --include "*.symcache"
          echo ${{ github.sha }} > canary-latest.txt
          gsutil -h "Cache-Control: no-cache" cp canary-latest.txt gs://dl.deno.land/canary-$(rustc -vV | sed -n "s|host: ||p")-latest.txt
          aws s3 cp canary-latest.txt s3://dl-deno-land/canary-$(rustc -vV | sed -n "s|host: ||p")-latest.txt
          rm canary-latest.txt gha-creds-*.json
      - name: Build product size info
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'' && (github.ref == ''refs/heads/main'' || startsWith(github.ref, ''refs/tags/''))'
        run: |-
          du -hd1 "./target/release"
          du -ha  "./target/release/deno"
          du -ha  "./target/release/denort"
      - name: Check deno binary
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'')'
        env:
          NO_COLOR: 1
        run: target/release/deno eval "console.log(1+2)" | grep 3
      - name: Upload artifact release-macos-x86_64-deno
        uses: actions/upload-artifact@v6
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'')'
        with:
          name: release-macos-x86_64-deno
          path: target/release/deno
          retention-days: 3
      - name: Upload artifact release-macos-x86_64-denort
        uses: actions/upload-artifact@v6
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'')'
        with:
          name: release-macos-x86_64-denort
          path: target/release/denort
          retention-days: 3
      - name: Upload artifact release-macos-x86_64-test-server
        uses: actions/upload-artifact@v6
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'')'
        with:
          name: release-macos-x86_64-test-server
          path: target/release/test_server
          retention-days: 3
      - name: Upload release to dl.deno.land (unix)
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'' && startsWith(github.ref, ''refs/tags/'')'
        env:
          AWS_ACCESS_KEY_ID: '${{ vars.S3_ACCESS_KEY_ID }}'
          AWS_SECRET_ACCESS_KEY: '${{ secrets.S3_SECRET_ACCESS_KEY }}'
          AWS_ENDPOINT_URL_S3: '${{ vars.S3_ENDPOINT }}'
          AWS_DEFAULT_REGION: '${{ vars.S3_REGION }}'
        run: |-
          gsutil -h "Cache-Control: public, max-age=3600" cp ./target/release/*.zip gs://dl.deno.land/release/${GITHUB_REF#refs/*/}/
          gsutil -h "Cache-Control: public, max-age=3600" cp ./target/release/*.sha256sum gs://dl.deno.land/release/${GITHUB_REF#refs/*/}/
          gsutil -h "Cache-Control: public, max-age=3600" cp ./target/release/*.symcache gs://dl.deno.land/release/${GITHUB_REF#refs/*/}/
          aws s3 sync ./target/release/ s3://dl-deno-land/release/${GITHUB_REF#refs/*/}/ --exclude "*" --include "*.zip"
          aws s3 sync ./target/release/ s3://dl-deno-land/release/${GITHUB_REF#refs/*/}/ --exclude "*" --include "*.sha256sum"
          aws s3 sync ./target/release/ s3://dl-deno-land/release/${GITHUB_REF#refs/*/}/ --exclude "*" --include "*.symcache"
      - name: Create release notes
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'' && startsWith(github.ref, ''refs/tags/'')'
        run: |-
          export PATH=$PATH:$(pwd)/target/release
          ./tools/release/05_create_release_notes.ts
      - name: Upload release to GitHub
        uses: softprops/action-gh-release@v2
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'' && startsWith(github.ref, ''refs/tags/'')'
        env:
          GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
        with:
          files: |-
            target/release/deno-x86_64-pc-windows-msvc.zip
            target/release/deno-x86_64-pc-windows-msvc.zip.sha256sum
            target/release/denort-x86_64-pc-windows-msvc.zip
            target/release/denort-x86_64-pc-windows-msvc.zip.sha256sum
            target/release/deno-aarch64-pc-windows-msvc.zip
            target/release/deno-aarch64-pc-windows-msvc.zip.sha256sum
            target/release/denort-aarch64-pc-windows-msvc.zip
            target/release/denort-aarch64-pc-windows-msvc.zip.sha256sum
            target/release/deno-x86_64-unknown-linux-gnu.zip
            target/release/deno-x86_64-unknown-linux-gnu.zip.sha256sum
            target/release/denort-x86_64-unknown-linux-gnu.zip
            target/release/denort-x86_64-unknown-linux-gnu.zip.sha256sum
            target/release/deno-x86_64-apple-darwin.zip
            target/release/deno-x86_64-apple-darwin.zip.sha256sum
            target/release/denort-x86_64-apple-darwin.zip
            target/release/denort-x86_64-apple-darwin.zip.sha256sum
            target/release/deno-aarch64-unknown-linux-gnu.zip
            target/release/deno-aarch64-unknown-linux-gnu.zip.sha256sum
            target/release/denort-aarch64-unknown-linux-gnu.zip
            target/release/denort-aarch64-unknown-linux-gnu.zip.sha256sum
            target/release/deno-aarch64-apple-darwin.zip
            target/release/deno-aarch64-apple-darwin.zip.sha256sum
            target/release/denort-aarch64-apple-darwin.zip
            target/release/denort-aarch64-apple-darwin.zip.sha256sum
            target/release/deno_src.tar.gz
            target/release/lib.deno.d.ts
          body_path: target/release/release-notes.md
          draft: true
  test-release-macos-x86_64:
    name: 'test ${{ matrix.test_crate }} ${{ matrix.shard_label }}release macos-x86_64'
    needs:
      - build-release-macos-x86_64
    runs-on: '${{ !contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'' && ''ubuntu-24.04'' || ''macos-15-intel'' }}'
    timeout-minutes: 30
    defaults:
      run:
        shell: bash
    strategy:
      matrix:
        include:
          - test_crate: integration
            test_package: integration_tests
            shard_index: '0'
            shard_total: '2'
            shard_label: '(1/2) '
          - test_crate: integration
            test_package: integration_tests
            shard_index: '1'
            shard_total: '2'
            shard_label: '(2/2) '
          - test_crate: node_compat
            test_package: node_compat_tests
            shard_index: '0'
            shard_total: '1'
            shard_label: ''
          - test_crate: specs
            test_package: specs_tests
            shard_index: '0'
            shard_total: '2'
            shard_label: '(1/2) '
          - test_crate: specs
            test_package: specs_tests
            shard_index: '1'
            shard_total: '2'
            shard_label: '(2/2) '
          - test_crate: unit
            test_package: unit_tests
            shard_index: '0'
            shard_total: '1'
            shard_label: ''
          - test_crate: unit_node
            test_package: unit_node_tests
            shard_index: '0'
            shard_total: '1'
            shard_label: ''
      fail-fast: false
    env:
      CARGO_TERM_COLOR: always
      RUST_BACKTRACE: full
      RUST_LIB_BACKTRACE: 0
    steps:
      - name: Configure git
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        run: |-
          git config --global core.symlinks true
          git config --global fetch.parallel 32
      - name: Clone repository
        uses: actions/checkout@v6
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        with:
          fetch-depth: 5
          submodules: false
      - name: Clone submodule ./tests/node_compat/runner/suite
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && matrix.test_crate == ''node_compat'''
        run: git submodule update --init --recursive --depth=1 -- ./tests/node_compat/runner/suite
      - name: Clone submodule ./tests/util/std
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        run: git submodule update --init --recursive --depth=1 -- ./tests/util/std
      - name: Restore cache cargo home
        uses: actions/cache/restore@v4
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        with:
          path: |-
            ~/.cargo/.crates.toml
            ~/.cargo/.crates2.json
            ~/.cargo/bin
            ~/.cargo/registry/index
            ~/.cargo/registry/cache
            ~/.cargo/git/db
          key: never_saved
          restore-keys: '106-cargo-home-macos-x86_64-test-${{ matrix.test_crate }}-'
      - name: Restore cache build output
        uses: actions/cache/restore@v4
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && github.ref != ''refs/heads/main'''
        with:
          path: |-
            ./target
            !./target/*/gn_out
            !./target/*/gn_root
            !./target/*/*.zip
            !./target/*/*.tar.gz
          key: never_saved
          restore-keys: '106-cargo-target-macos-x86_64-release-test-${{ matrix.test_crate }}-'
      - name: Apply and update mtime cache
        uses: ./.github/mtime_cache
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        with:
          cache-path: ./target
      - name: Install Node
        uses: actions/setup-node@v6
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        with:
          node-version: 22
      - uses: dsherret/rust-toolchain-file@v1
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
      - name: Download artifact release-macos-x86_64-deno
        uses: actions/download-artifact@v6
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        with:
          name: release-macos-x86_64-deno
          path: target/release
      - name: Set target/release/deno permissions
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        run: chmod +x target/release/deno
      - name: Download artifact release-macos-x86_64-denort
        uses: actions/download-artifact@v6
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && (matrix.test_crate == ''integration'' || matrix.test_crate == ''specs'')'
        with:
          name: release-macos-x86_64-denort
          path: target/release
      - name: Set target/release/denort permissions
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && (matrix.test_crate == ''integration'' || matrix.test_crate == ''specs'')'
        run: chmod +x target/release/denort
      - name: Download artifact release-macos-x86_64-test-server
        uses: actions/download-artifact@v6
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && (matrix.test_crate == ''integration'' || matrix.test_crate == ''specs'' || matrix.test_crate == ''unit'' || matrix.test_crate == ''unit_node'')'
        with:
          name: release-macos-x86_64-test-server
          path: target/release
      - name: Set target/release/test_server permissions
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && (matrix.test_crate == ''integration'' || matrix.test_crate == ''specs'' || matrix.test_crate == ''unit'' || matrix.test_crate == ''unit_node'')'
        run: chmod +x target/release/test_server
      - name: Set up playwright cache
        uses: actions/cache@v5
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        with:
          path: ./.ms-playwright
          key: 'playwright-${{ runner.os }}-${{ runner.arch }}'
      - name: Build ffi (release)
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && matrix.test_crate == ''specs'''
        run: cargo build --release -p test_ffi
      - name: Test (release)
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && github.repository == ''denoland/deno'''
        env:
          CI_SHARD_INDEX: '${{ github.event_name == ''pull_request'' && matrix.shard_index || '''' }}'
          CI_SHARD_TOTAL: '${{ github.event_name == ''pull_request'' && matrix.shard_total || '''' }}'
        run: 'cargo test -p ${{ matrix.test_package }} --test ${{ matrix.test_crate }} --release'
      - name: Ensure no git changes
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.event_name == ''pull_request'''
        run: "if [[ -n \"$(git status --porcelain)\" ]]; then\necho \"❌ Git working directory is dirty. Ensure `cargo test` is not modifying git tracked files.\"\necho \"\"\necho \"\U0001F4CB Status:\"\ngit status\necho \"\"\nexit 1\nfi"
      - name: Upload test results
        uses: actions/upload-artifact@v6
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && always()'
        with:
          name: 'test-results-macos-x86_64-release-${{ matrix.test_crate }}${{ matrix.shard_total > 1 && format(''-shard-{0}'', matrix.shard_index) || '''' }}.json'
          path: 'target/test_results_${{ matrix.test_crate }}.json'
  build-debug-macos-aarch64:
    name: build debug macos-aarch64
    needs:
      - pre_build
    if: needs.pre_build.outputs.skip_build != 'true'
    runs-on: macos-14
    environment:
      name: '${{ (github.ref == ''refs/heads/main'' || startsWith(github.ref, ''refs/tags/'')) && ''build'' || '''' }}'
    timeout-minutes: 240
    defaults:
      run:
        shell: bash
    env:
      CARGO_TERM_COLOR: always
      RUST_BACKTRACE: full
      RUST_LIB_BACKTRACE: 0
    steps:
      - name: Configure git
        run: |-
          git config --global core.symlinks true
          git config --global fetch.parallel 32
      - name: Clone repository
        uses: actions/checkout@v6
        with:
          fetch-depth: 5
          submodules: false
      - name: Clone submodule ./tests/util/std
        run: git submodule update --init --recursive --depth=1 -- ./tests/util/std
      - name: Remove macOS cURL --ipv4 flag
        run: |-
          curl --version
          which curl
          cat /etc/hosts
          rm ~/.curlrc || true
      - env:
          GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
        run: echo $GITHUB_WORKSPACE/third_party/prebuilt/mac >> $GITHUB_PATH
      - name: Install Deno
        uses: denoland/setup-deno@v2
        with:
          deno-version: v2.x
      - name: Install macOS aarch64 lld
        env:
          GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
        run: ./tools/install_prebuilt.js ld64.lld
      - name: Restore cache cargo home
        uses: actions/cache/restore@v4
        if: '!startsWith(github.ref, ''refs/tags/'')'
        with:
          path: |-
            ~/.cargo/.crates.toml
            ~/.cargo/.crates2.json
            ~/.cargo/bin
            ~/.cargo/registry/index
            ~/.cargo/registry/cache
            ~/.cargo/git/db
          key: never_saved
          restore-keys: 106-cargo-home-macos-aarch64-build-main-
      - name: Restore cache build output
        uses: actions/cache/restore@v4
        if: 'github.ref != ''refs/heads/main'' && !startsWith(github.ref, ''refs/tags/'')'
        with:
          path: |-
            ./target
            !./target/*/gn_out
            !./target/*/gn_root
            !./target/*/*.zip
            !./target/*/*.tar.gz
          key: never_saved
          restore-keys: 106-cargo-target-macos-aarch64-debug-build-main-
      - name: Apply and update mtime cache
        uses: ./.github/mtime_cache
        with:
          cache-path: ./target
      - uses: dsherret/rust-toolchain-file@v1
      - name: Build debug
        env:
          CARGO_PROFILE_DEV_DEBUG: 0
        run: cargo build --locked --bin deno --bin denort --bin test_server --features=panic-trace
      - name: Log versions
        run: |-
          echo '*** Python'
          command -v python && python --version || echo 'No python found or bad executable'
          echo '*** Rust'
          command -v rustc && rustc --version || echo 'No rustc found or bad executable'
          echo '*** Cargo'
          command -v cargo && cargo --version || echo 'No cargo found or bad executable'
          echo '*** Deno'
          command -v deno && deno --version || echo 'No deno found or bad executable'
          echo '*** Node'
          command -v node && node --version || echo 'No node found or bad executable'
          echo '*** Installed packages'
          command -v dpkg && dpkg -l || echo 'No dpkg found or bad executable'
      - name: Check deno binary
        env:
          NO_COLOR: 1
        run: target/debug/deno eval "console.log(1+2)" | grep 3
      - name: Upload artifact debug-macos-aarch64-deno
        uses: actions/upload-artifact@v6
        with:
          name: debug-macos-aarch64-deno
          path: target/debug/deno
          retention-days: 3
      - name: Upload artifact debug-macos-aarch64-denort
        uses: actions/upload-artifact@v6
        with:
          name: debug-macos-aarch64-denort
          path: target/debug/denort
          retention-days: 3
      - name: Upload artifact debug-macos-aarch64-test-server
        uses: actions/upload-artifact@v6
        with:
          name: debug-macos-aarch64-test-server
          path: target/debug/test_server
          retention-days: 3
      - name: Cache cargo home
        uses: actions/cache/save@v4
        if: 'github.ref == ''refs/heads/main'' && !startsWith(github.ref, ''refs/tags/'')'
        with:
          path: |-
            ~/.cargo/.crates.toml
            ~/.cargo/.crates2.json
            ~/.cargo/bin
            ~/.cargo/registry/index
            ~/.cargo/registry/cache
            ~/.cargo/git/db
          key: '106-cargo-home-macos-aarch64-build-main-${{ github.sha }}'
      - name: Cache build output
        uses: actions/cache/save@v4
        if: 'github.ref == ''refs/heads/main'' && !startsWith(github.ref, ''refs/tags/'')'
        with:
          path: |-
            ./target
            !./target/*/gn_out
            !./target/*/gn_root
            !./target/*/*.zip
            !./target/*/*.tar.gz
          key: '106-cargo-target-macos-aarch64-debug-build-main-${{ github.sha }}'
  test-debug-macos-aarch64:
    name: 'test ${{ matrix.test_crate }} ${{ matrix.shard_label }}debug macos-aarch64'
    needs:
      - build-debug-macos-aarch64
    runs-on: macos-14
    timeout-minutes: 30
    defaults:
      run:
        shell: bash
    strategy:
      matrix:
        include:
          - test_crate: integration
            test_package: integration_tests
            shard_index: '0'
            shard_total: '2'
            shard_label: '(1/2) '
          - test_crate: integration
            test_package: integration_tests
            shard_index: '1'
            shard_total: '2'
            shard_label: '(2/2) '
          - test_crate: node_compat
            test_package: node_compat_tests
            shard_index: '0'
            shard_total: '1'
            shard_label: ''
          - test_crate: specs
            test_package: specs_tests
            shard_index: '0'
            shard_total: '2'
            shard_label: '(1/2) '
          - test_crate: specs
            test_package: specs_tests
            shard_index: '1'
            shard_total: '2'
            shard_label: '(2/2) '
          - test_crate: unit
            test_package: unit_tests
            shard_index: '0'
            shard_total: '1'
            shard_label: ''
          - test_crate: unit_node
            test_package: unit_node_tests
            shard_index: '0'
            shard_total: '1'
            shard_label: ''
      fail-fast: false
    env:
      CARGO_TERM_COLOR: always
      RUST_BACKTRACE: full
      RUST_LIB_BACKTRACE: 0
    steps:
      - name: Configure git
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        run: |-
          git config --global core.symlinks true
          git config --global fetch.parallel 32
      - name: Clone repository
        uses: actions/checkout@v6
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        with:
          fetch-depth: 5
          submodules: false
      - name: Clone submodule ./tests/node_compat/runner/suite
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && matrix.test_crate == ''node_compat'''
        run: git submodule update --init --recursive --depth=1 -- ./tests/node_compat/runner/suite
      - name: Clone submodule ./tests/util/std
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        run: git submodule update --init --recursive --depth=1 -- ./tests/util/std
      - name: Restore cache cargo home
        uses: actions/cache/restore@v4
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        with:
          path: |-
            ~/.cargo/.crates.toml
            ~/.cargo/.crates2.json
            ~/.cargo/bin
            ~/.cargo/registry/index
            ~/.cargo/registry/cache
            ~/.cargo/git/db
          key: never_saved
          restore-keys: '106-cargo-home-macos-aarch64-test-${{ matrix.test_crate }}-'
      - name: Restore cache build output
        uses: actions/cache/restore@v4
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && github.ref != ''refs/heads/main'''
        with:
          path: |-
            ./target
            !./target/*/gn_out
            !./target/*/gn_root
            !./target/*/*.zip
            !./target/*/*.tar.gz
          key: never_saved
          restore-keys: '106-cargo-target-macos-aarch64-debug-test-${{ matrix.test_crate }}-'
      - name: Apply and update mtime cache
        uses: ./.github/mtime_cache
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        with:
          cache-path: ./target
      - name: Install Node
        uses: actions/setup-node@v6
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        with:
          node-version: 22
      - uses: dsherret/rust-toolchain-file@v1
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
      - name: Install Deno
        uses: denoland/setup-deno@v2
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        with:
          deno-version: v2.x
      - if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        env:
          GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
        run: echo $GITHUB_WORKSPACE/third_party/prebuilt/mac >> $GITHUB_PATH
      - name: Install macOS aarch64 lld
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        env:
          GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
        run: ./tools/install_prebuilt.js ld64.lld
      - name: Download artifact debug-macos-aarch64-deno
        uses: actions/download-artifact@v6
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        with:
          name: debug-macos-aarch64-deno
          path: target/debug
      - name: Set target/debug/deno permissions
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        run: chmod +x target/debug/deno
      - name: Download artifact debug-macos-aarch64-denort
        uses: actions/download-artifact@v6
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && (matrix.test_crate == ''integration'' || matrix.test_crate == ''specs'')'
        with:
          name: debug-macos-aarch64-denort
          path: target/debug
      - name: Set target/debug/denort permissions
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && (matrix.test_crate == ''integration'' || matrix.test_crate == ''specs'')'
        run: chmod +x target/debug/denort
      - name: Download artifact debug-macos-aarch64-test-server
        uses: actions/download-artifact@v6
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && (matrix.test_crate == ''integration'' || matrix.test_crate == ''specs'' || matrix.test_crate == ''unit'' || matrix.test_crate == ''unit_node'')'
        with:
          name: debug-macos-aarch64-test-server
          path: target/debug
      - name: Set target/debug/test_server permissions
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && (matrix.test_crate == ''integration'' || matrix.test_crate == ''specs'' || matrix.test_crate == ''unit'' || matrix.test_crate == ''unit_node'')'
        run: chmod +x target/debug/test_server
      - name: Set up playwright cache
        uses: actions/cache@v5
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        with:
          path: ./.ms-playwright
          key: 'playwright-${{ runner.os }}-${{ runner.arch }}'
      - name: Build ffi (debug)
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && matrix.test_crate == ''specs'''
        run: cargo build -p test_ffi
      - name: Test (debug)
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        env:
          CARGO_PROFILE_DEV_DEBUG: 0
          CI_SHARD_INDEX: '${{ github.event_name == ''pull_request'' && matrix.shard_index || '''' }}'
          CI_SHARD_TOTAL: '${{ github.event_name == ''pull_request'' && matrix.shard_total || '''' }}'
        run: 'cargo test -p ${{ matrix.test_package }} --test ${{ matrix.test_crate }}'
      - name: Ensure no git changes
        if: '!startsWith(github.ref, ''refs/tags/'') && github.event_name == ''pull_request'''
        run: "if [[ -n \"$(git status --porcelain)\" ]]; then\necho \"❌ Git working directory is dirty. Ensure `cargo test` is not modifying git tracked files.\"\necho \"\"\necho \"\U0001F4CB Status:\"\ngit status\necho \"\"\nexit 1\nfi"
      - name: Upload test results
        uses: actions/upload-artifact@v6
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && always()'
        with:
          name: 'test-results-macos-aarch64-debug-${{ matrix.test_crate }}${{ matrix.shard_total > 1 && format(''-shard-{0}'', matrix.shard_index) || '''' }}.json'
          path: 'target/test_results_${{ matrix.test_crate }}.json'
      - name: Cache cargo home
        uses: actions/cache/save@v4
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && github.ref == ''refs/heads/main'''
        with:
          path: |-
            ~/.cargo/.crates.toml
            ~/.cargo/.crates2.json
            ~/.cargo/bin
            ~/.cargo/registry/index
            ~/.cargo/registry/cache
            ~/.cargo/git/db
          key: '106-cargo-home-macos-aarch64-test-${{ matrix.test_crate }}-${{ github.sha }}'
      - name: Cache build output
        uses: actions/cache/save@v4
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && github.ref == ''refs/heads/main'''
        with:
          path: |-
            ./target
            !./target/*/gn_out
            !./target/*/gn_root
            !./target/*/*.zip
            !./target/*/*.tar.gz
          key: '106-cargo-target-macos-aarch64-debug-test-${{ matrix.test_crate }}-${{ github.sha }}'
  test-libs-debug-macos-aarch64:
    name: test libs debug macos-aarch64
    needs:
      - build-debug-macos-aarch64
    runs-on: macos-14
    timeout-minutes: 30
    steps:
      - name: Configure git
        if: '!startsWith(github.ref, ''refs/tags/'')'
        run: |-
          git config --global core.symlinks true
          git config --global fetch.parallel 32
      - name: Clone repository
        uses: actions/checkout@v6
        if: '!startsWith(github.ref, ''refs/tags/'')'
        with:
          fetch-depth: 5
          submodules: false
      - name: Restore cache cargo home
        uses: actions/cache/restore@v4
        if: '!startsWith(github.ref, ''refs/tags/'')'
        with:
          path: |-
            ~/.cargo/.crates.toml
            ~/.cargo/.crates2.json
            ~/.cargo/bin
            ~/.cargo/registry/index
            ~/.cargo/registry/cache
            ~/.cargo/git/db
          key: never_saved
          restore-keys: 106-cargo-home-macos-aarch64-test-libs-
      - name: Restore cache build output
        uses: actions/cache/restore@v4
        if: '!startsWith(github.ref, ''refs/tags/'') && github.ref != ''refs/heads/main'''
        with:
          path: |-
            ./target
            !./target/*/gn_out
            !./target/*/gn_root
            !./target/*/*.zip
            !./target/*/*.tar.gz
          key: never_saved
          restore-keys: 106-cargo-target-macos-aarch64-debug-test-libs-
      - name: Apply and update mtime cache
        uses: ./.github/mtime_cache
        if: '!startsWith(github.ref, ''refs/tags/'')'
        with:
          cache-path: ./target
      - name: Install Node
        uses: actions/setup-node@v6
        if: '!startsWith(github.ref, ''refs/tags/'')'
        with:
          node-version: 22
      - uses: dsherret/rust-toolchain-file@v1
        if: '!startsWith(github.ref, ''refs/tags/'')'
      - name: Clone submodule ./tests/util/std
        if: '!startsWith(github.ref, ''refs/tags/'')'
        run: git submodule update --init --recursive --depth=1 -- ./tests/util/std
      - name: Install Deno
        uses: denoland/setup-deno@v2
        if: '!startsWith(github.ref, ''refs/tags/'')'
        with:
          deno-version: v2.x
      - if: '!startsWith(github.ref, ''refs/tags/'')'
        env:
          GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
        run: echo $GITHUB_WORKSPACE/third_party/prebuilt/mac >> $GITHUB_PATH
      - name: Install macOS aarch64 lld
        if: '!startsWith(github.ref, ''refs/tags/'')'
        env:
          GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
        run: ./tools/install_prebuilt.js ld64.lld
      - name: Download artifact debug-macos-aarch64-deno
        uses: actions/download-artifact@v6
        if: '!startsWith(github.ref, ''refs/tags/'')'
        with:
          name: debug-macos-aarch64-deno
          path: target/debug
      - name: Set target/debug/deno permissions
        if: '!startsWith(github.ref, ''refs/tags/'')'
        run: chmod +x target/debug/deno
      - name: Download artifact debug-macos-aarch64-test-server
        uses: actions/download-artifact@v6
        if: '!startsWith(github.ref, ''refs/tags/'')'
        with:
          name: debug-macos-aarch64-test-server
          path: target/debug
      - name: Set target/debug/test_server permissions
        if: '!startsWith(github.ref, ''refs/tags/'')'
        run: chmod +x target/debug/test_server
      - name: Test libs
        if: '!startsWith(github.ref, ''refs/tags/'')'
        env:
          CARGO_PROFILE_DEV_DEBUG: 0
        run: cargo test --locked --lib -p deno -p denort -p node_shim -p deno_lib -p deno_snapshots -p deno_bundle_runtime -p deno_cache -p deno_cron -p deno_crypto -p deno_fetch -p deno_ffi -p deno_fs -p deno_http -p deno_image -p deno_io -p deno_kv -p deno_napi -p napi_sym -p deno_net -p deno_node -p deno_node_crypto -p deno_node_sqlite -p denort_helper -p deno_signals -p deno_telemetry -p deno_url -p deno_web -p deno_webgpu -p deno_webidl -p deno_websocket -p deno_webstorage -p deno_cache_dir -p deno_config -p deno_crypto_provider -p deno_dotenv -p eszip -p deno_inspector_server -p deno_lockfile -p deno_maybe_sync -p napi_sys -p node_resolver -p deno_npm -p deno_npm_cache -p deno_npm_installer -p deno_npmrc -p deno_package_json -p deno_resolver -p deno_typescript_go_client_rust -p deno_runtime -p deno_features -p deno_permissions -p deno_subprocess_windows
      - name: Cache cargo home
        uses: actions/cache/save@v4
        if: '!startsWith(github.ref, ''refs/tags/'') && github.ref == ''refs/heads/main'''
        with:
          path: |-
            ~/.cargo/.crates.toml
            ~/.cargo/.crates2.json
            ~/.cargo/bin
            ~/.cargo/registry/index
            ~/.cargo/registry/cache
            ~/.cargo/git/db
          key: '106-cargo-home-macos-aarch64-test-libs-${{ github.sha }}'
      - name: Cache build output
        uses: actions/cache/save@v4
        if: '!startsWith(github.ref, ''refs/tags/'') && github.ref == ''refs/heads/main'''
        with:
          path: |-
            ./target
            !./target/*/gn_out
            !./target/*/gn_root
            !./target/*/*.zip
            !./target/*/*.tar.gz
          key: '106-cargo-target-macos-aarch64-debug-test-libs-${{ github.sha }}'
  build-release-macos-aarch64:
    name: build release macos-aarch64
    needs:
      - pre_build
    if: needs.pre_build.outputs.skip_build != 'true'
    runs-on: '${{ !contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'' && ''ubuntu-24.04'' || ''macos-14'' }}'
    environment:
      name: '${{ (github.ref == ''refs/heads/main'' || startsWith(github.ref, ''refs/tags/'')) && ''build'' || '''' }}'
    timeout-minutes: 240
    defaults:
      run:
        shell: bash
    env:
      CARGO_TERM_COLOR: always
      RUST_BACKTRACE: full
      RUST_LIB_BACKTRACE: 0
    steps:
      - name: Configure git
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'')'
        run: |-
          git config --global core.symlinks true
          git config --global fetch.parallel 32
      - name: Clone repository
        uses: actions/checkout@v6
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'')'
        with:
          fetch-depth: 5
          submodules: false
      - name: Clone submodule ./tests/util/std
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'')'
        run: git submodule update --init --recursive --depth=1 -- ./tests/util/std
      - name: Remove macOS cURL --ipv4 flag
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'')'
        run: |-
          curl --version
          which curl
          cat /etc/hosts
          rm ~/.curlrc || true
      - if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'')'
        env:
          GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
        run: echo $GITHUB_WORKSPACE/third_party/prebuilt/mac >> $GITHUB_PATH
      - name: Install Deno
        uses: denoland/setup-deno@v2
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'')'
        with:
          deno-version: v2.x
      - name: Install macOS aarch64 lld
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'')'
        env:
          GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
        run: ./tools/install_prebuilt.js ld64.lld
      - name: Restore cache cargo home
        uses: actions/cache/restore@v4
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && !startsWith(github.ref, ''refs/tags/'')'
        with:
          path: |-
            ~/.cargo/.crates.toml
            ~/.cargo/.crates2.json
            ~/.cargo/bin
            ~/.cargo/registry/index
            ~/.cargo/registry/cache
            ~/.cargo/git/db
          key: never_saved
          restore-keys: 106-cargo-home-macos-aarch64-build-main-
      - name: Restore cache build output
        uses: actions/cache/restore@v4
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.ref != ''refs/heads/main'' && !startsWith(github.ref, ''refs/tags/'')'
        with:
          path: |-
            ./target
            !./target/*/gn_out
            !./target/*/gn_root
            !./target/*/*.zip
            !./target/*/*.tar.gz
          key: never_saved
          restore-keys: 106-cargo-target-macos-aarch64-release-build-main-
      - name: Apply and update mtime cache
        uses: ./.github/mtime_cache
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'')'
        with:
          cache-path: ./target
      - uses: dsherret/rust-toolchain-file@v1
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'')'
      - name: Configure canary build
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'' && !startsWith(github.ref, ''refs/tags/'')'
        run: echo "DENO_CANARY=true" >> $GITHUB_ENV
      - name: Build release
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'''
        run: |-
          df -h
          cargo build --release --locked --bin deno --bin denort --bin test_server --features=panic-trace
          df -h
      - name: Generate symcache
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'''
        env:
          NO_COLOR: 1
        run: |-
          target/release/deno -A tools/release/create_symcache.ts ./deno.symcache
          du -h deno.symcache
          du -h target/release/deno
      - name: Install rust-codesign
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'''
        env:
          GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
        run: ./tools/install_prebuilt.js rcodesign
      - name: Pre-release (mac)
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'''
        env:
          APPLE_CODESIGN_KEY: '${{ secrets.APPLE_CODESIGN_KEY }}'
          APPLE_CODESIGN_PASSWORD: '${{ secrets.APPLE_CODESIGN_PASSWORD }}'
        run: |-
          target/release/deno -A tools/release/create_symcache.ts target/release/deno-aarch64-apple-darwin.symcache
          strip -x -S target/release/deno
          echo "Key is $(echo $APPLE_CODESIGN_KEY | base64 -d | wc -c) bytes"
          rcodesign sign target/release/deno --code-signature-flags=runtime --p12-password="$APPLE_CODESIGN_PASSWORD" --p12-file=<(echo $APPLE_CODESIGN_KEY | base64 -d) --entitlements-xml-file=cli/entitlements.plist
          cd target/release
          zip -r deno-aarch64-apple-darwin.zip deno
          shasum -a 256 deno-aarch64-apple-darwin.zip > deno-aarch64-apple-darwin.zip.sha256sum
          strip -x -S ./denort
          zip -r denort-aarch64-apple-darwin.zip denort
          shasum -a 256 denort-aarch64-apple-darwin.zip > denort-aarch64-apple-darwin.zip.sha256sum
      - name: Authenticate with Google Cloud
        uses: google-github-actions/auth@v3
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'' && (github.ref == ''refs/heads/main'' || startsWith(github.ref, ''refs/tags/''))'
        with:
          project_id: denoland
          credentials_json: '${{ secrets.GCP_SA_KEY }}'
          export_environment_variables: true
          create_credentials_file: true
      - name: Setup gcloud (unix)
        uses: google-github-actions/setup-gcloud@v3
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'' && (github.ref == ''refs/heads/main'' || startsWith(github.ref, ''refs/tags/''))'
        with:
          project_id: denoland
      - name: Log versions
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'')'
        run: |-
          echo '*** Python'
          command -v python && python --version || echo 'No python found or bad executable'
          echo '*** Rust'
          command -v rustc && rustc --version || echo 'No rustc found or bad executable'
          echo '*** Cargo'
          command -v cargo && cargo --version || echo 'No cargo found or bad executable'
          echo '*** Deno'
          command -v deno && deno --version || echo 'No deno found or bad executable'
          echo '*** Node'
          command -v node && node --version || echo 'No node found or bad executable'
          echo '*** Installed packages'
          command -v dpkg && dpkg -l || echo 'No dpkg found or bad executable'
      - name: Upload canary to dl.deno.land
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'' && github.ref == ''refs/heads/main'''
        env:
          AWS_ACCESS_KEY_ID: '${{ vars.S3_ACCESS_KEY_ID }}'
          AWS_SECRET_ACCESS_KEY: '${{ secrets.S3_SECRET_ACCESS_KEY }}'
          AWS_ENDPOINT_URL_S3: '${{ vars.S3_ENDPOINT }}'
          AWS_DEFAULT_REGION: '${{ vars.S3_REGION }}'
        run: |-
          gsutil -h "Cache-Control: public, max-age=3600" cp ./target/release/*.zip gs://dl.deno.land/canary/$(git rev-parse HEAD)/
          gsutil -h "Cache-Control: public, max-age=3600" cp ./target/release/*.sha256sum gs://dl.deno.land/canary/$(git rev-parse HEAD)/
          gsutil -h "Cache-Control: public, max-age=3600" cp ./target/release/*.symcache gs://dl.deno.land/canary/$(git rev-parse HEAD)/
          aws s3 sync ./target/release/ s3://dl-deno-land/canary/$(git rev-parse HEAD)/ --exclude "*" --include "*.zip"
          aws s3 sync ./target/release/ s3://dl-deno-land/canary/$(git rev-parse HEAD)/ --exclude "*" --include "*.sha256sum"
          aws s3 sync ./target/release/ s3://dl-deno-land/canary/$(git rev-parse HEAD)/ --exclude "*" --include "*.symcache"
          echo ${{ github.sha }} > canary-latest.txt
          gsutil -h "Cache-Control: no-cache" cp canary-latest.txt gs://dl.deno.land/canary-$(rustc -vV | sed -n "s|host: ||p")-latest.txt
          aws s3 cp canary-latest.txt s3://dl-deno-land/canary-$(rustc -vV | sed -n "s|host: ||p")-latest.txt
          rm canary-latest.txt gha-creds-*.json
      - name: Build product size info
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'' && (github.ref == ''refs/heads/main'' || startsWith(github.ref, ''refs/tags/''))'
        run: |-
          du -hd1 "./target/release"
          du -ha  "./target/release/deno"
          du -ha  "./target/release/denort"
      - name: Check deno binary
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'')'
        env:
          NO_COLOR: 1
        run: target/release/deno eval "console.log(1+2)" | grep 3
      - name: Upload artifact release-macos-aarch64-deno
        uses: actions/upload-artifact@v6
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'')'
        with:
          name: release-macos-aarch64-deno
          path: target/release/deno
          retention-days: 3
      - name: Upload artifact release-macos-aarch64-denort
        uses: actions/upload-artifact@v6
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'')'
        with:
          name: release-macos-aarch64-denort
          path: target/release/denort
          retention-days: 3
      - name: Upload artifact release-macos-aarch64-test-server
        uses: actions/upload-artifact@v6
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'')'
        with:
          name: release-macos-aarch64-test-server
          path: target/release/test_server
          retention-days: 3
      - name: Upload release to dl.deno.land (unix)
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'' && startsWith(github.ref, ''refs/tags/'')'
        env:
          AWS_ACCESS_KEY_ID: '${{ vars.S3_ACCESS_KEY_ID }}'
          AWS_SECRET_ACCESS_KEY: '${{ secrets.S3_SECRET_ACCESS_KEY }}'
          AWS_ENDPOINT_URL_S3: '${{ vars.S3_ENDPOINT }}'
          AWS_DEFAULT_REGION: '${{ vars.S3_REGION }}'
        run: |-
          gsutil -h "Cache-Control: public, max-age=3600" cp ./target/release/*.zip gs://dl.deno.land/release/${GITHUB_REF#refs/*/}/
          gsutil -h "Cache-Control: public, max-age=3600" cp ./target/release/*.sha256sum gs://dl.deno.land/release/${GITHUB_REF#refs/*/}/
          gsutil -h "Cache-Control: public, max-age=3600" cp ./target/release/*.symcache gs://dl.deno.land/release/${GITHUB_REF#refs/*/}/
          aws s3 sync ./target/release/ s3://dl-deno-land/release/${GITHUB_REF#refs/*/}/ --exclude "*" --include "*.zip"
          aws s3 sync ./target/release/ s3://dl-deno-land/release/${GITHUB_REF#refs/*/}/ --exclude "*" --include "*.sha256sum"
          aws s3 sync ./target/release/ s3://dl-deno-land/release/${GITHUB_REF#refs/*/}/ --exclude "*" --include "*.symcache"
      - name: Create release notes
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'' && startsWith(github.ref, ''refs/tags/'')'
        run: |-
          export PATH=$PATH:$(pwd)/target/release
          ./tools/release/05_create_release_notes.ts
      - name: Upload release to GitHub
        uses: softprops/action-gh-release@v2
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'' && startsWith(github.ref, ''refs/tags/'')'
        env:
          GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
        with:
          files: |-
            target/release/deno-x86_64-pc-windows-msvc.zip
            target/release/deno-x86_64-pc-windows-msvc.zip.sha256sum
            target/release/denort-x86_64-pc-windows-msvc.zip
            target/release/denort-x86_64-pc-windows-msvc.zip.sha256sum
            target/release/deno-aarch64-pc-windows-msvc.zip
            target/release/deno-aarch64-pc-windows-msvc.zip.sha256sum
            target/release/denort-aarch64-pc-windows-msvc.zip
            target/release/denort-aarch64-pc-windows-msvc.zip.sha256sum
            target/release/deno-x86_64-unknown-linux-gnu.zip
            target/release/deno-x86_64-unknown-linux-gnu.zip.sha256sum
            target/release/denort-x86_64-unknown-linux-gnu.zip
            target/release/denort-x86_64-unknown-linux-gnu.zip.sha256sum
            target/release/deno-x86_64-apple-darwin.zip
            target/release/deno-x86_64-apple-darwin.zip.sha256sum
            target/release/denort-x86_64-apple-darwin.zip
            target/release/denort-x86_64-apple-darwin.zip.sha256sum
            target/release/deno-aarch64-unknown-linux-gnu.zip
            target/release/deno-aarch64-unknown-linux-gnu.zip.sha256sum
            target/release/denort-aarch64-unknown-linux-gnu.zip
            target/release/denort-aarch64-unknown-linux-gnu.zip.sha256sum
            target/release/deno-aarch64-apple-darwin.zip
            target/release/deno-aarch64-apple-darwin.zip.sha256sum
            target/release/denort-aarch64-apple-darwin.zip
            target/release/denort-aarch64-apple-darwin.zip.sha256sum
            target/release/deno_src.tar.gz
            target/release/lib.deno.d.ts
          body_path: target/release/release-notes.md
          draft: true
  test-release-macos-aarch64:
    name: 'test ${{ matrix.test_crate }} ${{ matrix.shard_label }}release macos-aarch64'
    needs:
      - build-release-macos-aarch64
    runs-on: '${{ !contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'' && ''ubuntu-24.04'' || ''macos-14'' }}'
    timeout-minutes: 30
    defaults:
      run:
        shell: bash
    strategy:
      matrix:
        include:
          - test_crate: integration
            test_package: integration_tests
            shard_index: '0'
            shard_total: '2'
            shard_label: '(1/2) '
          - test_crate: integration
            test_package: integration_tests
            shard_index: '1'
            shard_total: '2'
            shard_label: '(2/2) '
          - test_crate: node_compat
            test_package: node_compat_tests
            shard_index: '0'
            shard_total: '1'
            shard_label: ''
          - test_crate: specs
            test_package: specs_tests
            shard_index: '0'
            shard_total: '2'
            shard_label: '(1/2) '
          - test_crate: specs
            test_package: specs_tests
            shard_index: '1'
            shard_total: '2'
            shard_label: '(2/2) '
          - test_crate: unit
            test_package: unit_tests
            shard_index: '0'
            shard_total: '1'
            shard_label: ''
          - test_crate: unit_node
            test_package: unit_node_tests
            shard_index: '0'
            shard_total: '1'
            shard_label: ''
      fail-fast: false
    env:
      CARGO_TERM_COLOR: always
      RUST_BACKTRACE: full
      RUST_LIB_BACKTRACE: 0
    steps:
      - name: Configure git
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        run: |-
          git config --global core.symlinks true
          git config --global fetch.parallel 32
      - name: Clone repository
        uses: actions/checkout@v6
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        with:
          fetch-depth: 5
          submodules: false
      - name: Clone submodule ./tests/node_compat/runner/suite
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && matrix.test_crate == ''node_compat'''
        run: git submodule update --init --recursive --depth=1 -- ./tests/node_compat/runner/suite
      - name: Clone submodule ./tests/util/std
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        run: git submodule update --init --recursive --depth=1 -- ./tests/util/std
      - name: Restore cache cargo home
        uses: actions/cache/restore@v4
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        with:
          path: |-
            ~/.cargo/.crates.toml
            ~/.cargo/.crates2.json
            ~/.cargo/bin
            ~/.cargo/registry/index
            ~/.cargo/registry/cache
            ~/.cargo/git/db
          key: never_saved
          restore-keys: '106-cargo-home-macos-aarch64-test-${{ matrix.test_crate }}-'
      - name: Restore cache build output
        uses: actions/cache/restore@v4
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && github.ref != ''refs/heads/main'''
        with:
          path: |-
            ./target
            !./target/*/gn_out
            !./target/*/gn_root
            !./target/*/*.zip
            !./target/*/*.tar.gz
          key: never_saved
          restore-keys: '106-cargo-target-macos-aarch64-release-test-${{ matrix.test_crate }}-'
      - name: Apply and update mtime cache
        uses: ./.github/mtime_cache
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        with:
          cache-path: ./target
      - name: Install Node
        uses: actions/setup-node@v6
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        with:
          node-version: 22
      - uses: dsherret/rust-toolchain-file@v1
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
      - name: Install Deno
        uses: denoland/setup-deno@v2
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        with:
          deno-version: v2.x
      - if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        env:
          GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
        run: echo $GITHUB_WORKSPACE/third_party/prebuilt/mac >> $GITHUB_PATH
      - name: Install macOS aarch64 lld
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        env:
          GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
        run: ./tools/install_prebuilt.js ld64.lld
      - name: Download artifact release-macos-aarch64-deno
        uses: actions/download-artifact@v6
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        with:
          name: release-macos-aarch64-deno
          path: target/release
      - name: Set target/release/deno permissions
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        run: chmod +x target/release/deno
      - name: Download artifact release-macos-aarch64-denort
        uses: actions/download-artifact@v6
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && (matrix.test_crate == ''integration'' || matrix.test_crate == ''specs'')'
        with:
          name: release-macos-aarch64-denort
          path: target/release
      - name: Set target/release/denort permissions
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && (matrix.test_crate == ''integration'' || matrix.test_crate == ''specs'')'
        run: chmod +x target/release/denort
      - name: Download artifact release-macos-aarch64-test-server
        uses: actions/download-artifact@v6
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && (matrix.test_crate == ''integration'' || matrix.test_crate == ''specs'' || matrix.test_crate == ''unit'' || matrix.test_crate == ''unit_node'')'
        with:
          name: release-macos-aarch64-test-server
          path: target/release
      - name: Set target/release/test_server permissions
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && (matrix.test_crate == ''integration'' || matrix.test_crate == ''specs'' || matrix.test_crate == ''unit'' || matrix.test_crate == ''unit_node'')'
        run: chmod +x target/release/test_server
      - name: Set up playwright cache
        uses: actions/cache@v5
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        with:
          path: ./.ms-playwright
          key: 'playwright-${{ runner.os }}-${{ runner.arch }}'
      - name: Build ffi (release)
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && matrix.test_crate == ''specs'''
        run: cargo build --release -p test_ffi
      - name: Test (release)
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && github.repository == ''denoland/deno'''
        env:
          CI_SHARD_INDEX: '${{ github.event_name == ''pull_request'' && matrix.shard_index || '''' }}'
          CI_SHARD_TOTAL: '${{ github.event_name == ''pull_request'' && matrix.shard_total || '''' }}'
        run: 'cargo test -p ${{ matrix.test_package }} --test ${{ matrix.test_crate }} --release'
      - name: Ensure no git changes
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.event_name == ''pull_request'''
        run: "if [[ -n \"$(git status --porcelain)\" ]]; then\necho \"❌ Git working directory is dirty. Ensure `cargo test` is not modifying git tracked files.\"\necho \"\"\necho \"\U0001F4CB Status:\"\ngit status\necho \"\"\nexit 1\nfi"
      - name: Upload test results
        uses: actions/upload-artifact@v6
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && always()'
        with:
          name: 'test-results-macos-aarch64-release-${{ matrix.test_crate }}${{ matrix.shard_total > 1 && format(''-shard-{0}'', matrix.shard_index) || '''' }}.json'
          path: 'target/test_results_${{ matrix.test_crate }}.json'
  build-debug-windows-x86_64:
    name: build debug windows-x86_64
    needs:
      - pre_build
    if: needs.pre_build.outputs.skip_build != 'true'
    runs-on: windows-2022
    environment:
      name: '${{ (github.ref == ''refs/heads/main'' || startsWith(github.ref, ''refs/tags/'')) && ''build'' || '''' }}'
    timeout-minutes: 240
    defaults:
      run:
        shell: bash
    env:
      CARGO_TERM_COLOR: always
      RUST_BACKTRACE: full
      RUST_LIB_BACKTRACE: 0
    steps:
      - name: Configure git
        run: |-
          git config --global core.symlinks true
          git config --global fetch.parallel 32
      - name: Clone repository
        uses: actions/checkout@v6
        with:
          fetch-depth: 5
          submodules: false
      - name: Clone submodule ./tests/util/std
        run: git submodule update --init --recursive --depth=1 -- ./tests/util/std
      - name: Restore cache cargo home
        uses: actions/cache/restore@v4
        if: '!startsWith(github.ref, ''refs/tags/'')'
        with:
          path: |-
            ~/.cargo/.crates.toml
            ~/.cargo/.crates2.json
            ~/.cargo/bin
            ~/.cargo/registry/index
            ~/.cargo/registry/cache
            ~/.cargo/git/db
          key: never_saved
          restore-keys: 106-cargo-home-windows-x86_64-build-main-
      - name: Restore cache build output
        uses: actions/cache/restore@v4
        if: 'github.ref != ''refs/heads/main'' && !startsWith(github.ref, ''refs/tags/'')'
        with:
          path: |-
            ./target
            !./target/*/gn_out
            !./target/*/gn_root
            !./target/*/*.zip
            !./target/*/*.tar.gz
          key: never_saved
          restore-keys: 106-cargo-target-windows-x86_64-debug-build-main-
      - name: Apply and update mtime cache
        uses: ./.github/mtime_cache
        with:
          cache-path: ./target
      - uses: dsherret/rust-toolchain-file@v1
      - name: Build debug
        env:
          CARGO_PROFILE_DEV_DEBUG: 0
        run: cargo build --locked --bin deno --bin denort --bin test_server --features=panic-trace
      - name: Log versions
        run: |-
          echo '*** Python'
          command -v python && python --version || echo 'No python found or bad executable'
          echo '*** Rust'
          command -v rustc && rustc --version || echo 'No rustc found or bad executable'
          echo '*** Cargo'
          command -v cargo && cargo --version || echo 'No cargo found or bad executable'
          echo '*** Deno'
          command -v deno && deno --version || echo 'No deno found or bad executable'
          echo '*** Node'
          command -v node && node --version || echo 'No node found or bad executable'
          echo '*** Installed packages'
          command -v dpkg && dpkg -l || echo 'No dpkg found or bad executable'
      - name: Check deno binary
        env:
          NO_COLOR: 1
        run: target/debug/deno eval "console.log(1+2)" | grep 3
      - name: Upload artifact debug-windows-x86_64-deno
        uses: actions/upload-artifact@v6
        with:
          name: debug-windows-x86_64-deno
          path: target/debug/deno.exe
          retention-days: 3
      - name: Upload artifact debug-windows-x86_64-denort
        uses: actions/upload-artifact@v6
        with:
          name: debug-windows-x86_64-denort
          path: target/debug/denort.exe
          retention-days: 3
      - name: Upload artifact debug-windows-x86_64-test-server
        uses: actions/upload-artifact@v6
        with:
          name: debug-windows-x86_64-test-server
          path: target/debug/test_server.exe
          retention-days: 3
      - name: Cache cargo home
        uses: actions/cache/save@v4
        if: 'github.ref == ''refs/heads/main'' && !startsWith(github.ref, ''refs/tags/'')'
        with:
          path: |-
            ~/.cargo/.crates.toml
            ~/.cargo/.crates2.json
            ~/.cargo/bin
            ~/.cargo/registry/index
            ~/.cargo/registry/cache
            ~/.cargo/git/db
          key: '106-cargo-home-windows-x86_64-build-main-${{ github.sha }}'
      - name: Cache build output
        uses: actions/cache/save@v4
        if: 'github.ref == ''refs/heads/main'' && !startsWith(github.ref, ''refs/tags/'')'
        with:
          path: |-
            ./target
            !./target/*/gn_out
            !./target/*/gn_root
            !./target/*/*.zip
            !./target/*/*.tar.gz
          key: '106-cargo-target-windows-x86_64-debug-build-main-${{ github.sha }}'
  test-debug-windows-x86_64:
    name: 'test ${{ matrix.test_crate }} ${{ matrix.shard_label }}debug windows-x86_64'
    needs:
      - build-debug-windows-x86_64
    runs-on: windows-2022
    timeout-minutes: 30
    defaults:
      run:
        shell: bash
    strategy:
      matrix:
        include:
          - test_crate: integration
            test_package: integration_tests
            shard_index: '0'
            shard_total: '2'
            shard_label: '(1/2) '
          - test_crate: integration
            test_package: integration_tests
            shard_index: '1'
            shard_total: '2'
            shard_label: '(2/2) '
          - test_crate: node_compat
            test_package: node_compat_tests
            shard_index: '0'
            shard_total: '1'
            shard_label: ''
          - test_crate: specs
            test_package: specs_tests
            shard_index: '0'
            shard_total: '2'
            shard_label: '(1/2) '
          - test_crate: specs
            test_package: specs_tests
            shard_index: '1'
            shard_total: '2'
            shard_label: '(2/2) '
          - test_crate: unit
            test_package: unit_tests
            shard_index: '0'
            shard_total: '1'
            shard_label: ''
          - test_crate: unit_node
            test_package: unit_node_tests
            shard_index: '0'
            shard_total: '1'
            shard_label: ''
      fail-fast: false
    env:
      CARGO_TERM_COLOR: always
      RUST_BACKTRACE: full
      RUST_LIB_BACKTRACE: 0
    steps:
      - name: Configure git
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        run: |-
          git config --global core.symlinks true
          git config --global fetch.parallel 32
      - name: Clone repository
        uses: actions/checkout@v6
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        with:
          fetch-depth: 5
          submodules: false
      - name: Clone submodule ./tests/node_compat/runner/suite
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && matrix.test_crate == ''node_compat'''
        run: git submodule update --init --recursive --depth=1 -- ./tests/node_compat/runner/suite
      - name: Clone submodule ./tests/util/std
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        run: git submodule update --init --recursive --depth=1 -- ./tests/util/std
      - name: Restore cache cargo home
        uses: actions/cache/restore@v4
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        with:
          path: |-
            ~/.cargo/.crates.toml
            ~/.cargo/.crates2.json
            ~/.cargo/bin
            ~/.cargo/registry/index
            ~/.cargo/registry/cache
            ~/.cargo/git/db
          key: never_saved
          restore-keys: '106-cargo-home-windows-x86_64-test-${{ matrix.test_crate }}-'
      - name: Restore cache build output
        uses: actions/cache/restore@v4
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && github.ref != ''refs/heads/main'''
        with:
          path: |-
            ./target
            !./target/*/gn_out
            !./target/*/gn_root
            !./target/*/*.zip
            !./target/*/*.tar.gz
          key: never_saved
          restore-keys: '106-cargo-target-windows-x86_64-debug-test-${{ matrix.test_crate }}-'
      - name: Apply and update mtime cache
        uses: ./.github/mtime_cache
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        with:
          cache-path: ./target
      - name: Install Node
        uses: actions/setup-node@v6
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        with:
          node-version: 22
      - uses: dsherret/rust-toolchain-file@v1
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
      - name: Download artifact debug-windows-x86_64-deno
        uses: actions/download-artifact@v6
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        with:
          name: debug-windows-x86_64-deno
          path: target/debug
      - name: Download artifact debug-windows-x86_64-denort
        uses: actions/download-artifact@v6
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && (matrix.test_crate == ''integration'' || matrix.test_crate == ''specs'')'
        with:
          name: debug-windows-x86_64-denort
          path: target/debug
      - name: Download artifact debug-windows-x86_64-test-server
        uses: actions/download-artifact@v6
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && (matrix.test_crate == ''integration'' || matrix.test_crate == ''specs'' || matrix.test_crate == ''unit'' || matrix.test_crate == ''unit_node'')'
        with:
          name: debug-windows-x86_64-test-server
          path: target/debug
      - name: Set up playwright cache
        uses: actions/cache@v5
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        with:
          path: ./.ms-playwright
          key: 'playwright-${{ runner.os }}-${{ runner.arch }}'
      - name: Build ffi (debug)
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && matrix.test_crate == ''specs'''
        run: cargo build -p test_ffi
      - name: Test (debug)
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        env:
          CARGO_PROFILE_DEV_DEBUG: 0
          CI_SHARD_INDEX: '${{ github.event_name == ''pull_request'' && matrix.shard_index || '''' }}'
          CI_SHARD_TOTAL: '${{ github.event_name == ''pull_request'' && matrix.shard_total || '''' }}'
        run: 'cargo test -p ${{ matrix.test_package }} --test ${{ matrix.test_crate }}'
      - name: Ensure no git changes
        if: '!startsWith(github.ref, ''refs/tags/'') && github.event_name == ''pull_request'''
        run: "if [[ -n \"$(git status --porcelain)\" ]]; then\necho \"❌ Git working directory is dirty. Ensure `cargo test` is not modifying git tracked files.\"\necho \"\"\necho \"\U0001F4CB Status:\"\ngit status\necho \"\"\nexit 1\nfi"
      - name: Upload test results
        uses: actions/upload-artifact@v6
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && always()'
        with:
          name: 'test-results-windows-x86_64-debug-${{ matrix.test_crate }}${{ matrix.shard_total > 1 && format(''-shard-{0}'', matrix.shard_index) || '''' }}.json'
          path: 'target/test_results_${{ matrix.test_crate }}.json'
      - name: Cache cargo home
        uses: actions/cache/save@v4
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && github.ref == ''refs/heads/main'''
        with:
          path: |-
            ~/.cargo/.crates.toml
            ~/.cargo/.crates2.json
            ~/.cargo/bin
            ~/.cargo/registry/index
            ~/.cargo/registry/cache
            ~/.cargo/git/db
          key: '106-cargo-home-windows-x86_64-test-${{ matrix.test_crate }}-${{ github.sha }}'
      - name: Cache build output
        uses: actions/cache/save@v4
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && github.ref == ''refs/heads/main'''
        with:
          path: |-
            ./target
            !./target/*/gn_out
            !./target/*/gn_root
            !./target/*/*.zip
            !./target/*/*.tar.gz
          key: '106-cargo-target-windows-x86_64-debug-test-${{ matrix.test_crate }}-${{ github.sha }}'
  test-libs-debug-windows-x86_64:
    name: test libs debug windows-x86_64
    needs:
      - build-debug-windows-x86_64
    runs-on: windows-2022
    timeout-minutes: 30
    steps:
      - name: Configure git
        if: '!startsWith(github.ref, ''refs/tags/'')'
        run: |-
          git config --global core.symlinks true
          git config --global fetch.parallel 32
      - name: Clone repository
        uses: actions/checkout@v6
        if: '!startsWith(github.ref, ''refs/tags/'')'
        with:
          fetch-depth: 5
          submodules: false
      - name: Restore cache cargo home
        uses: actions/cache/restore@v4
        if: '!startsWith(github.ref, ''refs/tags/'')'
        with:
          path: |-
            ~/.cargo/.crates.toml
            ~/.cargo/.crates2.json
            ~/.cargo/bin
            ~/.cargo/registry/index
            ~/.cargo/registry/cache
            ~/.cargo/git/db
          key: never_saved
          restore-keys: 106-cargo-home-windows-x86_64-test-libs-
      - name: Restore cache build output
        uses: actions/cache/restore@v4
        if: '!startsWith(github.ref, ''refs/tags/'') && github.ref != ''refs/heads/main'''
        with:
          path: |-
            ./target
            !./target/*/gn_out
            !./target/*/gn_root
            !./target/*/*.zip
            !./target/*/*.tar.gz
          key: never_saved
          restore-keys: 106-cargo-target-windows-x86_64-debug-test-libs-
      - name: Apply and update mtime cache
        uses: ./.github/mtime_cache
        if: '!startsWith(github.ref, ''refs/tags/'')'
        with:
          cache-path: ./target
      - name: Install Node
        uses: actions/setup-node@v6
        if: '!startsWith(github.ref, ''refs/tags/'')'
        with:
          node-version: 22
      - uses: dsherret/rust-toolchain-file@v1
        if: '!startsWith(github.ref, ''refs/tags/'')'
      - name: Download artifact debug-windows-x86_64-deno
        uses: actions/download-artifact@v6
        if: '!startsWith(github.ref, ''refs/tags/'')'
        with:
          name: debug-windows-x86_64-deno
          path: target/debug
      - name: Download artifact debug-windows-x86_64-test-server
        uses: actions/download-artifact@v6
        if: '!startsWith(github.ref, ''refs/tags/'')'
        with:
          name: debug-windows-x86_64-test-server
          path: target/debug
      - name: Test libs
        if: '!startsWith(github.ref, ''refs/tags/'')'
        env:
          CARGO_PROFILE_DEV_DEBUG: 0
        run: cargo test --locked --lib -p deno -p denort -p node_shim -p deno_lib -p deno_snapshots -p deno_bundle_runtime -p deno_cache -p deno_cron -p deno_crypto -p deno_fetch -p deno_ffi -p deno_fs -p deno_http -p deno_image -p deno_io -p deno_kv -p deno_napi -p napi_sym -p deno_net -p deno_node -p deno_node_crypto -p deno_node_sqlite -p denort_helper -p deno_signals -p deno_telemetry -p deno_url -p deno_web -p deno_webgpu -p deno_webidl -p deno_websocket -p deno_webstorage -p deno_cache_dir -p deno_config -p deno_crypto_provider -p deno_dotenv -p eszip -p deno_inspector_server -p deno_lockfile -p deno_maybe_sync -p napi_sys -p node_resolver -p deno_npm -p deno_npm_cache -p deno_npm_installer -p deno_npmrc -p deno_package_json -p deno_resolver -p deno_typescript_go_client_rust -p deno_runtime -p deno_features -p deno_permissions -p deno_subprocess_windows
      - name: Cache cargo home
        uses: actions/cache/save@v4
        if: '!startsWith(github.ref, ''refs/tags/'') && github.ref == ''refs/heads/main'''
        with:
          path: |-
            ~/.cargo/.crates.toml
            ~/.cargo/.crates2.json
            ~/.cargo/bin
            ~/.cargo/registry/index
            ~/.cargo/registry/cache
            ~/.cargo/git/db
          key: '106-cargo-home-windows-x86_64-test-libs-${{ github.sha }}'
      - name: Cache build output
        uses: actions/cache/save@v4
        if: '!startsWith(github.ref, ''refs/tags/'') && github.ref == ''refs/heads/main'''
        with:
          path: |-
            ./target
            !./target/*/gn_out
            !./target/*/gn_root
            !./target/*/*.zip
            !./target/*/*.tar.gz
          key: '106-cargo-target-windows-x86_64-debug-test-libs-${{ github.sha }}'
  build-release-windows-x86_64:
    name: build release windows-x86_64
    needs:
      - pre_build
    if: needs.pre_build.outputs.skip_build != 'true'
    runs-on: '${{ !contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'' && ''ubuntu-24.04'' || github.repository == ''denoland/deno'' && ''windows-2022-xl'' || ''windows-2022'' }}'
    environment:
      name: '${{ (github.ref == ''refs/heads/main'' || startsWith(github.ref, ''refs/tags/'')) && ''build'' || '''' }}'
    timeout-minutes: 240
    defaults:
      run:
        shell: bash
    env:
      CARGO_TERM_COLOR: always
      RUST_BACKTRACE: full
      RUST_LIB_BACKTRACE: 0
    steps:
      - name: Configure git
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'')'
        run: |-
          git config --global core.symlinks true
          git config --global fetch.parallel 32
      - name: Clone repository
        uses: actions/checkout@v6
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'')'
        with:
          fetch-depth: 5
          submodules: false
      - name: Clone submodule ./tests/util/std
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'')'
        run: git submodule update --init --recursive --depth=1 -- ./tests/util/std
      - name: Restore cache cargo home
        uses: actions/cache/restore@v4
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && !startsWith(github.ref, ''refs/tags/'')'
        with:
          path: |-
            ~/.cargo/.crates.toml
            ~/.cargo/.crates2.json
            ~/.cargo/bin
            ~/.cargo/registry/index
            ~/.cargo/registry/cache
            ~/.cargo/git/db
          key: never_saved
          restore-keys: 106-cargo-home-windows-x86_64-build-main-
      - name: Restore cache build output
        uses: actions/cache/restore@v4
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.ref != ''refs/heads/main'' && !startsWith(github.ref, ''refs/tags/'')'
        with:
          path: |-
            ./target
            !./target/*/gn_out
            !./target/*/gn_root
            !./target/*/*.zip
            !./target/*/*.tar.gz
          key: never_saved
          restore-keys: 106-cargo-target-windows-x86_64-release-build-main-
      - name: Apply and update mtime cache
        uses: ./.github/mtime_cache
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'')'
        with:
          cache-path: ./target
      - uses: dsherret/rust-toolchain-file@v1
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'')'
      - name: Configure canary build
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'' && !startsWith(github.ref, ''refs/tags/'')'
        run: echo "DENO_CANARY=true" >> $GITHUB_ENV
      - name: Build release
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'''
        run: |-
          df -h
          cargo build --release --locked --bin deno --bin denort --bin test_server --features=panic-trace
          df -h
      - name: Generate symcache
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'''
        env:
          NO_COLOR: 1
        run: |-
          target/release/deno -A tools/release/create_symcache.ts ./deno.symcache
          du -h deno.symcache
          du -h target/release/deno
      - name: Authenticate with Azure (windows)
        uses: azure/login@v2
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'' && (github.ref == ''refs/heads/main'' || startsWith(github.ref, ''refs/tags/''))'
        with:
          client-id: '${{ secrets.AZURE_CLIENT_ID }}'
          tenant-id: '${{ secrets.AZURE_TENANT_ID }}'
          subscription-id: '${{ secrets.AZURE_SUBSCRIPTION_ID }}'
          enable-AzPSSession: true
      - name: Code sign deno.exe (windows)
        uses: Azure/artifact-signing-action@v0
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'' && (github.ref == ''refs/heads/main'' || startsWith(github.ref, ''refs/tags/''))'
        with:
          endpoint: 'https://eus.codesigning.azure.net/'
          trusted-signing-account-name: deno-cli-code-signing
          certificate-profile-name: deno-cli-code-signing-cert
          files-folder: target/release
          files-folder-filter: deno.exe
          file-digest: SHA256
          timestamp-rfc3161: 'http://timestamp.acs.microsoft.com'
          timestamp-digest: SHA256
          exclude-environment-credential: true
          exclude-workload-identity-credential: true
          exclude-managed-identity-credential: true
          exclude-shared-token-cache-credential: true
          exclude-visual-studio-credential: true
          exclude-visual-studio-code-credential: true
          exclude-azure-cli-credential: false
      - name: Verify signature (windows)
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'' && (github.ref == ''refs/heads/main'' || startsWith(github.ref, ''refs/tags/''))'
        shell: pwsh
        run: |-
          $SignTool = Get-ChildItem -Path "C:\Program Files*\Windows Kits\*\bin\*\x64\signtool.exe" -Recurse -ErrorAction SilentlyContinue | Select-Object -First 1
          $SignToolPath = $SignTool.FullName
          & $SignToolPath verify /pa /v target\release\deno.exe
      - name: Pre-release (windows)
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'''
        shell: pwsh
        run: |-
          Compress-Archive -CompressionLevel Optimal -Force -Path target/release/deno.exe -DestinationPath target/release/deno-x86_64-pc-windows-msvc.zip
          Get-FileHash target/release/deno-x86_64-pc-windows-msvc.zip -Algorithm SHA256 | Format-List > target/release/deno-x86_64-pc-windows-msvc.zip.sha256sum
          Compress-Archive -CompressionLevel Optimal -Force -Path target/release/denort.exe -DestinationPath target/release/denort-x86_64-pc-windows-msvc.zip
          Get-FileHash target/release/denort-x86_64-pc-windows-msvc.zip -Algorithm SHA256 | Format-List > target/release/denort-x86_64-pc-windows-msvc.zip.sha256sum
          target/release/deno.exe -A tools/release/create_symcache.ts target/release/deno-x86_64-pc-windows-msvc.symcache
      - name: Authenticate with Google Cloud
        uses: google-github-actions/auth@v3
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'' && (github.ref == ''refs/heads/main'' || startsWith(github.ref, ''refs/tags/''))'
        with:
          project_id: denoland
          credentials_json: '${{ secrets.GCP_SA_KEY }}'
          export_environment_variables: true
          create_credentials_file: true
      - name: Install Python
        uses: actions/setup-python@v6
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'' && (github.ref == ''refs/heads/main'' || startsWith(github.ref, ''refs/tags/''))'
        with:
          python-version: 3.11
      - name: Remove unused versions of Python
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'' && (github.ref == ''refs/heads/main'' || startsWith(github.ref, ''refs/tags/''))'
        shell: pwsh
        run: |-
          $env:PATH -split ";" |
            Where-Object { Test-Path "$_\python.exe" } |
            Select-Object -Skip 1 |
            ForEach-Object { Move-Item "$_" "$_.disabled" }
      - name: Log versions
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'')'
        run: |-
          echo '*** Python'
          command -v python && python --version || echo 'No python found or bad executable'
          echo '*** Rust'
          command -v rustc && rustc --version || echo 'No rustc found or bad executable'
          echo '*** Cargo'
          command -v cargo && cargo --version || echo 'No cargo found or bad executable'
          echo '*** Deno'
          command -v deno && deno --version || echo 'No deno found or bad executable'
          echo '*** Node'
          command -v node && node --version || echo 'No node found or bad executable'
          echo '*** Installed packages'
          command -v dpkg && dpkg -l || echo 'No dpkg found or bad executable'
      - name: Setup gcloud (windows)
        uses: google-github-actions/setup-gcloud@v2
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'' && (github.ref == ''refs/heads/main'' || startsWith(github.ref, ''refs/tags/''))'
        env:
          CLOUDSDK_PYTHON: '${{env.pythonLocation}}\python.exe'
        with:
          project_id: denoland
      - name: Upload canary to dl.deno.land
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'' && github.ref == ''refs/heads/main'''
        env:
          AWS_ACCESS_KEY_ID: '${{ vars.S3_ACCESS_KEY_ID }}'
          AWS_SECRET_ACCESS_KEY: '${{ secrets.S3_SECRET_ACCESS_KEY }}'
          AWS_ENDPOINT_URL_S3: '${{ vars.S3_ENDPOINT }}'
          AWS_DEFAULT_REGION: '${{ vars.S3_REGION }}'
        run: |-
          gsutil -h "Cache-Control: public, max-age=3600" cp ./target/release/*.zip gs://dl.deno.land/canary/$(git rev-parse HEAD)/
          gsutil -h "Cache-Control: public, max-age=3600" cp ./target/release/*.sha256sum gs://dl.deno.land/canary/$(git rev-parse HEAD)/
          gsutil -h "Cache-Control: public, max-age=3600" cp ./target/release/*.symcache gs://dl.deno.land/canary/$(git rev-parse HEAD)/
          aws s3 sync ./target/release/ s3://dl-deno-land/canary/$(git rev-parse HEAD)/ --exclude "*" --include "*.zip"
          aws s3 sync ./target/release/ s3://dl-deno-land/canary/$(git rev-parse HEAD)/ --exclude "*" --include "*.sha256sum"
          aws s3 sync ./target/release/ s3://dl-deno-land/canary/$(git rev-parse HEAD)/ --exclude "*" --include "*.symcache"
          echo ${{ github.sha }} > canary-latest.txt
          gsutil -h "Cache-Control: no-cache" cp canary-latest.txt gs://dl.deno.land/canary-$(rustc -vV | sed -n "s|host: ||p")-latest.txt
          aws s3 cp canary-latest.txt s3://dl-deno-land/canary-$(rustc -vV | sed -n "s|host: ||p")-latest.txt
          rm canary-latest.txt gha-creds-*.json
      - name: Build product size info
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'' && (github.ref == ''refs/heads/main'' || startsWith(github.ref, ''refs/tags/''))'
        run: |-
          du -hd1 "./target/release"
          du -ha  "./target/release/deno"
          du -ha  "./target/release/denort"
      - name: Check deno binary
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'')'
        env:
          NO_COLOR: 1
        run: target/release/deno eval "console.log(1+2)" | grep 3
      - name: Upload artifact release-windows-x86_64-deno
        uses: actions/upload-artifact@v6
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'')'
        with:
          name: release-windows-x86_64-deno
          path: target/release/deno.exe
          retention-days: 3
      - name: Upload artifact release-windows-x86_64-denort
        uses: actions/upload-artifact@v6
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'')'
        with:
          name: release-windows-x86_64-denort
          path: target/release/denort.exe
          retention-days: 3
      - name: Upload artifact release-windows-x86_64-test-server
        uses: actions/upload-artifact@v6
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'')'
        with:
          name: release-windows-x86_64-test-server
          path: target/release/test_server.exe
          retention-days: 3
      - name: Upload release to dl.deno.land (windows)
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'' && startsWith(github.ref, ''refs/tags/'')'
        env:
          AWS_ACCESS_KEY_ID: '${{ vars.S3_ACCESS_KEY_ID }}'
          AWS_SECRET_ACCESS_KEY: '${{ secrets.S3_SECRET_ACCESS_KEY }}'
          AWS_ENDPOINT_URL_S3: '${{ vars.S3_ENDPOINT }}'
          AWS_DEFAULT_REGION: '${{ vars.S3_REGION }}'
          CLOUDSDK_PYTHON: '${{env.pythonLocation}}\python.exe'
        run: |-
          gsutil -h "Cache-Control: public, max-age=3600" cp ./target/release/*.zip gs://dl.deno.land/release/${GITHUB_REF#refs/*/}/
          gsutil -h "Cache-Control: public, max-age=3600" cp ./target/release/*.sha256sum gs://dl.deno.land/release/${GITHUB_REF#refs/*/}/
          gsutil -h "Cache-Control: public, max-age=3600" cp ./target/release/*.symcache gs://dl.deno.land/release/${GITHUB_REF#refs/*/}/
          aws s3 sync ./target/release/ s3://dl-deno-land/release/${GITHUB_REF#refs/*/}/ --exclude "*" --include "*.zip"
          aws s3 sync ./target/release/ s3://dl-deno-land/release/${GITHUB_REF#refs/*/}/ --exclude "*" --include "*.sha256sum"
          aws s3 sync ./target/release/ s3://dl-deno-land/release/${GITHUB_REF#refs/*/}/ --exclude "*" --include "*.symcache"
      - name: Create release notes
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'' && startsWith(github.ref, ''refs/tags/'')'
        run: |-
          export PATH=$PATH:$(pwd)/target/release
          ./tools/release/05_create_release_notes.ts
      - name: Upload release to GitHub
        uses: softprops/action-gh-release@v2
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'' && startsWith(github.ref, ''refs/tags/'')'
        env:
          GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
        with:
          files: |-
            target/release/deno-x86_64-pc-windows-msvc.zip
            target/release/deno-x86_64-pc-windows-msvc.zip.sha256sum
            target/release/denort-x86_64-pc-windows-msvc.zip
            target/release/denort-x86_64-pc-windows-msvc.zip.sha256sum
            target/release/deno-aarch64-pc-windows-msvc.zip
            target/release/deno-aarch64-pc-windows-msvc.zip.sha256sum
            target/release/denort-aarch64-pc-windows-msvc.zip
            target/release/denort-aarch64-pc-windows-msvc.zip.sha256sum
            target/release/deno-x86_64-unknown-linux-gnu.zip
            target/release/deno-x86_64-unknown-linux-gnu.zip.sha256sum
            target/release/denort-x86_64-unknown-linux-gnu.zip
            target/release/denort-x86_64-unknown-linux-gnu.zip.sha256sum
            target/release/deno-x86_64-apple-darwin.zip
            target/release/deno-x86_64-apple-darwin.zip.sha256sum
            target/release/denort-x86_64-apple-darwin.zip
            target/release/denort-x86_64-apple-darwin.zip.sha256sum
            target/release/deno-aarch64-unknown-linux-gnu.zip
            target/release/deno-aarch64-unknown-linux-gnu.zip.sha256sum
            target/release/denort-aarch64-unknown-linux-gnu.zip
            target/release/denort-aarch64-unknown-linux-gnu.zip.sha256sum
            target/release/deno-aarch64-apple-darwin.zip
            target/release/deno-aarch64-apple-darwin.zip.sha256sum
            target/release/denort-aarch64-apple-darwin.zip
            target/release/denort-aarch64-apple-darwin.zip.sha256sum
            target/release/deno_src.tar.gz
            target/release/lib.deno.d.ts
          body_path: target/release/release-notes.md
          draft: true
  test-release-windows-x86_64:
    name: 'test ${{ matrix.test_crate }} ${{ matrix.shard_label }}release windows-x86_64'
    needs:
      - build-release-windows-x86_64
    runs-on: '${{ !contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'' && ''ubuntu-24.04'' || ''windows-2022'' }}'
    timeout-minutes: 30
    defaults:
      run:
        shell: bash
    strategy:
      matrix:
        include:
          - test_crate: integration
            test_package: integration_tests
            shard_index: '0'
            shard_total: '2'
            shard_label: '(1/2) '
          - test_crate: integration
            test_package: integration_tests
            shard_index: '1'
            shard_total: '2'
            shard_label: '(2/2) '
          - test_crate: node_compat
            test_package: node_compat_tests
            shard_index: '0'
            shard_total: '1'
            shard_label: ''
          - test_crate: specs
            test_package: specs_tests
            shard_index: '0'
            shard_total: '2'
            shard_label: '(1/2) '
          - test_crate: specs
            test_package: specs_tests
            shard_index: '1'
            shard_total: '2'
            shard_label: '(2/2) '
          - test_crate: unit
            test_package: unit_tests
            shard_index: '0'
            shard_total: '1'
            shard_label: ''
          - test_crate: unit_node
            test_package: unit_node_tests
            shard_index: '0'
            shard_total: '1'
            shard_label: ''
      fail-fast: false
    env:
      CARGO_TERM_COLOR: always
      RUST_BACKTRACE: full
      RUST_LIB_BACKTRACE: 0
    steps:
      - name: Configure git
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        run: |-
          git config --global core.symlinks true
          git config --global fetch.parallel 32
      - name: Clone repository
        uses: actions/checkout@v6
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        with:
          fetch-depth: 5
          submodules: false
      - name: Clone submodule ./tests/node_compat/runner/suite
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && matrix.test_crate == ''node_compat'''
        run: git submodule update --init --recursive --depth=1 -- ./tests/node_compat/runner/suite
      - name: Clone submodule ./tests/util/std
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        run: git submodule update --init --recursive --depth=1 -- ./tests/util/std
      - name: Restore cache cargo home
        uses: actions/cache/restore@v4
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        with:
          path: |-
            ~/.cargo/.crates.toml
            ~/.cargo/.crates2.json
            ~/.cargo/bin
            ~/.cargo/registry/index
            ~/.cargo/registry/cache
            ~/.cargo/git/db
          key: never_saved
          restore-keys: '106-cargo-home-windows-x86_64-test-${{ matrix.test_crate }}-'
      - name: Restore cache build output
        uses: actions/cache/restore@v4
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && github.ref != ''refs/heads/main'''
        with:
          path: |-
            ./target
            !./target/*/gn_out
            !./target/*/gn_root
            !./target/*/*.zip
            !./target/*/*.tar.gz
          key: never_saved
          restore-keys: '106-cargo-target-windows-x86_64-release-test-${{ matrix.test_crate }}-'
      - name: Apply and update mtime cache
        uses: ./.github/mtime_cache
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        with:
          cache-path: ./target
      - name: Install Node
        uses: actions/setup-node@v6
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        with:
          node-version: 22
      - uses: dsherret/rust-toolchain-file@v1
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
      - name: Download artifact release-windows-x86_64-deno
        uses: actions/download-artifact@v6
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        with:
          name: release-windows-x86_64-deno
          path: target/release
      - name: Download artifact release-windows-x86_64-denort
        uses: actions/download-artifact@v6
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && (matrix.test_crate == ''integration'' || matrix.test_crate == ''specs'')'
        with:
          name: release-windows-x86_64-denort
          path: target/release
      - name: Download artifact release-windows-x86_64-test-server
        uses: actions/download-artifact@v6
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && (matrix.test_crate == ''integration'' || matrix.test_crate == ''specs'' || matrix.test_crate == ''unit'' || matrix.test_crate == ''unit_node'')'
        with:
          name: release-windows-x86_64-test-server
          path: target/release
      - name: Set up playwright cache
        uses: actions/cache@v5
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        with:
          path: ./.ms-playwright
          key: 'playwright-${{ runner.os }}-${{ runner.arch }}'
      - name: Build ffi (release)
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && matrix.test_crate == ''specs'''
        run: cargo build --release -p test_ffi
      - name: Test (release)
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && github.repository == ''denoland/deno'''
        env:
          CI_SHARD_INDEX: '${{ github.event_name == ''pull_request'' && matrix.shard_index || '''' }}'
          CI_SHARD_TOTAL: '${{ github.event_name == ''pull_request'' && matrix.shard_total || '''' }}'
        run: 'cargo test -p ${{ matrix.test_package }} --test ${{ matrix.test_crate }} --release'
      - name: Ensure no git changes
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.event_name == ''pull_request'''
        run: "if [[ -n \"$(git status --porcelain)\" ]]; then\necho \"❌ Git working directory is dirty. Ensure `cargo test` is not modifying git tracked files.\"\necho \"\"\necho \"\U0001F4CB Status:\"\ngit status\necho \"\"\nexit 1\nfi"
      - name: Upload test results
        uses: actions/upload-artifact@v6
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && always()'
        with:
          name: 'test-results-windows-x86_64-release-${{ matrix.test_crate }}${{ matrix.shard_total > 1 && format(''-shard-{0}'', matrix.shard_index) || '''' }}.json'
          path: 'target/test_results_${{ matrix.test_crate }}.json'
  build-debug-windows-aarch64:
    name: build debug windows-aarch64
    needs:
      - pre_build
    if: needs.pre_build.outputs.skip_build != 'true'
    runs-on: windows-11-arm
    environment:
      name: '${{ (github.ref == ''refs/heads/main'' || startsWith(github.ref, ''refs/tags/'')) && ''build'' || '''' }}'
    timeout-minutes: 240
    defaults:
      run:
        shell: bash
    env:
      CARGO_TERM_COLOR: always
      RUST_BACKTRACE: full
      RUST_LIB_BACKTRACE: 0
    steps:
      - name: Configure git
        run: |-
          git config --global core.symlinks true
          git config --global fetch.parallel 32
      - name: Clone repository
        uses: actions/checkout@v6
        with:
          fetch-depth: 5
          submodules: false
      - name: Clone submodule ./tests/util/std
        run: git submodule update --init --recursive --depth=1 -- ./tests/util/std
      - name: Restore cache cargo home
        uses: actions/cache/restore@v4
        if: '!startsWith(github.ref, ''refs/tags/'')'
        with:
          path: |-
            ~/.cargo/.crates.toml
            ~/.cargo/.crates2.json
            ~/.cargo/bin
            ~/.cargo/registry/index
            ~/.cargo/registry/cache
            ~/.cargo/git/db
          key: never_saved
          restore-keys: 106-cargo-home-windows-aarch64-build-main-
      - name: Restore cache build output
        uses: actions/cache/restore@v4
        if: 'github.ref != ''refs/heads/main'' && !startsWith(github.ref, ''refs/tags/'')'
        with:
          path: |-
            ./target
            !./target/*/gn_out
            !./target/*/gn_root
            !./target/*/*.zip
            !./target/*/*.tar.gz
          key: never_saved
          restore-keys: 106-cargo-target-windows-aarch64-debug-build-main-
      - name: Apply and update mtime cache
        uses: ./.github/mtime_cache
        with:
          cache-path: ./target
      - uses: dsherret/rust-toolchain-file@v1
      - name: Build debug
        env:
          CARGO_PROFILE_DEV_DEBUG: 0
        run: cargo build --locked --bin deno --bin denort --bin test_server --features=panic-trace
      - name: Log versions
        run: |-
          echo '*** Python'
          command -v python && python --version || echo 'No python found or bad executable'
          echo '*** Rust'
          command -v rustc && rustc --version || echo 'No rustc found or bad executable'
          echo '*** Cargo'
          command -v cargo && cargo --version || echo 'No cargo found or bad executable'
          echo '*** Deno'
          command -v deno && deno --version || echo 'No deno found or bad executable'
          echo '*** Node'
          command -v node && node --version || echo 'No node found or bad executable'
          echo '*** Installed packages'
          command -v dpkg && dpkg -l || echo 'No dpkg found or bad executable'
      - name: Check deno binary
        env:
          NO_COLOR: 1
        run: target/debug/deno eval "console.log(1+2)" | grep 3
      - name: Upload artifact debug-windows-aarch64-deno
        uses: actions/upload-artifact@v6
        with:
          name: debug-windows-aarch64-deno
          path: target/debug/deno.exe
          retention-days: 3
      - name: Upload artifact debug-windows-aarch64-denort
        uses: actions/upload-artifact@v6
        with:
          name: debug-windows-aarch64-denort
          path: target/debug/denort.exe
          retention-days: 3
      - name: Upload artifact debug-windows-aarch64-test-server
        uses: actions/upload-artifact@v6
        with:
          name: debug-windows-aarch64-test-server
          path: target/debug/test_server.exe
          retention-days: 3
      - name: Cache cargo home
        uses: actions/cache/save@v4
        if: 'github.ref == ''refs/heads/main'' && !startsWith(github.ref, ''refs/tags/'')'
        with:
          path: |-
            ~/.cargo/.crates.toml
            ~/.cargo/.crates2.json
            ~/.cargo/bin
            ~/.cargo/registry/index
            ~/.cargo/registry/cache
            ~/.cargo/git/db
          key: '106-cargo-home-windows-aarch64-build-main-${{ github.sha }}'
      - name: Cache build output
        uses: actions/cache/save@v4
        if: 'github.ref == ''refs/heads/main'' && !startsWith(github.ref, ''refs/tags/'')'
        with:
          path: |-
            ./target
            !./target/*/gn_out
            !./target/*/gn_root
            !./target/*/*.zip
            !./target/*/*.tar.gz
          key: '106-cargo-target-windows-aarch64-debug-build-main-${{ github.sha }}'
  test-debug-windows-aarch64:
    name: 'test ${{ matrix.test_crate }} ${{ matrix.shard_label }}debug windows-aarch64'
    needs:
      - build-debug-windows-aarch64
    runs-on: windows-11-arm
    timeout-minutes: 30
    defaults:
      run:
        shell: bash
    strategy:
      matrix:
        include:
          - test_crate: integration
            test_package: integration_tests
            shard_index: '0'
            shard_total: '2'
            shard_label: '(1/2) '
          - test_crate: integration
            test_package: integration_tests
            shard_index: '1'
            shard_total: '2'
            shard_label: '(2/2) '
          - test_crate: node_compat
            test_package: node_compat_tests
            shard_index: '0'
            shard_total: '1'
            shard_label: ''
          - test_crate: specs
            test_package: specs_tests
            shard_index: '0'
            shard_total: '2'
            shard_label: '(1/2) '
          - test_crate: specs
            test_package: specs_tests
            shard_index: '1'
            shard_total: '2'
            shard_label: '(2/2) '
          - test_crate: unit
            test_package: unit_tests
            shard_index: '0'
            shard_total: '1'
            shard_label: ''
          - test_crate: unit_node
            test_package: unit_node_tests
            shard_index: '0'
            shard_total: '1'
            shard_label: ''
      fail-fast: false
    env:
      CARGO_TERM_COLOR: always
      RUST_BACKTRACE: full
      RUST_LIB_BACKTRACE: 0
    steps:
      - name: Configure git
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        run: |-
          git config --global core.symlinks true
          git config --global fetch.parallel 32
      - name: Clone repository
        uses: actions/checkout@v6
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        with:
          fetch-depth: 5
          submodules: false
      - name: Clone submodule ./tests/node_compat/runner/suite
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && matrix.test_crate == ''node_compat'''
        run: git submodule update --init --recursive --depth=1 -- ./tests/node_compat/runner/suite
      - name: Clone submodule ./tests/util/std
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        run: git submodule update --init --recursive --depth=1 -- ./tests/util/std
      - name: Restore cache cargo home
        uses: actions/cache/restore@v4
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        with:
          path: |-
            ~/.cargo/.crates.toml
            ~/.cargo/.crates2.json
            ~/.cargo/bin
            ~/.cargo/registry/index
            ~/.cargo/registry/cache
            ~/.cargo/git/db
          key: never_saved
          restore-keys: '106-cargo-home-windows-aarch64-test-${{ matrix.test_crate }}-'
      - name: Restore cache build output
        uses: actions/cache/restore@v4
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && github.ref != ''refs/heads/main'''
        with:
          path: |-
            ./target
            !./target/*/gn_out
            !./target/*/gn_root
            !./target/*/*.zip
            !./target/*/*.tar.gz
          key: never_saved
          restore-keys: '106-cargo-target-windows-aarch64-debug-test-${{ matrix.test_crate }}-'
      - name: Apply and update mtime cache
        uses: ./.github/mtime_cache
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        with:
          cache-path: ./target
      - name: Install Node
        uses: actions/setup-node@v6
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        with:
          node-version: 22
      - uses: dsherret/rust-toolchain-file@v1
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
      - name: Download artifact debug-windows-aarch64-deno
        uses: actions/download-artifact@v6
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        with:
          name: debug-windows-aarch64-deno
          path: target/debug
      - name: Download artifact debug-windows-aarch64-denort
        uses: actions/download-artifact@v6
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && (matrix.test_crate == ''integration'' || matrix.test_crate == ''specs'')'
        with:
          name: debug-windows-aarch64-denort
          path: target/debug
      - name: Download artifact debug-windows-aarch64-test-server
        uses: actions/download-artifact@v6
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && (matrix.test_crate == ''integration'' || matrix.test_crate == ''specs'' || matrix.test_crate == ''unit'' || matrix.test_crate == ''unit_node'')'
        with:
          name: debug-windows-aarch64-test-server
          path: target/debug
      - name: Set up playwright cache
        uses: actions/cache@v5
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        with:
          path: ./.ms-playwright
          key: 'playwright-${{ runner.os }}-${{ runner.arch }}'
      - name: Build ffi (debug)
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && matrix.test_crate == ''specs'''
        run: cargo build -p test_ffi
      - name: Test (debug)
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        env:
          CARGO_PROFILE_DEV_DEBUG: 0
          CI_SHARD_INDEX: '${{ github.event_name == ''pull_request'' && matrix.shard_index || '''' }}'
          CI_SHARD_TOTAL: '${{ github.event_name == ''pull_request'' && matrix.shard_total || '''' }}'
        run: 'cargo test -p ${{ matrix.test_package }} --test ${{ matrix.test_crate }}'
      - name: Ensure no git changes
        if: '!startsWith(github.ref, ''refs/tags/'') && github.event_name == ''pull_request'''
        run: "if [[ -n \"$(git status --porcelain)\" ]]; then\necho \"❌ Git working directory is dirty. Ensure `cargo test` is not modifying git tracked files.\"\necho \"\"\necho \"\U0001F4CB Status:\"\ngit status\necho \"\"\nexit 1\nfi"
      - name: Upload test results
        uses: actions/upload-artifact@v6
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && always()'
        with:
          name: 'test-results-windows-aarch64-debug-${{ matrix.test_crate }}${{ matrix.shard_total > 1 && format(''-shard-{0}'', matrix.shard_index) || '''' }}.json'
          path: 'target/test_results_${{ matrix.test_crate }}.json'
      - name: Cache cargo home
        uses: actions/cache/save@v4
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && github.ref == ''refs/heads/main'''
        with:
          path: |-
            ~/.cargo/.crates.toml
            ~/.cargo/.crates2.json
            ~/.cargo/bin
            ~/.cargo/registry/index
            ~/.cargo/registry/cache
            ~/.cargo/git/db
          key: '106-cargo-home-windows-aarch64-test-${{ matrix.test_crate }}-${{ github.sha }}'
      - name: Cache build output
        uses: actions/cache/save@v4
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && github.ref == ''refs/heads/main'''
        with:
          path: |-
            ./target
            !./target/*/gn_out
            !./target/*/gn_root
            !./target/*/*.zip
            !./target/*/*.tar.gz
          key: '106-cargo-target-windows-aarch64-debug-test-${{ matrix.test_crate }}-${{ github.sha }}'
  build-release-windows-aarch64:
    name: build release windows-aarch64
    needs:
      - pre_build
    if: needs.pre_build.outputs.skip_build != 'true'
    runs-on: '${{ !contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'' && ''ubuntu-24.04'' || ''windows-11-arm'' }}'
    environment:
      name: '${{ (github.ref == ''refs/heads/main'' || startsWith(github.ref, ''refs/tags/'')) && ''build'' || '''' }}'
    timeout-minutes: 240
    defaults:
      run:
        shell: bash
    env:
      CARGO_TERM_COLOR: always
      RUST_BACKTRACE: full
      RUST_LIB_BACKTRACE: 0
    steps:
      - name: Configure git
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'')'
        run: |-
          git config --global core.symlinks true
          git config --global fetch.parallel 32
      - name: Clone repository
        uses: actions/checkout@v6
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'')'
        with:
          fetch-depth: 5
          submodules: false
      - name: Clone submodule ./tests/util/std
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'')'
        run: git submodule update --init --recursive --depth=1 -- ./tests/util/std
      - name: Restore cache cargo home
        uses: actions/cache/restore@v4
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && !startsWith(github.ref, ''refs/tags/'')'
        with:
          path: |-
            ~/.cargo/.crates.toml
            ~/.cargo/.crates2.json
            ~/.cargo/bin
            ~/.cargo/registry/index
            ~/.cargo/registry/cache
            ~/.cargo/git/db
          key: never_saved
          restore-keys: 106-cargo-home-windows-aarch64-build-main-
      - name: Restore cache build output
        uses: actions/cache/restore@v4
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.ref != ''refs/heads/main'' && !startsWith(github.ref, ''refs/tags/'')'
        with:
          path: |-
            ./target
            !./target/*/gn_out
            !./target/*/gn_root
            !./target/*/*.zip
            !./target/*/*.tar.gz
          key: never_saved
          restore-keys: 106-cargo-target-windows-aarch64-release-build-main-
      - name: Apply and update mtime cache
        uses: ./.github/mtime_cache
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'')'
        with:
          cache-path: ./target
      - uses: dsherret/rust-toolchain-file@v1
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'')'
      - name: Configure canary build
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'' && !startsWith(github.ref, ''refs/tags/'')'
        run: echo "DENO_CANARY=true" >> $GITHUB_ENV
      - name: Build release
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'''
        run: |-
          df -h
          cargo build --release --locked --bin deno --bin denort --bin test_server --features=panic-trace
          df -h
      - name: Generate symcache
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'''
        env:
          NO_COLOR: 1
        run: |-
          target/release/deno -A tools/release/create_symcache.ts ./deno.symcache
          du -h deno.symcache
          du -h target/release/deno
      - name: Authenticate with Azure (windows)
        uses: azure/login@v2
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'' && (github.ref == ''refs/heads/main'' || startsWith(github.ref, ''refs/tags/''))'
        with:
          client-id: '${{ secrets.AZURE_CLIENT_ID }}'
          tenant-id: '${{ secrets.AZURE_TENANT_ID }}'
          subscription-id: '${{ secrets.AZURE_SUBSCRIPTION_ID }}'
          enable-AzPSSession: true
      - name: Code sign deno.exe (windows)
        uses: Azure/artifact-signing-action@v0
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'' && (github.ref == ''refs/heads/main'' || startsWith(github.ref, ''refs/tags/''))'
        with:
          endpoint: 'https://eus.codesigning.azure.net/'
          trusted-signing-account-name: deno-cli-code-signing
          certificate-profile-name: deno-cli-code-signing-cert
          files-folder: target/release
          files-folder-filter: deno.exe
          file-digest: SHA256
          timestamp-rfc3161: 'http://timestamp.acs.microsoft.com'
          timestamp-digest: SHA256
          exclude-environment-credential: true
          exclude-workload-identity-credential: true
          exclude-managed-identity-credential: true
          exclude-shared-token-cache-credential: true
          exclude-visual-studio-credential: true
          exclude-visual-studio-code-credential: true
          exclude-azure-cli-credential: false
      - name: Verify signature (windows)
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'' && (github.ref == ''refs/heads/main'' || startsWith(github.ref, ''refs/tags/''))'
        shell: pwsh
        run: |-
          $SignTool = Get-ChildItem -Path "C:\Program Files*\Windows Kits\*\bin\*\x64\signtool.exe" -Recurse -ErrorAction SilentlyContinue | Select-Object -First 1
          $SignToolPath = $SignTool.FullName
          & $SignToolPath verify /pa /v target\release\deno.exe
      - name: Pre-release (windows)
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'''
        shell: pwsh
        run: |-
          Compress-Archive -CompressionLevel Optimal -Force -Path target/release/deno.exe -DestinationPath target/release/deno-aarch64-pc-windows-msvc.zip
          Get-FileHash target/release/deno-aarch64-pc-windows-msvc.zip -Algorithm SHA256 | Format-List > target/release/deno-aarch64-pc-windows-msvc.zip.sha256sum
          Compress-Archive -CompressionLevel Optimal -Force -Path target/release/denort.exe -DestinationPath target/release/denort-aarch64-pc-windows-msvc.zip
          Get-FileHash target/release/denort-aarch64-pc-windows-msvc.zip -Algorithm SHA256 | Format-List > target/release/denort-aarch64-pc-windows-msvc.zip.sha256sum
          target/release/deno.exe -A tools/release/create_symcache.ts target/release/deno-aarch64-pc-windows-msvc.symcache
      - name: Authenticate with Google Cloud
        uses: google-github-actions/auth@v3
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'' && (github.ref == ''refs/heads/main'' || startsWith(github.ref, ''refs/tags/''))'
        with:
          project_id: denoland
          credentials_json: '${{ secrets.GCP_SA_KEY }}'
          export_environment_variables: true
          create_credentials_file: true
      - name: Install Python
        uses: actions/setup-python@v6
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'' && (github.ref == ''refs/heads/main'' || startsWith(github.ref, ''refs/tags/''))'
        with:
          python-version: 3.11
      - name: Remove unused versions of Python
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'' && (github.ref == ''refs/heads/main'' || startsWith(github.ref, ''refs/tags/''))'
        shell: pwsh
        run: |-
          $env:PATH -split ";" |
            Where-Object { Test-Path "$_\python.exe" } |
            Select-Object -Skip 1 |
            ForEach-Object { Move-Item "$_" "$_.disabled" }
      - name: Log versions
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'')'
        run: |-
          echo '*** Python'
          command -v python && python --version || echo 'No python found or bad executable'
          echo '*** Rust'
          command -v rustc && rustc --version || echo 'No rustc found or bad executable'
          echo '*** Cargo'
          command -v cargo && cargo --version || echo 'No cargo found or bad executable'
          echo '*** Deno'
          command -v deno && deno --version || echo 'No deno found or bad executable'
          echo '*** Node'
          command -v node && node --version || echo 'No node found or bad executable'
          echo '*** Installed packages'
          command -v dpkg && dpkg -l || echo 'No dpkg found or bad executable'
      - name: Setup gcloud (windows)
        uses: google-github-actions/setup-gcloud@v2
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'' && (github.ref == ''refs/heads/main'' || startsWith(github.ref, ''refs/tags/''))'
        env:
          CLOUDSDK_PYTHON: '${{env.pythonLocation}}\python.exe'
        with:
          project_id: denoland
      - name: Upload canary to dl.deno.land
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'' && github.ref == ''refs/heads/main'''
        env:
          AWS_ACCESS_KEY_ID: '${{ vars.S3_ACCESS_KEY_ID }}'
          AWS_SECRET_ACCESS_KEY: '${{ secrets.S3_SECRET_ACCESS_KEY }}'
          AWS_ENDPOINT_URL_S3: '${{ vars.S3_ENDPOINT }}'
          AWS_DEFAULT_REGION: '${{ vars.S3_REGION }}'
        run: |-
          gsutil -h "Cache-Control: public, max-age=3600" cp ./target/release/*.zip gs://dl.deno.land/canary/$(git rev-parse HEAD)/
          gsutil -h "Cache-Control: public, max-age=3600" cp ./target/release/*.sha256sum gs://dl.deno.land/canary/$(git rev-parse HEAD)/
          gsutil -h "Cache-Control: public, max-age=3600" cp ./target/release/*.symcache gs://dl.deno.land/canary/$(git rev-parse HEAD)/
          aws s3 sync ./target/release/ s3://dl-deno-land/canary/$(git rev-parse HEAD)/ --exclude "*" --include "*.zip"
          aws s3 sync ./target/release/ s3://dl-deno-land/canary/$(git rev-parse HEAD)/ --exclude "*" --include "*.sha256sum"
          aws s3 sync ./target/release/ s3://dl-deno-land/canary/$(git rev-parse HEAD)/ --exclude "*" --include "*.symcache"
          echo ${{ github.sha }} > canary-latest.txt
          gsutil -h "Cache-Control: no-cache" cp canary-latest.txt gs://dl.deno.land/canary-$(rustc -vV | sed -n "s|host: ||p")-latest.txt
          aws s3 cp canary-latest.txt s3://dl-deno-land/canary-$(rustc -vV | sed -n "s|host: ||p")-latest.txt
          rm canary-latest.txt gha-creds-*.json
      - name: Build product size info
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'' && (github.ref == ''refs/heads/main'' || startsWith(github.ref, ''refs/tags/''))'
        run: |-
          du -hd1 "./target/release"
          du -ha  "./target/release/deno"
          du -ha  "./target/release/denort"
      - name: Check deno binary
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'')'
        env:
          NO_COLOR: 1
        run: target/release/deno eval "console.log(1+2)" | grep 3
      - name: Upload artifact release-windows-aarch64-deno
        uses: actions/upload-artifact@v6
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'')'
        with:
          name: release-windows-aarch64-deno
          path: target/release/deno.exe
          retention-days: 3
      - name: Upload artifact release-windows-aarch64-denort
        uses: actions/upload-artifact@v6
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'')'
        with:
          name: release-windows-aarch64-denort
          path: target/release/denort.exe
          retention-days: 3
      - name: Upload artifact release-windows-aarch64-test-server
        uses: actions/upload-artifact@v6
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'')'
        with:
          name: release-windows-aarch64-test-server
          path: target/release/test_server.exe
          retention-days: 3
      - name: Upload release to dl.deno.land (windows)
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'' && startsWith(github.ref, ''refs/tags/'')'
        env:
          AWS_ACCESS_KEY_ID: '${{ vars.S3_ACCESS_KEY_ID }}'
          AWS_SECRET_ACCESS_KEY: '${{ secrets.S3_SECRET_ACCESS_KEY }}'
          AWS_ENDPOINT_URL_S3: '${{ vars.S3_ENDPOINT }}'
          AWS_DEFAULT_REGION: '${{ vars.S3_REGION }}'
          CLOUDSDK_PYTHON: '${{env.pythonLocation}}\python.exe'
        run: |-
          gsutil -h "Cache-Control: public, max-age=3600" cp ./target/release/*.zip gs://dl.deno.land/release/${GITHUB_REF#refs/*/}/
          gsutil -h "Cache-Control: public, max-age=3600" cp ./target/release/*.sha256sum gs://dl.deno.land/release/${GITHUB_REF#refs/*/}/
          gsutil -h "Cache-Control: public, max-age=3600" cp ./target/release/*.symcache gs://dl.deno.land/release/${GITHUB_REF#refs/*/}/
          aws s3 sync ./target/release/ s3://dl-deno-land/release/${GITHUB_REF#refs/*/}/ --exclude "*" --include "*.zip"
          aws s3 sync ./target/release/ s3://dl-deno-land/release/${GITHUB_REF#refs/*/}/ --exclude "*" --include "*.sha256sum"
          aws s3 sync ./target/release/ s3://dl-deno-land/release/${GITHUB_REF#refs/*/}/ --exclude "*" --include "*.symcache"
      - name: Create release notes
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'' && startsWith(github.ref, ''refs/tags/'')'
        run: |-
          export PATH=$PATH:$(pwd)/target/release
          ./tools/release/05_create_release_notes.ts
      - name: Upload release to GitHub
        uses: softprops/action-gh-release@v2
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'' && startsWith(github.ref, ''refs/tags/'')'
        env:
          GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
        with:
          files: |-
            target/release/deno-x86_64-pc-windows-msvc.zip
            target/release/deno-x86_64-pc-windows-msvc.zip.sha256sum
            target/release/denort-x86_64-pc-windows-msvc.zip
            target/release/denort-x86_64-pc-windows-msvc.zip.sha256sum
            target/release/deno-aarch64-pc-windows-msvc.zip
            target/release/deno-aarch64-pc-windows-msvc.zip.sha256sum
            target/release/denort-aarch64-pc-windows-msvc.zip
            target/release/denort-aarch64-pc-windows-msvc.zip.sha256sum
            target/release/deno-x86_64-unknown-linux-gnu.zip
            target/release/deno-x86_64-unknown-linux-gnu.zip.sha256sum
            target/release/denort-x86_64-unknown-linux-gnu.zip
            target/release/denort-x86_64-unknown-linux-gnu.zip.sha256sum
            target/release/deno-x86_64-apple-darwin.zip
            target/release/deno-x86_64-apple-darwin.zip.sha256sum
            target/release/denort-x86_64-apple-darwin.zip
            target/release/denort-x86_64-apple-darwin.zip.sha256sum
            target/release/deno-aarch64-unknown-linux-gnu.zip
            target/release/deno-aarch64-unknown-linux-gnu.zip.sha256sum
            target/release/denort-aarch64-unknown-linux-gnu.zip
            target/release/denort-aarch64-unknown-linux-gnu.zip.sha256sum
            target/release/deno-aarch64-apple-darwin.zip
            target/release/deno-aarch64-apple-darwin.zip.sha256sum
            target/release/denort-aarch64-apple-darwin.zip
            target/release/denort-aarch64-apple-darwin.zip.sha256sum
            target/release/deno_src.tar.gz
            target/release/lib.deno.d.ts
          body_path: target/release/release-notes.md
          draft: true
  test-release-windows-aarch64:
    name: 'test ${{ matrix.test_crate }} ${{ matrix.shard_label }}release windows-aarch64'
    needs:
      - build-release-windows-aarch64
    runs-on: '${{ !contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'' && ''ubuntu-24.04'' || ''windows-11-arm'' }}'
    timeout-minutes: 30
    defaults:
      run:
        shell: bash
    strategy:
      matrix:
        include:
          - test_crate: integration
            test_package: integration_tests
            shard_index: '0'
            shard_total: '2'
            shard_label: '(1/2) '
          - test_crate: integration
            test_package: integration_tests
            shard_index: '1'
            shard_total: '2'
            shard_label: '(2/2) '
          - test_crate: node_compat
            test_package: node_compat_tests
            shard_index: '0'
            shard_total: '1'
            shard_label: ''
          - test_crate: specs
            test_package: specs_tests
            shard_index: '0'
            shard_total: '2'
            shard_label: '(1/2) '
          - test_crate: specs
            test_package: specs_tests
            shard_index: '1'
            shard_total: '2'
            shard_label: '(2/2) '
          - test_crate: unit
            test_package: unit_tests
            shard_index: '0'
            shard_total: '1'
            shard_label: ''
          - test_crate: unit_node
            test_package: unit_node_tests
            shard_index: '0'
            shard_total: '1'
            shard_label: ''
      fail-fast: false
    env:
      CARGO_TERM_COLOR: always
      RUST_BACKTRACE: full
      RUST_LIB_BACKTRACE: 0
    steps:
      - name: Configure git
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        run: |-
          git config --global core.symlinks true
          git config --global fetch.parallel 32
      - name: Clone repository
        uses: actions/checkout@v6
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        with:
          fetch-depth: 5
          submodules: false
      - name: Clone submodule ./tests/node_compat/runner/suite
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && matrix.test_crate == ''node_compat'''
        run: git submodule update --init --recursive --depth=1 -- ./tests/node_compat/runner/suite
      - name: Clone submodule ./tests/util/std
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        run: git submodule update --init --recursive --depth=1 -- ./tests/util/std
      - name: Restore cache cargo home
        uses: actions/cache/restore@v4
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        with:
          path: |-
            ~/.cargo/.crates.toml
            ~/.cargo/.crates2.json
            ~/.cargo/bin
            ~/.cargo/registry/index
            ~/.cargo/registry/cache
            ~/.cargo/git/db
          key: never_saved
          restore-keys: '106-cargo-home-windows-aarch64-test-${{ matrix.test_crate }}-'
      - name: Restore cache build output
        uses: actions/cache/restore@v4
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && github.ref != ''refs/heads/main'''
        with:
          path: |-
            ./target
            !./target/*/gn_out
            !./target/*/gn_root
            !./target/*/*.zip
            !./target/*/*.tar.gz
          key: never_saved
          restore-keys: '106-cargo-target-windows-aarch64-release-test-${{ matrix.test_crate }}-'
      - name: Apply and update mtime cache
        uses: ./.github/mtime_cache
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        with:
          cache-path: ./target
      - name: Install Node
        uses: actions/setup-node@v6
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        with:
          node-version: 22
      - uses: dsherret/rust-toolchain-file@v1
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
      - name: Download artifact release-windows-aarch64-deno
        uses: actions/download-artifact@v6
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        with:
          name: release-windows-aarch64-deno
          path: target/release
      - name: Download artifact release-windows-aarch64-denort
        uses: actions/download-artifact@v6
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && (matrix.test_crate == ''integration'' || matrix.test_crate == ''specs'')'
        with:
          name: release-windows-aarch64-denort
          path: target/release
      - name: Download artifact release-windows-aarch64-test-server
        uses: actions/download-artifact@v6
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && (matrix.test_crate == ''integration'' || matrix.test_crate == ''specs'' || matrix.test_crate == ''unit'' || matrix.test_crate == ''unit_node'')'
        with:
          name: release-windows-aarch64-test-server
          path: target/release
      - name: Set up playwright cache
        uses: actions/cache@v5
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        with:
          path: ./.ms-playwright
          key: 'playwright-${{ runner.os }}-${{ runner.arch }}'
      - name: Build ffi (release)
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && matrix.test_crate == ''specs'''
        run: cargo build --release -p test_ffi
      - name: Test (release)
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && github.repository == ''denoland/deno'''
        env:
          CI_SHARD_INDEX: '${{ github.event_name == ''pull_request'' && matrix.shard_index || '''' }}'
          CI_SHARD_TOTAL: '${{ github.event_name == ''pull_request'' && matrix.shard_total || '''' }}'
        run: 'cargo test -p ${{ matrix.test_package }} --test ${{ matrix.test_crate }} --release'
      - name: Ensure no git changes
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.event_name == ''pull_request'''
        run: "if [[ -n \"$(git status --porcelain)\" ]]; then\necho \"❌ Git working directory is dirty. Ensure `cargo test` is not modifying git tracked files.\"\necho \"\"\necho \"\U0001F4CB Status:\"\ngit status\necho \"\"\nexit 1\nfi"
      - name: Upload test results
        uses: actions/upload-artifact@v6
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && always()'
        with:
          name: 'test-results-windows-aarch64-release-${{ matrix.test_crate }}${{ matrix.shard_total > 1 && format(''-shard-{0}'', matrix.shard_index) || '''' }}.json'
          path: 'target/test_results_${{ matrix.test_crate }}.json'
  build-release-linux-x86_64:
    name: build release linux-x86_64
    needs:
      - pre_build
    if: needs.pre_build.outputs.skip_build != 'true'
    runs-on: ubuntu-24.04
    environment:
      name: '${{ (github.ref == ''refs/heads/main'' || startsWith(github.ref, ''refs/tags/'')) && ''build'' || '''' }}'
    timeout-minutes: 240
    defaults:
      run:
        shell: bash
    env:
      CARGO_TERM_COLOR: always
      RUST_BACKTRACE: full
      RUST_LIB_BACKTRACE: 0
    steps:
      - name: Configure git
        run: |-
          git config --global core.symlinks true
          git config --global fetch.parallel 32
      - name: Clone repository
        uses: actions/checkout@v6
        with:
          fetch-depth: 5
          submodules: false
      - name: Clone submodule ./tests/util/std
        run: git submodule update --init --recursive --depth=1 -- ./tests/util/std
      - name: 'Create source tarballs (release, linux)'
        if: 'github.repository == ''denoland/deno'' && startsWith(github.ref, ''refs/tags/'')'
        run: |-
          mkdir -p target/release
          tar --exclude=".git*" --exclude=target --exclude=third_party/prebuilt \
              -czvf target/release/deno_src.tar.gz -C .. deno
      - name: Restore cache cargo home
        uses: actions/cache/restore@v4
        if: '!startsWith(github.ref, ''refs/tags/'')'
        with:
          path: |-
            ~/.cargo/.crates.toml
            ~/.cargo/.crates2.json
            ~/.cargo/bin
            ~/.cargo/registry/index
            ~/.cargo/registry/cache
            ~/.cargo/git/db
          key: never_saved
          restore-keys: 106-cargo-home-linux-x86_64-build-main-
      - name: Restore cache build output
        uses: actions/cache/restore@v4
        if: 'github.ref != ''refs/heads/main'' && !startsWith(github.ref, ''refs/tags/'')'
        with:
          path: |-
            ./target
            !./target/*/gn_out
            !./target/*/gn_root
            !./target/*/*.zip
            !./target/*/*.tar.gz
          key: never_saved
          restore-keys: 106-cargo-target-linux-x86_64-release-build-main-
      - name: Apply and update mtime cache
        uses: ./.github/mtime_cache
        with:
          cache-path: ./target
      - uses: dsherret/rust-toolchain-file@v1
      - name: Set up incremental LTO and sysroot build
        run: |-
          # Setting up sysroot
          export DEBIAN_FRONTEND=noninteractive
          # Avoid running man-db triggers, which sometimes takes several minutes
          # to complete.
          sudo apt-get -qq remove --purge -y man-db > /dev/null 2> /dev/null
          # Remove older clang before we install
          sudo apt-get -qq remove   'clang-12*' 'clang-13*' 'clang-14*' 'clang-15*' 'clang-16*' 'clang-17*' 'clang-18*' 'clang-19*' 'llvm-12*' 'llvm-13*' 'llvm-14*' 'llvm-15*' 'llvm-16*' 'llvm-17*' 'llvm-18*' 'llvm-19*' 'lld-12*' 'lld-13*' 'lld-14*' 'lld-15*' 'lld-16*' 'lld-17*' 'lld-18*' 'lld-19*' > /dev/null 2> /dev/null

          # Install clang-XXX, lld-XXX, and debootstrap.
          echo "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-21 main" |
            sudo dd of=/etc/apt/sources.list.d/llvm-toolchain-noble-21.list
          curl https://apt.llvm.org/llvm-snapshot.gpg.key |
            gpg --dearmor                                 |
          sudo dd of=/etc/apt/trusted.gpg.d/llvm-snapshot.gpg
          sudo apt-get update
          # this was unreliable sometimes, so try again if it fails
          sudo apt-get install -y --no-install-recommends clang-21 lld-21 clang-tools-21 clang-format-21 clang-tidy-21 || (echo 'Failed. Trying again.' && sudo apt-get clean && sudo apt-get update && sudo apt-get install -y --no-install-recommends clang-21 lld-21 clang-tools-21 clang-format-21 clang-tidy-21)
          # Fix alternatives
          (yes '' | sudo update-alternatives --force --all) > /dev/null 2> /dev/null || true

          clang-21 -c -o /tmp/memfd_create_shim.o tools/memfd_create_shim.c -fPIC

          echo "Decompressing sysroot..."
          wget -q https://github.com/denoland/deno_sysroot_build/releases/download/sysroot-20250207/sysroot-`uname -m`.tar.xz -O /tmp/sysroot.tar.xz
          cd /
          xzcat /tmp/sysroot.tar.xz | sudo tar -x
          sudo mount --rbind /dev /sysroot/dev
          sudo mount --rbind /sys /sysroot/sys
          sudo mount --rbind /home /sysroot/home
          sudo mount -t proc /proc /sysroot/proc
          cd

          echo "Done."

          # Configure the build environment. Both Rust and Clang will produce
          # llvm bitcode only, so we can use lld's incremental LTO support.

          # Load the sysroot's env vars
          echo "sysroot env:"
          cat /sysroot/.env
          . /sysroot/.env

          # Important notes:
          #   1. -ldl seems to be required to avoid a failure in FFI tests. This flag seems
          #      to be in the Rust default flags in the smoketest, so uncertain why we need
          #      to be explicit here.
          #   2. RUSTFLAGS and RUSTDOCFLAGS must be specified, otherwise the doctests fail
          #      to build because the object formats are not compatible.
          echo "
          CARGO_PROFILE_BENCH_INCREMENTAL=false
          CARGO_PROFILE_RELEASE_INCREMENTAL=false
          RUSTFLAGS<<__1
            -C linker-plugin-lto=true
            -C linker=clang-21
            -C link-arg=-fuse-ld=lld-21
            -C link-arg=-ldl
            -C link-arg=-Wl,--allow-shlib-undefined
            -C link-arg=-Wl,--thinlto-cache-dir=$(pwd)/target/release/lto-cache
            -C link-arg=-Wl,--thinlto-cache-policy,cache_size_bytes=700m
            -C link-arg=/tmp/memfd_create_shim.o
            --cfg tokio_unstable
            $RUSTFLAGS
          __1
          RUSTDOCFLAGS<<__1
            -C linker-plugin-lto=true
            -C linker=clang-21
            -C link-arg=-fuse-ld=lld-21
            -C link-arg=-ldl
            -C link-arg=-Wl,--allow-shlib-undefined
            -C link-arg=-Wl,--thinlto-cache-dir=$(pwd)/target/release/lto-cache
            -C link-arg=-Wl,--thinlto-cache-policy,cache_size_bytes=700m
            -C link-arg=/tmp/memfd_create_shim.o
            --cfg tokio_unstable
            $RUSTFLAGS
          __1
          CC=/usr/bin/clang-21
          CFLAGS=$CFLAGS
          " > $GITHUB_ENV
      - name: Configure canary build
        if: '!startsWith(github.ref, ''refs/tags/'')'
        run: echo "DENO_CANARY=true" >> $GITHUB_ENV
      - name: Build release
        run: |-
          df -h
          cargo build --release --locked --bin deno --bin denort --bin test_server --features=panic-trace
          df -h
      - name: Generate symcache
        env:
          NO_COLOR: 1
        run: |-
          target/release/deno -A tools/release/create_symcache.ts ./deno.symcache
          du -h deno.symcache
          du -h target/release/deno
      - name: Pre-release (linux)
        if: github.repository == 'denoland/deno'
        run: |-
          cd target/release
          ./deno -A ../../tools/release/create_symcache.ts deno-x86_64-unknown-linux-gnu.symcache
          strip ./deno
          zip -r deno-x86_64-unknown-linux-gnu.zip deno
          shasum -a 256 deno-x86_64-unknown-linux-gnu.zip > deno-x86_64-unknown-linux-gnu.zip.sha256sum
          strip ./denort
          zip -r denort-x86_64-unknown-linux-gnu.zip denort
          shasum -a 256 denort-x86_64-unknown-linux-gnu.zip > denort-x86_64-unknown-linux-gnu.zip.sha256sum
          ./deno types > lib.deno.d.ts
      - name: Authenticate with Google Cloud
        uses: google-github-actions/auth@v3
        if: 'github.repository == ''denoland/deno'' && (github.ref == ''refs/heads/main'' || startsWith(github.ref, ''refs/tags/''))'
        with:
          project_id: denoland
          credentials_json: '${{ secrets.GCP_SA_KEY }}'
          export_environment_variables: true
          create_credentials_file: true
      - name: Setup gcloud (unix)
        uses: google-github-actions/setup-gcloud@v3
        if: 'github.repository == ''denoland/deno'' && (github.ref == ''refs/heads/main'' || startsWith(github.ref, ''refs/tags/''))'
        with:
          project_id: denoland
      - name: Log versions
        run: |-
          echo '*** Python'
          command -v python && python --version || echo 'No python found or bad executable'
          echo '*** Rust'
          command -v rustc && rustc --version || echo 'No rustc found or bad executable'
          echo '*** Cargo'
          command -v cargo && cargo --version || echo 'No cargo found or bad executable'
          echo '*** Deno'
          command -v deno && deno --version || echo 'No deno found or bad executable'
          echo '*** Node'
          command -v node && node --version || echo 'No node found or bad executable'
          echo '*** Installed packages'
          command -v dpkg && dpkg -l || echo 'No dpkg found or bad executable'
      - name: Upload canary to dl.deno.land
        if: github.repository == 'denoland/deno' && github.ref == 'refs/heads/main'
        env:
          AWS_ACCESS_KEY_ID: '${{ vars.S3_ACCESS_KEY_ID }}'
          AWS_SECRET_ACCESS_KEY: '${{ secrets.S3_SECRET_ACCESS_KEY }}'
          AWS_ENDPOINT_URL_S3: '${{ vars.S3_ENDPOINT }}'
          AWS_DEFAULT_REGION: '${{ vars.S3_REGION }}'
        run: |-
          gsutil -h "Cache-Control: public, max-age=3600" cp ./target/release/*.zip gs://dl.deno.land/canary/$(git rev-parse HEAD)/
          gsutil -h "Cache-Control: public, max-age=3600" cp ./target/release/*.sha256sum gs://dl.deno.land/canary/$(git rev-parse HEAD)/
          gsutil -h "Cache-Control: public, max-age=3600" cp ./target/release/*.symcache gs://dl.deno.land/canary/$(git rev-parse HEAD)/
          aws s3 sync ./target/release/ s3://dl-deno-land/canary/$(git rev-parse HEAD)/ --exclude "*" --include "*.zip"
          aws s3 sync ./target/release/ s3://dl-deno-land/canary/$(git rev-parse HEAD)/ --exclude "*" --include "*.sha256sum"
          aws s3 sync ./target/release/ s3://dl-deno-land/canary/$(git rev-parse HEAD)/ --exclude "*" --include "*.symcache"
          echo ${{ github.sha }} > canary-latest.txt
          gsutil -h "Cache-Control: no-cache" cp canary-latest.txt gs://dl.deno.land/canary-$(rustc -vV | sed -n "s|host: ||p")-latest.txt
          aws s3 cp canary-latest.txt s3://dl-deno-land/canary-$(rustc -vV | sed -n "s|host: ||p")-latest.txt
          rm canary-latest.txt gha-creds-*.json
      - name: Build product size info
        if: 'github.ref == ''refs/heads/main'' || startsWith(github.ref, ''refs/tags/'')'
        run: |-
          du -hd1 "./target/release"
          du -ha  "./target/release/deno"
          du -ha  "./target/release/denort"
      - name: Check deno binary
        env:
          NO_COLOR: 1
        run: target/release/deno eval "console.log(1+2)" | grep 3
      - name: Check deno binary (in sysroot)
        run: sudo chroot /sysroot "$(pwd)/target/release/deno" --version
      - name: Upload artifact release-linux-x86_64-deno
        uses: actions/upload-artifact@v6
        with:
          name: release-linux-x86_64-deno
          path: target/release/deno
          retention-days: 3
      - name: Upload artifact release-linux-x86_64-denort
        uses: actions/upload-artifact@v6
        with:
          name: release-linux-x86_64-denort
          path: target/release/denort
          retention-days: 3
      - name: Upload artifact release-linux-x86_64-test-server
        uses: actions/upload-artifact@v6
        with:
          name: release-linux-x86_64-test-server
          path: target/release/test_server
          retention-days: 3
      - name: Upload release to dl.deno.land (unix)
        if: 'github.repository == ''denoland/deno'' && startsWith(github.ref, ''refs/tags/'')'
        env:
          AWS_ACCESS_KEY_ID: '${{ vars.S3_ACCESS_KEY_ID }}'
          AWS_SECRET_ACCESS_KEY: '${{ secrets.S3_SECRET_ACCESS_KEY }}'
          AWS_ENDPOINT_URL_S3: '${{ vars.S3_ENDPOINT }}'
          AWS_DEFAULT_REGION: '${{ vars.S3_REGION }}'
        run: |-
          gsutil -h "Cache-Control: public, max-age=3600" cp ./target/release/*.zip gs://dl.deno.land/release/${GITHUB_REF#refs/*/}/
          gsutil -h "Cache-Control: public, max-age=3600" cp ./target/release/*.sha256sum gs://dl.deno.land/release/${GITHUB_REF#refs/*/}/
          gsutil -h "Cache-Control: public, max-age=3600" cp ./target/release/*.symcache gs://dl.deno.land/release/${GITHUB_REF#refs/*/}/
          aws s3 sync ./target/release/ s3://dl-deno-land/release/${GITHUB_REF#refs/*/}/ --exclude "*" --include "*.zip"
          aws s3 sync ./target/release/ s3://dl-deno-land/release/${GITHUB_REF#refs/*/}/ --exclude "*" --include "*.sha256sum"
          aws s3 sync ./target/release/ s3://dl-deno-land/release/${GITHUB_REF#refs/*/}/ --exclude "*" --include "*.symcache"
      - name: Create release notes
        if: 'github.repository == ''denoland/deno'' && startsWith(github.ref, ''refs/tags/'')'
        run: |-
          export PATH=$PATH:$(pwd)/target/release
          ./tools/release/05_create_release_notes.ts
      - name: Upload release to GitHub
        uses: softprops/action-gh-release@v2
        if: 'github.repository == ''denoland/deno'' && startsWith(github.ref, ''refs/tags/'')'
        env:
          GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
        with:
          files: |-
            target/release/deno-x86_64-pc-windows-msvc.zip
            target/release/deno-x86_64-pc-windows-msvc.zip.sha256sum
            target/release/denort-x86_64-pc-windows-msvc.zip
            target/release/denort-x86_64-pc-windows-msvc.zip.sha256sum
            target/release/deno-aarch64-pc-windows-msvc.zip
            target/release/deno-aarch64-pc-windows-msvc.zip.sha256sum
            target/release/denort-aarch64-pc-windows-msvc.zip
            target/release/denort-aarch64-pc-windows-msvc.zip.sha256sum
            target/release/deno-x86_64-unknown-linux-gnu.zip
            target/release/deno-x86_64-unknown-linux-gnu.zip.sha256sum
            target/release/denort-x86_64-unknown-linux-gnu.zip
            target/release/denort-x86_64-unknown-linux-gnu.zip.sha256sum
            target/release/deno-x86_64-apple-darwin.zip
            target/release/deno-x86_64-apple-darwin.zip.sha256sum
            target/release/denort-x86_64-apple-darwin.zip
            target/release/denort-x86_64-apple-darwin.zip.sha256sum
            target/release/deno-aarch64-unknown-linux-gnu.zip
            target/release/deno-aarch64-unknown-linux-gnu.zip.sha256sum
            target/release/denort-aarch64-unknown-linux-gnu.zip
            target/release/denort-aarch64-unknown-linux-gnu.zip.sha256sum
            target/release/deno-aarch64-apple-darwin.zip
            target/release/deno-aarch64-apple-darwin.zip.sha256sum
            target/release/denort-aarch64-apple-darwin.zip
            target/release/denort-aarch64-apple-darwin.zip.sha256sum
            target/release/deno_src.tar.gz
            target/release/lib.deno.d.ts
          body_path: target/release/release-notes.md
          draft: true
      - name: Cache cargo home
        uses: actions/cache/save@v4
        if: 'github.ref == ''refs/heads/main'' && !startsWith(github.ref, ''refs/tags/'')'
        with:
          path: |-
            ~/.cargo/.crates.toml
            ~/.cargo/.crates2.json
            ~/.cargo/bin
            ~/.cargo/registry/index
            ~/.cargo/registry/cache
            ~/.cargo/git/db
          key: '106-cargo-home-linux-x86_64-build-main-${{ github.sha }}'
      - name: Cache build output
        uses: actions/cache/save@v4
        if: 'github.ref == ''refs/heads/main'' && !startsWith(github.ref, ''refs/tags/'')'
        with:
          path: |-
            ./target
            !./target/*/gn_out
            !./target/*/gn_root
            !./target/*/*.zip
            !./target/*/*.tar.gz
          key: '106-cargo-target-linux-x86_64-release-build-main-${{ github.sha }}'
  test-release-linux-x86_64:
    name: 'test ${{ matrix.test_crate }} ${{ matrix.shard_label }}release linux-x86_64'
    needs:
      - build-release-linux-x86_64
    runs-on: ubuntu-24.04
    timeout-minutes: 30
    defaults:
      run:
        shell: bash
    strategy:
      matrix:
        include:
          - test_crate: integration
            test_package: integration_tests
            shard_index: '0'
            shard_total: '2'
            shard_label: '(1/2) '
          - test_crate: integration
            test_package: integration_tests
            shard_index: '1'
            shard_total: '2'
            shard_label: '(2/2) '
          - test_crate: node_compat
            test_package: node_compat_tests
            shard_index: '0'
            shard_total: '1'
            shard_label: ''
          - test_crate: specs
            test_package: specs_tests
            shard_index: '0'
            shard_total: '2'
            shard_label: '(1/2) '
          - test_crate: specs
            test_package: specs_tests
            shard_index: '1'
            shard_total: '2'
            shard_label: '(2/2) '
          - test_crate: unit
            test_package: unit_tests
            shard_index: '0'
            shard_total: '1'
            shard_label: ''
          - test_crate: unit_node
            test_package: unit_node_tests
            shard_index: '0'
            shard_total: '1'
            shard_label: ''
      fail-fast: false
    env:
      CARGO_TERM_COLOR: always
      RUST_BACKTRACE: full
      RUST_LIB_BACKTRACE: 0
    steps:
      - name: Configure git
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        run: |-
          git config --global core.symlinks true
          git config --global fetch.parallel 32
      - name: Clone repository
        uses: actions/checkout@v6
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        with:
          fetch-depth: 5
          submodules: false
      - name: Clone submodule ./tests/node_compat/runner/suite
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && matrix.test_crate == ''node_compat'''
        run: git submodule update --init --recursive --depth=1 -- ./tests/node_compat/runner/suite
      - name: Clone submodule ./tests/util/std
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        run: git submodule update --init --recursive --depth=1 -- ./tests/util/std
      - name: Restore cache cargo home
        uses: actions/cache/restore@v4
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        with:
          path: |-
            ~/.cargo/.crates.toml
            ~/.cargo/.crates2.json
            ~/.cargo/bin
            ~/.cargo/registry/index
            ~/.cargo/registry/cache
            ~/.cargo/git/db
          key: never_saved
          restore-keys: '106-cargo-home-linux-x86_64-test-${{ matrix.test_crate }}-'
      - name: Restore cache build output
        uses: actions/cache/restore@v4
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && github.ref != ''refs/heads/main'''
        with:
          path: |-
            ./target
            !./target/*/gn_out
            !./target/*/gn_root
            !./target/*/*.zip
            !./target/*/*.tar.gz
          key: never_saved
          restore-keys: '106-cargo-target-linux-x86_64-release-test-${{ matrix.test_crate }}-'
      - name: Apply and update mtime cache
        uses: ./.github/mtime_cache
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        with:
          cache-path: ./target
      - name: Install Node
        uses: actions/setup-node@v6
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        with:
          node-version: 22
      - uses: dsherret/rust-toolchain-file@v1
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
      - name: Set up incremental LTO and sysroot build
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        run: |-
          # Setting up sysroot
          export DEBIAN_FRONTEND=noninteractive
          # Avoid running man-db triggers, which sometimes takes several minutes
          # to complete.
          sudo apt-get -qq remove --purge -y man-db > /dev/null 2> /dev/null
          # Remove older clang before we install
          sudo apt-get -qq remove   'clang-12*' 'clang-13*' 'clang-14*' 'clang-15*' 'clang-16*' 'clang-17*' 'clang-18*' 'clang-19*' 'llvm-12*' 'llvm-13*' 'llvm-14*' 'llvm-15*' 'llvm-16*' 'llvm-17*' 'llvm-18*' 'llvm-19*' 'lld-12*' 'lld-13*' 'lld-14*' 'lld-15*' 'lld-16*' 'lld-17*' 'lld-18*' 'lld-19*' > /dev/null 2> /dev/null

          # Install clang-XXX, lld-XXX, and debootstrap.
          echo "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-21 main" |
            sudo dd of=/etc/apt/sources.list.d/llvm-toolchain-noble-21.list
          curl https://apt.llvm.org/llvm-snapshot.gpg.key |
            gpg --dearmor                                 |
          sudo dd of=/etc/apt/trusted.gpg.d/llvm-snapshot.gpg
          sudo apt-get update
          # this was unreliable sometimes, so try again if it fails
          sudo apt-get install -y --no-install-recommends clang-21 lld-21 clang-tools-21 clang-format-21 clang-tidy-21 || (echo 'Failed. Trying again.' && sudo apt-get clean && sudo apt-get update && sudo apt-get install -y --no-install-recommends clang-21 lld-21 clang-tools-21 clang-format-21 clang-tidy-21)
          # Fix alternatives
          (yes '' | sudo update-alternatives --force --all) > /dev/null 2> /dev/null || true

          clang-21 -c -o /tmp/memfd_create_shim.o tools/memfd_create_shim.c -fPIC

          echo "Decompressing sysroot..."
          wget -q https://github.com/denoland/deno_sysroot_build/releases/download/sysroot-20250207/sysroot-`uname -m`.tar.xz -O /tmp/sysroot.tar.xz
          cd /
          xzcat /tmp/sysroot.tar.xz | sudo tar -x
          sudo mount --rbind /dev /sysroot/dev
          sudo mount --rbind /sys /sysroot/sys
          sudo mount --rbind /home /sysroot/home
          sudo mount -t proc /proc /sysroot/proc
          cd

          echo "Done."

          # Configure the build environment. Both Rust and Clang will produce
          # llvm bitcode only, so we can use lld's incremental LTO support.

          # Load the sysroot's env vars
          echo "sysroot env:"
          cat /sysroot/.env
          . /sysroot/.env

          # Important notes:
          #   1. -ldl seems to be required to avoid a failure in FFI tests. This flag seems
          #      to be in the Rust default flags in the smoketest, so uncertain why we need
          #      to be explicit here.
          #   2. RUSTFLAGS and RUSTDOCFLAGS must be specified, otherwise the doctests fail
          #      to build because the object formats are not compatible.
          echo "
          CARGO_PROFILE_BENCH_INCREMENTAL=false
          CARGO_PROFILE_RELEASE_INCREMENTAL=false
          RUSTFLAGS<<__1
            -C linker-plugin-lto=true
            -C linker=clang-21
            -C link-arg=-fuse-ld=lld-21
            -C link-arg=-ldl
            -C link-arg=-Wl,--allow-shlib-undefined
            -C link-arg=-Wl,--thinlto-cache-dir=$(pwd)/target/release/lto-cache
            -C link-arg=-Wl,--thinlto-cache-policy,cache_size_bytes=700m
            -C link-arg=/tmp/memfd_create_shim.o
            --cfg tokio_unstable
            $RUSTFLAGS
          __1
          RUSTDOCFLAGS<<__1
            -C linker-plugin-lto=true
            -C linker=clang-21
            -C link-arg=-fuse-ld=lld-21
            -C link-arg=-ldl
            -C link-arg=-Wl,--allow-shlib-undefined
            -C link-arg=-Wl,--thinlto-cache-dir=$(pwd)/target/release/lto-cache
            -C link-arg=-Wl,--thinlto-cache-policy,cache_size_bytes=700m
            -C link-arg=/tmp/memfd_create_shim.o
            --cfg tokio_unstable
            $RUSTFLAGS
          __1
          CC=/usr/bin/clang-21
          CFLAGS=$CFLAGS
          " > $GITHUB_ENV
      - name: Download artifact release-linux-x86_64-deno
        uses: actions/download-artifact@v6
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        with:
          name: release-linux-x86_64-deno
          path: target/release
      - name: Set target/release/deno permissions
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        run: chmod +x target/release/deno
      - name: Download artifact release-linux-x86_64-denort
        uses: actions/download-artifact@v6
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && (matrix.test_crate == ''integration'' || matrix.test_crate == ''specs'')'
        with:
          name: release-linux-x86_64-denort
          path: target/release
      - name: Set target/release/denort permissions
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && (matrix.test_crate == ''integration'' || matrix.test_crate == ''specs'')'
        run: chmod +x target/release/denort
      - name: Download artifact release-linux-x86_64-test-server
        uses: actions/download-artifact@v6
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && (matrix.test_crate == ''integration'' || matrix.test_crate == ''specs'' || matrix.test_crate == ''unit'' || matrix.test_crate == ''unit_node'')'
        with:
          name: release-linux-x86_64-test-server
          path: target/release
      - name: Set target/release/test_server permissions
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && (matrix.test_crate == ''integration'' || matrix.test_crate == ''specs'' || matrix.test_crate == ''unit'' || matrix.test_crate == ''unit_node'')'
        run: chmod +x target/release/test_server
      - name: Set up playwright cache
        uses: actions/cache@v5
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        with:
          path: ./.ms-playwright
          key: 'playwright-${{ runner.os }}-${{ runner.arch }}'
      - name: Build ffi (release)
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && matrix.test_crate == ''specs'''
        run: cargo build --release -p test_ffi
      - name: Test (release)
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        env:
          CI_SHARD_INDEX: '${{ github.event_name == ''pull_request'' && matrix.shard_index || '''' }}'
          CI_SHARD_TOTAL: '${{ github.event_name == ''pull_request'' && matrix.shard_total || '''' }}'
        run: 'cargo test -p ${{ matrix.test_package }} --test ${{ matrix.test_crate }} --release'
      - name: Ensure no git changes
        if: '!startsWith(github.ref, ''refs/tags/'') && github.event_name == ''pull_request'''
        run: "if [[ -n \"$(git status --porcelain)\" ]]; then\necho \"❌ Git working directory is dirty. Ensure `cargo test` is not modifying git tracked files.\"\necho \"\"\necho \"\U0001F4CB Status:\"\ngit status\necho \"\"\nexit 1\nfi"
      - name: Upload test results
        uses: actions/upload-artifact@v6
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && always()'
        with:
          name: 'test-results-linux-x86_64-release-${{ matrix.test_crate }}${{ matrix.shard_total > 1 && format(''-shard-{0}'', matrix.shard_index) || '''' }}.json'
          path: 'target/test_results_${{ matrix.test_crate }}.json'
      - name: Cache cargo home
        uses: actions/cache/save@v4
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && github.ref == ''refs/heads/main'''
        with:
          path: |-
            ~/.cargo/.crates.toml
            ~/.cargo/.crates2.json
            ~/.cargo/bin
            ~/.cargo/registry/index
            ~/.cargo/registry/cache
            ~/.cargo/git/db
          key: '106-cargo-home-linux-x86_64-test-${{ matrix.test_crate }}-${{ github.sha }}'
      - name: Cache build output
        uses: actions/cache/save@v4
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && github.ref == ''refs/heads/main'''
        with:
          path: |-
            ./target
            !./target/*/gn_out
            !./target/*/gn_root
            !./target/*/*.zip
            !./target/*/*.tar.gz
          key: '106-cargo-target-linux-x86_64-release-test-${{ matrix.test_crate }}-${{ github.sha }}'
  wpt-release-linux-x86_64:
    name: wpt release linux-x86_64
    needs:
      - build-release-linux-x86_64
    runs-on: ubuntu-24.04
    timeout-minutes: 30
    defaults:
      run:
        shell: bash
    env:
      CARGO_TERM_COLOR: always
      RUST_BACKTRACE: full
      RUST_LIB_BACKTRACE: 0
    steps:
      - name: Configure git
        if: '!startsWith(github.ref, ''refs/tags/'')'
        run: |-
          git config --global core.symlinks true
          git config --global fetch.parallel 32
      - name: Clone repository
        uses: actions/checkout@v6
        if: '!startsWith(github.ref, ''refs/tags/'')'
        with:
          fetch-depth: 5
          submodules: false
      - name: Clone submodule ./tests/util/std
        if: '!startsWith(github.ref, ''refs/tags/'')'
        run: git submodule update --init --recursive --depth=1 -- ./tests/util/std
      - name: Clone submodule ./tests/wpt/suite
        if: '!startsWith(github.ref, ''refs/tags/'')'
        run: git submodule update --init --recursive --depth=1 -- ./tests/wpt/suite
      - name: Restore cache wpt and autobahn test run hashes
        uses: actions/cache/restore@v4
        if: '!startsWith(github.ref, ''refs/tags/'')'
        with:
          path: |-
            ./target/wpt_input_hash
            ./target/autobahn_input_hash
          key: never_saved
          restore-keys: 106-wpt-target-linux-x86_64-release-
      - name: Install Deno
        uses: denoland/setup-deno@v2
        if: '!startsWith(github.ref, ''refs/tags/'')'
        with:
          deno-version: v2.x
      - name: Install Python
        uses: actions/setup-python@v6
        if: '!startsWith(github.ref, ''refs/tags/'')'
        with:
          python-version: 3.11
      - name: Download artifact release-linux-x86_64-deno
        uses: actions/download-artifact@v6
        if: '!startsWith(github.ref, ''refs/tags/'')'
        with:
          name: release-linux-x86_64-deno
          path: target/release
      - name: Set target/release/deno permissions
        if: '!startsWith(github.ref, ''refs/tags/'')'
        run: chmod +x target/release/deno
      - name: Configure hosts file for WPT
        if: '!startsWith(github.ref, ''refs/tags/'')'
        working-directory: tests/wpt/suite/
        run: ./wpt make-hosts-file | sudo tee -a /etc/hosts
      - name: Run web platform tests (release)
        if: '!startsWith(github.ref, ''refs/tags/'')'
        env:
          DENO_BIN: ./target/release/deno
        run: |-
          deno run -RWNE --allow-run --lock=tools/deno.lock.json --config tests/config/deno.json \
              ./tests/wpt/wpt.ts setup
          deno run -RWNE --allow-run --lock=tools/deno.lock.json --config tests/config/deno.json --unsafely-ignore-certificate-errors \
              ./tests/wpt/wpt.ts run --all --quiet --release --binary="$DENO_BIN" --json=wpt.json --wptreport=wptreport.json
      - name: Autobahn testsuite
        if: '!startsWith(github.ref, ''refs/tags/'')'
        run: target/release/deno run -A --config tests/config/deno.json ext/websocket/autobahn/fuzzingclient.js
      - name: Authenticate with Google Cloud
        uses: google-github-actions/auth@v3
        if: '!startsWith(github.ref, ''refs/tags/'') && github.repository == ''denoland/deno'' && github.ref == ''refs/heads/main'''
        with:
          project_id: denoland
          credentials_json: '${{ secrets.GCP_SA_KEY }}'
          export_environment_variables: true
          create_credentials_file: true
      - name: Setup gcloud (unix)
        uses: google-github-actions/setup-gcloud@v3
        if: '!startsWith(github.ref, ''refs/tags/'') && github.repository == ''denoland/deno'' && github.ref == ''refs/heads/main'''
        with:
          project_id: denoland
      - name: Upload wpt results to dl.deno.land
        if: '!startsWith(github.ref, ''refs/tags/'') && github.repository == ''denoland/deno'' && github.ref == ''refs/heads/main'''
        env:
          AWS_ACCESS_KEY_ID: '${{ vars.S3_ACCESS_KEY_ID }}'
          AWS_SECRET_ACCESS_KEY: '${{ secrets.S3_SECRET_ACCESS_KEY }}'
          AWS_ENDPOINT_URL_S3: '${{ vars.S3_ENDPOINT }}'
          AWS_DEFAULT_REGION: '${{ vars.S3_REGION }}'
        continue-on-error: true
        run: |-
          gzip ./wptreport.json
          gsutil -h "Cache-Control: public, max-age=3600" cp ./wpt.json gs://dl.deno.land/wpt/$(git rev-parse HEAD).json
          gsutil -h "Cache-Control: public, max-age=3600" cp ./wptreport.json.gz gs://dl.deno.land/wpt/$(git rev-parse HEAD)-wptreport.json.gz
          aws s3 cp ./wpt.json s3://dl-deno-land/wpt/$(git rev-parse HEAD).json
          aws s3 cp ./wptreport.json.gz s3://dl-deno-land/wpt/$(git rev-parse HEAD)-wptreport.json.gz
          echo $(git rev-parse HEAD) > wpt-latest.txt
          gsutil -h "Cache-Control: no-cache" cp wpt-latest.txt gs://dl.deno.land/wpt-latest.txt
          aws s3 cp wpt-latest.txt s3://dl-deno-land/wpt-latest.txt
      - name: Upload wpt results to wpt.fyi
        if: '!startsWith(github.ref, ''refs/tags/'') && github.repository == ''denoland/deno'' && github.ref == ''refs/heads/main'''
        env:
          WPT_FYI_USER: deno
          WPT_FYI_PW: '${{ secrets.WPT_FYI_PW }}'
          GITHUB_TOKEN: '${{ secrets.DENOBOT_PAT }}'
        continue-on-error: true
        run: |-
          ./target/release/deno run --allow-all --lock=tools/deno.lock.json \
              ./tools/upload_wptfyi.js $(git rev-parse HEAD) --ghstatus
      - name: Cache wpt and autobahn test run hashes
        uses: actions/cache/save@v4
        if: '!startsWith(github.ref, ''refs/tags/'') && github.ref == ''refs/heads/main'''
        with:
          path: |-
            ./target/wpt_input_hash
            ./target/autobahn_input_hash
          key: '106-wpt-target-linux-x86_64-release-${{ github.sha }}'
  build-debug-linux-x86_64:
    name: build debug linux-x86_64
    needs:
      - pre_build
    if: needs.pre_build.outputs.skip_build != 'true'
    runs-on: ubuntu-24.04
    environment:
      name: '${{ (github.ref == ''refs/heads/main'' || startsWith(github.ref, ''refs/tags/'')) && ''build'' || '''' }}'
    timeout-minutes: 240
    defaults:
      run:
        shell: bash
    env:
      CARGO_TERM_COLOR: always
      RUST_BACKTRACE: full
      RUST_LIB_BACKTRACE: 0
    steps:
      - name: Configure git
        run: |-
          git config --global core.symlinks true
          git config --global fetch.parallel 32
      - name: Clone repository
        uses: actions/checkout@v6
        with:
          fetch-depth: 5
          submodules: false
      - name: Clone submodule ./tests/util/std
        run: git submodule update --init --recursive --depth=1 -- ./tests/util/std
      - name: Restore cache cargo home
        uses: actions/cache/restore@v4
        if: '!startsWith(github.ref, ''refs/tags/'')'
        with:
          path: |-
            ~/.cargo/.crates.toml
            ~/.cargo/.crates2.json
            ~/.cargo/bin
            ~/.cargo/registry/index
            ~/.cargo/registry/cache
            ~/.cargo/git/db
          key: never_saved
          restore-keys: 106-cargo-home-linux-x86_64-build-main-
      - name: Restore cache build output
        uses: actions/cache/restore@v4
        if: 'github.ref != ''refs/heads/main'' && !startsWith(github.ref, ''refs/tags/'')'
        with:
          path: |-
            ./target
            !./target/*/gn_out
            !./target/*/gn_root
            !./target/*/*.zip
            !./target/*/*.tar.gz
          key: never_saved
          restore-keys: 106-cargo-target-linux-x86_64-debug-build-main-
      - name: Apply and update mtime cache
        uses: ./.github/mtime_cache
        with:
          cache-path: ./target
      - uses: dsherret/rust-toolchain-file@v1
      - name: Set up incremental LTO and sysroot build
        run: |-
          # Setting up sysroot
          export DEBIAN_FRONTEND=noninteractive
          # Avoid running man-db triggers, which sometimes takes several minutes
          # to complete.
          sudo apt-get -qq remove --purge -y man-db > /dev/null 2> /dev/null
          # Remove older clang before we install
          sudo apt-get -qq remove   'clang-12*' 'clang-13*' 'clang-14*' 'clang-15*' 'clang-16*' 'clang-17*' 'clang-18*' 'clang-19*' 'llvm-12*' 'llvm-13*' 'llvm-14*' 'llvm-15*' 'llvm-16*' 'llvm-17*' 'llvm-18*' 'llvm-19*' 'lld-12*' 'lld-13*' 'lld-14*' 'lld-15*' 'lld-16*' 'lld-17*' 'lld-18*' 'lld-19*' > /dev/null 2> /dev/null

          # Install clang-XXX, lld-XXX, and debootstrap.
          echo "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-21 main" |
            sudo dd of=/etc/apt/sources.list.d/llvm-toolchain-noble-21.list
          curl https://apt.llvm.org/llvm-snapshot.gpg.key |
            gpg --dearmor                                 |
          sudo dd of=/etc/apt/trusted.gpg.d/llvm-snapshot.gpg
          sudo apt-get update
          # this was unreliable sometimes, so try again if it fails
          sudo apt-get install -y --no-install-recommends clang-21 lld-21 clang-tools-21 clang-format-21 clang-tidy-21 || (echo 'Failed. Trying again.' && sudo apt-get clean && sudo apt-get update && sudo apt-get install -y --no-install-recommends clang-21 lld-21 clang-tools-21 clang-format-21 clang-tidy-21)
          # Fix alternatives
          (yes '' | sudo update-alternatives --force --all) > /dev/null 2> /dev/null || true

          clang-21 -c -o /tmp/memfd_create_shim.o tools/memfd_create_shim.c -fPIC

          echo "Decompressing sysroot..."
          wget -q https://github.com/denoland/deno_sysroot_build/releases/download/sysroot-20250207/sysroot-`uname -m`.tar.xz -O /tmp/sysroot.tar.xz
          cd /
          xzcat /tmp/sysroot.tar.xz | sudo tar -x
          sudo mount --rbind /dev /sysroot/dev
          sudo mount --rbind /sys /sysroot/sys
          sudo mount --rbind /home /sysroot/home
          sudo mount -t proc /proc /sysroot/proc
          cd

          echo "Done."

          # Configure the build environment. Both Rust and Clang will produce
          # llvm bitcode only, so we can use lld's incremental LTO support.

          # Load the sysroot's env vars
          echo "sysroot env:"
          cat /sysroot/.env
          . /sysroot/.env

          # Important notes:
          #   1. -ldl seems to be required to avoid a failure in FFI tests. This flag seems
          #      to be in the Rust default flags in the smoketest, so uncertain why we need
          #      to be explicit here.
          #   2. RUSTFLAGS and RUSTDOCFLAGS must be specified, otherwise the doctests fail
          #      to build because the object formats are not compatible.
          echo "
          CARGO_PROFILE_BENCH_INCREMENTAL=false
          CARGO_PROFILE_RELEASE_INCREMENTAL=false
          RUSTFLAGS<<__1
            -C linker-plugin-lto=true
            -C linker=clang-21
            -C link-arg=-fuse-ld=lld-21
            -C link-arg=-ldl
            -C link-arg=-Wl,--allow-shlib-undefined
            -C link-arg=-Wl,--thinlto-cache-dir=$(pwd)/target/release/lto-cache
            -C link-arg=-Wl,--thinlto-cache-policy,cache_size_bytes=700m
            -C link-arg=/tmp/memfd_create_shim.o
            --cfg tokio_unstable
            $RUSTFLAGS
          __1
          RUSTDOCFLAGS<<__1
            -C linker-plugin-lto=true
            -C linker=clang-21
            -C link-arg=-fuse-ld=lld-21
            -C link-arg=-ldl
            -C link-arg=-Wl,--allow-shlib-undefined
            -C link-arg=-Wl,--thinlto-cache-dir=$(pwd)/target/release/lto-cache
            -C link-arg=-Wl,--thinlto-cache-policy,cache_size_bytes=700m
            -C link-arg=/tmp/memfd_create_shim.o
            --cfg tokio_unstable
            $RUSTFLAGS
          __1
          CC=/usr/bin/clang-21
          CFLAGS=$CFLAGS
          " > $GITHUB_ENV
      - name: Build debug
        env:
          CARGO_PROFILE_DEV_DEBUG: 0
        run: cargo build --locked --bin deno --bin denort --bin test_server --features=panic-trace
      - name: Log versions
        run: |-
          echo '*** Python'
          command -v python && python --version || echo 'No python found or bad executable'
          echo '*** Rust'
          command -v rustc && rustc --version || echo 'No rustc found or bad executable'
          echo '*** Cargo'
          command -v cargo && cargo --version || echo 'No cargo found or bad executable'
          echo '*** Deno'
          command -v deno && deno --version || echo 'No deno found or bad executable'
          echo '*** Node'
          command -v node && node --version || echo 'No node found or bad executable'
          echo '*** Installed packages'
          command -v dpkg && dpkg -l || echo 'No dpkg found or bad executable'
      - name: Check deno binary
        env:
          NO_COLOR: 1
        run: target/debug/deno eval "console.log(1+2)" | grep 3
      - name: Check deno binary (in sysroot)
        run: sudo chroot /sysroot "$(pwd)/target/debug/deno" --version
      - name: Upload artifact debug-linux-x86_64-deno
        uses: actions/upload-artifact@v6
        with:
          name: debug-linux-x86_64-deno
          path: target/debug/deno
          retention-days: 3
      - name: Upload artifact debug-linux-x86_64-denort
        uses: actions/upload-artifact@v6
        with:
          name: debug-linux-x86_64-denort
          path: target/debug/denort
          retention-days: 3
      - name: Upload artifact debug-linux-x86_64-test-server
        uses: actions/upload-artifact@v6
        with:
          name: debug-linux-x86_64-test-server
          path: target/debug/test_server
          retention-days: 3
      - name: Cache cargo home
        uses: actions/cache/save@v4
        if: 'github.ref == ''refs/heads/main'' && !startsWith(github.ref, ''refs/tags/'')'
        with:
          path: |-
            ~/.cargo/.crates.toml
            ~/.cargo/.crates2.json
            ~/.cargo/bin
            ~/.cargo/registry/index
            ~/.cargo/registry/cache
            ~/.cargo/git/db
          key: '106-cargo-home-linux-x86_64-build-main-${{ github.sha }}'
      - name: Cache build output
        uses: actions/cache/save@v4
        if: 'github.ref == ''refs/heads/main'' && !startsWith(github.ref, ''refs/tags/'')'
        with:
          path: |-
            ./target
            !./target/*/gn_out
            !./target/*/gn_root
            !./target/*/*.zip
            !./target/*/*.tar.gz
          key: '106-cargo-target-linux-x86_64-debug-build-main-${{ github.sha }}'
  test-debug-linux-x86_64:
    name: 'test ${{ matrix.test_crate }} ${{ matrix.shard_label }}debug linux-x86_64'
    needs:
      - build-debug-linux-x86_64
    runs-on: ubuntu-24.04
    timeout-minutes: 30
    defaults:
      run:
        shell: bash
    strategy:
      matrix:
        include:
          - test_crate: integration
            test_package: integration_tests
            shard_index: '0'
            shard_total: '2'
            shard_label: '(1/2) '
          - test_crate: integration
            test_package: integration_tests
            shard_index: '1'
            shard_total: '2'
            shard_label: '(2/2) '
          - test_crate: node_compat
            test_package: node_compat_tests
            shard_index: '0'
            shard_total: '1'
            shard_label: ''
          - test_crate: specs
            test_package: specs_tests
            shard_index: '0'
            shard_total: '2'
            shard_label: '(1/2) '
          - test_crate: specs
            test_package: specs_tests
            shard_index: '1'
            shard_total: '2'
            shard_label: '(2/2) '
          - test_crate: unit
            test_package: unit_tests
            shard_index: '0'
            shard_total: '1'
            shard_label: ''
          - test_crate: unit_node
            test_package: unit_node_tests
            shard_index: '0'
            shard_total: '1'
            shard_label: ''
      fail-fast: false
    env:
      CARGO_TERM_COLOR: always
      RUST_BACKTRACE: full
      RUST_LIB_BACKTRACE: 0
    steps:
      - name: Configure git
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        run: |-
          git config --global core.symlinks true
          git config --global fetch.parallel 32
      - name: Clone repository
        uses: actions/checkout@v6
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        with:
          fetch-depth: 5
          submodules: false
      - name: Clone submodule ./tests/node_compat/runner/suite
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && matrix.test_crate == ''node_compat'''
        run: git submodule update --init --recursive --depth=1 -- ./tests/node_compat/runner/suite
      - name: Clone submodule ./tests/util/std
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        run: git submodule update --init --recursive --depth=1 -- ./tests/util/std
      - name: Restore cache cargo home
        uses: actions/cache/restore@v4
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        with:
          path: |-
            ~/.cargo/.crates.toml
            ~/.cargo/.crates2.json
            ~/.cargo/bin
            ~/.cargo/registry/index
            ~/.cargo/registry/cache
            ~/.cargo/git/db
          key: never_saved
          restore-keys: '106-cargo-home-linux-x86_64-test-${{ matrix.test_crate }}-'
      - name: Restore cache build output
        uses: actions/cache/restore@v4
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && github.ref != ''refs/heads/main'''
        with:
          path: |-
            ./target
            !./target/*/gn_out
            !./target/*/gn_root
            !./target/*/*.zip
            !./target/*/*.tar.gz
          key: never_saved
          restore-keys: '106-cargo-target-linux-x86_64-debug-test-${{ matrix.test_crate }}-'
      - name: Apply and update mtime cache
        uses: ./.github/mtime_cache
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        with:
          cache-path: ./target
      - name: Install Node
        uses: actions/setup-node@v6
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        with:
          node-version: 22
      - uses: dsherret/rust-toolchain-file@v1
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
      - name: Set up incremental LTO and sysroot build
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        run: |-
          # Setting up sysroot
          export DEBIAN_FRONTEND=noninteractive
          # Avoid running man-db triggers, which sometimes takes several minutes
          # to complete.
          sudo apt-get -qq remove --purge -y man-db > /dev/null 2> /dev/null
          # Remove older clang before we install
          sudo apt-get -qq remove   'clang-12*' 'clang-13*' 'clang-14*' 'clang-15*' 'clang-16*' 'clang-17*' 'clang-18*' 'clang-19*' 'llvm-12*' 'llvm-13*' 'llvm-14*' 'llvm-15*' 'llvm-16*' 'llvm-17*' 'llvm-18*' 'llvm-19*' 'lld-12*' 'lld-13*' 'lld-14*' 'lld-15*' 'lld-16*' 'lld-17*' 'lld-18*' 'lld-19*' > /dev/null 2> /dev/null

          # Install clang-XXX, lld-XXX, and debootstrap.
          echo "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-21 main" |
            sudo dd of=/etc/apt/sources.list.d/llvm-toolchain-noble-21.list
          curl https://apt.llvm.org/llvm-snapshot.gpg.key |
            gpg --dearmor                                 |
          sudo dd of=/etc/apt/trusted.gpg.d/llvm-snapshot.gpg
          sudo apt-get update
          # this was unreliable sometimes, so try again if it fails
          sudo apt-get install -y --no-install-recommends clang-21 lld-21 clang-tools-21 clang-format-21 clang-tidy-21 || (echo 'Failed. Trying again.' && sudo apt-get clean && sudo apt-get update && sudo apt-get install -y --no-install-recommends clang-21 lld-21 clang-tools-21 clang-format-21 clang-tidy-21)
          # Fix alternatives
          (yes '' | sudo update-alternatives --force --all) > /dev/null 2> /dev/null || true

          clang-21 -c -o /tmp/memfd_create_shim.o tools/memfd_create_shim.c -fPIC

          echo "Decompressing sysroot..."
          wget -q https://github.com/denoland/deno_sysroot_build/releases/download/sysroot-20250207/sysroot-`uname -m`.tar.xz -O /tmp/sysroot.tar.xz
          cd /
          xzcat /tmp/sysroot.tar.xz | sudo tar -x
          sudo mount --rbind /dev /sysroot/dev
          sudo mount --rbind /sys /sysroot/sys
          sudo mount --rbind /home /sysroot/home
          sudo mount -t proc /proc /sysroot/proc
          cd

          echo "Done."

          # Configure the build environment. Both Rust and Clang will produce
          # llvm bitcode only, so we can use lld's incremental LTO support.

          # Load the sysroot's env vars
          echo "sysroot env:"
          cat /sysroot/.env
          . /sysroot/.env

          # Important notes:
          #   1. -ldl seems to be required to avoid a failure in FFI tests. This flag seems
          #      to be in the Rust default flags in the smoketest, so uncertain why we need
          #      to be explicit here.
          #   2. RUSTFLAGS and RUSTDOCFLAGS must be specified, otherwise the doctests fail
          #      to build because the object formats are not compatible.
          echo "
          CARGO_PROFILE_BENCH_INCREMENTAL=false
          CARGO_PROFILE_RELEASE_INCREMENTAL=false
          RUSTFLAGS<<__1
            -C linker-plugin-lto=true
            -C linker=clang-21
            -C link-arg=-fuse-ld=lld-21
            -C link-arg=-ldl
            -C link-arg=-Wl,--allow-shlib-undefined
            -C link-arg=-Wl,--thinlto-cache-dir=$(pwd)/target/release/lto-cache
            -C link-arg=-Wl,--thinlto-cache-policy,cache_size_bytes=700m
            -C link-arg=/tmp/memfd_create_shim.o
            --cfg tokio_unstable
            $RUSTFLAGS
          __1
          RUSTDOCFLAGS<<__1
            -C linker-plugin-lto=true
            -C linker=clang-21
            -C link-arg=-fuse-ld=lld-21
            -C link-arg=-ldl
            -C link-arg=-Wl,--allow-shlib-undefined
            -C link-arg=-Wl,--thinlto-cache-dir=$(pwd)/target/release/lto-cache
            -C link-arg=-Wl,--thinlto-cache-policy,cache_size_bytes=700m
            -C link-arg=/tmp/memfd_create_shim.o
            --cfg tokio_unstable
            $RUSTFLAGS
          __1
          CC=/usr/bin/clang-21
          CFLAGS=$CFLAGS
          " > $GITHUB_ENV
      - name: Download artifact debug-linux-x86_64-deno
        uses: actions/download-artifact@v6
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        with:
          name: debug-linux-x86_64-deno
          path: target/debug
      - name: Set target/debug/deno permissions
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        run: chmod +x target/debug/deno
      - name: Download artifact debug-linux-x86_64-denort
        uses: actions/download-artifact@v6
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && (matrix.test_crate == ''integration'' || matrix.test_crate == ''specs'')'
        with:
          name: debug-linux-x86_64-denort
          path: target/debug
      - name: Set target/debug/denort permissions
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && (matrix.test_crate == ''integration'' || matrix.test_crate == ''specs'')'
        run: chmod +x target/debug/denort
      - name: Download artifact debug-linux-x86_64-test-server
        uses: actions/download-artifact@v6
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && (matrix.test_crate == ''integration'' || matrix.test_crate == ''specs'' || matrix.test_crate == ''unit'' || matrix.test_crate == ''unit_node'')'
        with:
          name: debug-linux-x86_64-test-server
          path: target/debug
      - name: Set target/debug/test_server permissions
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && (matrix.test_crate == ''integration'' || matrix.test_crate == ''specs'' || matrix.test_crate == ''unit'' || matrix.test_crate == ''unit_node'')'
        run: chmod +x target/debug/test_server
      - name: Set up playwright cache
        uses: actions/cache@v5
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        with:
          path: ./.ms-playwright
          key: 'playwright-${{ runner.os }}-${{ runner.arch }}'
      - name: Build ffi (debug)
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && matrix.test_crate == ''specs'''
        run: cargo build -p test_ffi
      - name: Test (debug)
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        env:
          CARGO_PROFILE_DEV_DEBUG: 0
          CI_SHARD_INDEX: '${{ github.event_name == ''pull_request'' && matrix.shard_index || '''' }}'
          CI_SHARD_TOTAL: '${{ github.event_name == ''pull_request'' && matrix.shard_total || '''' }}'
        run: 'cargo test -p ${{ matrix.test_package }} --test ${{ matrix.test_crate }}'
      - name: Ensure no git changes
        if: '!startsWith(github.ref, ''refs/tags/'') && github.event_name == ''pull_request'''
        run: "if [[ -n \"$(git status --porcelain)\" ]]; then\necho \"❌ Git working directory is dirty. Ensure `cargo test` is not modifying git tracked files.\"\necho \"\"\necho \"\U0001F4CB Status:\"\ngit status\necho \"\"\nexit 1\nfi"
      - name: Upload test results
        uses: actions/upload-artifact@v6
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && always()'
        with:
          name: 'test-results-linux-x86_64-debug-${{ matrix.test_crate }}${{ matrix.shard_total > 1 && format(''-shard-{0}'', matrix.shard_index) || '''' }}.json'
          path: 'target/test_results_${{ matrix.test_crate }}.json'
      - name: Cache cargo home
        uses: actions/cache/save@v4
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && github.ref == ''refs/heads/main'''
        with:
          path: |-
            ~/.cargo/.crates.toml
            ~/.cargo/.crates2.json
            ~/.cargo/bin
            ~/.cargo/registry/index
            ~/.cargo/registry/cache
            ~/.cargo/git/db
          key: '106-cargo-home-linux-x86_64-test-${{ matrix.test_crate }}-${{ github.sha }}'
      - name: Cache build output
        uses: actions/cache/save@v4
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && github.ref == ''refs/heads/main'''
        with:
          path: |-
            ./target
            !./target/*/gn_out
            !./target/*/gn_root
            !./target/*/*.zip
            !./target/*/*.tar.gz
          key: '106-cargo-target-linux-x86_64-debug-test-${{ matrix.test_crate }}-${{ github.sha }}'
  build-libs-debug-linux-x86_64:
    name: build libs debug linux-x86_64
    needs:
      - pre_build
    if: needs.pre_build.outputs.skip_build != 'true'
    runs-on: ubuntu-24.04
    timeout-minutes: 30
    steps:
      - name: Configure git
        if: '!startsWith(github.ref, ''refs/tags/'')'
        run: |-
          git config --global core.symlinks true
          git config --global fetch.parallel 32
      - name: Clone repository
        uses: actions/checkout@v6
        if: '!startsWith(github.ref, ''refs/tags/'')'
        with:
          fetch-depth: 5
          submodules: false
      - uses: dsherret/rust-toolchain-file@v1
        if: '!startsWith(github.ref, ''refs/tags/'')'
      - name: Restore cache cargo home
        uses: actions/cache/restore@v4
        if: '!startsWith(github.ref, ''refs/tags/'')'
        with:
          path: |-
            ~/.cargo/.crates.toml
            ~/.cargo/.crates2.json
            ~/.cargo/bin
            ~/.cargo/registry/index
            ~/.cargo/registry/cache
            ~/.cargo/git/db
          key: never_saved
          restore-keys: 106-cargo-home-linux-x86_64-build-libs-
      - name: Restore cache build output
        uses: actions/cache/restore@v4
        if: '!startsWith(github.ref, ''refs/tags/'') && github.ref != ''refs/heads/main'''
        with:
          path: |-
            ./target
            !./target/*/gn_out
            !./target/*/gn_root
            !./target/*/*.zip
            !./target/*/*.tar.gz
          key: never_saved
          restore-keys: 106-cargo-target-linux-x86_64-debug-build-libs-
      - name: Apply and update mtime cache
        uses: ./.github/mtime_cache
        if: '!startsWith(github.ref, ''refs/tags/'')'
        with:
          cache-path: ./target
      - name: Install wasm target
        if: '!startsWith(github.ref, ''refs/tags/'')'
        run: rustup target add wasm32-unknown-unknown
      - name: Cargo check (deno_resolver)
        if: '!startsWith(github.ref, ''refs/tags/'')'
        run: cargo check --target wasm32-unknown-unknown -p deno_resolver && cargo check --target wasm32-unknown-unknown -p deno_resolver --features graph && cargo check --target wasm32-unknown-unknown -p deno_resolver --features graph --features deno_ast
      - name: Cargo check (deno_npm_installer)
        if: '!startsWith(github.ref, ''refs/tags/'')'
        run: cargo check --target wasm32-unknown-unknown -p deno_npm_installer
      - name: Cargo check (deno_config)
        if: '!startsWith(github.ref, ''refs/tags/'')'
        run: |-
          cargo check --no-default-features -p deno_config
          cargo check --no-default-features --features workspace -p deno_config
          cargo check --no-default-features --features package_json -p deno_config
          cargo check --no-default-features --features workspace --features sync -p deno_config
          cargo check --target wasm32-unknown-unknown --all-features -p deno_config
          cargo check -p deno --features=lsp-tracing
      - name: Cache cargo home
        uses: actions/cache/save@v4
        if: '!startsWith(github.ref, ''refs/tags/'') && github.ref == ''refs/heads/main'''
        with:
          path: |-
            ~/.cargo/.crates.toml
            ~/.cargo/.crates2.json
            ~/.cargo/bin
            ~/.cargo/registry/index
            ~/.cargo/registry/cache
            ~/.cargo/git/db
          key: '106-cargo-home-linux-x86_64-build-libs-${{ github.sha }}'
      - name: Cache build output
        uses: actions/cache/save@v4
        if: '!startsWith(github.ref, ''refs/tags/'') && github.ref == ''refs/heads/main'''
        with:
          path: |-
            ./target
            !./target/*/gn_out
            !./target/*/gn_root
            !./target/*/*.zip
            !./target/*/*.tar.gz
          key: '106-cargo-target-linux-x86_64-debug-build-libs-${{ github.sha }}'
  build-debug-linux-aarch64:
    name: build debug linux-aarch64
    needs:
      - pre_build
    if: needs.pre_build.outputs.skip_build != 'true'
    runs-on: ubuntu-24.04-arm
    environment:
      name: '${{ (github.ref == ''refs/heads/main'' || startsWith(github.ref, ''refs/tags/'')) && ''build'' || '''' }}'
    timeout-minutes: 240
    defaults:
      run:
        shell: bash
    env:
      CARGO_TERM_COLOR: always
      RUST_BACKTRACE: full
      RUST_LIB_BACKTRACE: 0
    steps:
      - name: Configure git
        run: |-
          git config --global core.symlinks true
          git config --global fetch.parallel 32
      - name: Clone repository
        uses: actions/checkout@v6
        with:
          fetch-depth: 5
          submodules: false
      - name: Clone submodule ./tests/util/std
        run: git submodule update --init --recursive --depth=1 -- ./tests/util/std
      - name: Restore cache cargo home
        uses: actions/cache/restore@v4
        if: '!startsWith(github.ref, ''refs/tags/'')'
        with:
          path: |-
            ~/.cargo/.crates.toml
            ~/.cargo/.crates2.json
            ~/.cargo/bin
            ~/.cargo/registry/index
            ~/.cargo/registry/cache
            ~/.cargo/git/db
          key: never_saved
          restore-keys: 106-cargo-home-linux-aarch64-build-main-
      - name: Restore cache build output
        uses: actions/cache/restore@v4
        if: 'github.ref != ''refs/heads/main'' && !startsWith(github.ref, ''refs/tags/'')'
        with:
          path: |-
            ./target
            !./target/*/gn_out
            !./target/*/gn_root
            !./target/*/*.zip
            !./target/*/*.tar.gz
          key: never_saved
          restore-keys: 106-cargo-target-linux-aarch64-debug-build-main-
      - name: Apply and update mtime cache
        uses: ./.github/mtime_cache
        with:
          cache-path: ./target
      - uses: dsherret/rust-toolchain-file@v1
      - name: Build debug
        env:
          CARGO_PROFILE_DEV_DEBUG: 0
        run: cargo build --locked --bin deno --bin denort --bin test_server --features=panic-trace
      - name: Log versions
        run: |-
          echo '*** Python'
          command -v python && python --version || echo 'No python found or bad executable'
          echo '*** Rust'
          command -v rustc && rustc --version || echo 'No rustc found or bad executable'
          echo '*** Cargo'
          command -v cargo && cargo --version || echo 'No cargo found or bad executable'
          echo '*** Deno'
          command -v deno && deno --version || echo 'No deno found or bad executable'
          echo '*** Node'
          command -v node && node --version || echo 'No node found or bad executable'
          echo '*** Installed packages'
          command -v dpkg && dpkg -l || echo 'No dpkg found or bad executable'
      - name: Check deno binary
        env:
          NO_COLOR: 1
        run: target/debug/deno eval "console.log(1+2)" | grep 3
      - name: Upload artifact debug-linux-aarch64-deno
        uses: actions/upload-artifact@v6
        with:
          name: debug-linux-aarch64-deno
          path: target/debug/deno
          retention-days: 3
      - name: Upload artifact debug-linux-aarch64-denort
        uses: actions/upload-artifact@v6
        with:
          name: debug-linux-aarch64-denort
          path: target/debug/denort
          retention-days: 3
      - name: Upload artifact debug-linux-aarch64-test-server
        uses: actions/upload-artifact@v6
        with:
          name: debug-linux-aarch64-test-server
          path: target/debug/test_server
          retention-days: 3
      - name: Cache cargo home
        uses: actions/cache/save@v4
        if: 'github.ref == ''refs/heads/main'' && !startsWith(github.ref, ''refs/tags/'')'
        with:
          path: |-
            ~/.cargo/.crates.toml
            ~/.cargo/.crates2.json
            ~/.cargo/bin
            ~/.cargo/registry/index
            ~/.cargo/registry/cache
            ~/.cargo/git/db
          key: '106-cargo-home-linux-aarch64-build-main-${{ github.sha }}'
      - name: Cache build output
        uses: actions/cache/save@v4
        if: 'github.ref == ''refs/heads/main'' && !startsWith(github.ref, ''refs/tags/'')'
        with:
          path: |-
            ./target
            !./target/*/gn_out
            !./target/*/gn_root
            !./target/*/*.zip
            !./target/*/*.tar.gz
          key: '106-cargo-target-linux-aarch64-debug-build-main-${{ github.sha }}'
  test-debug-linux-aarch64:
    name: 'test ${{ matrix.test_crate }} ${{ matrix.shard_label }}debug linux-aarch64'
    needs:
      - build-debug-linux-aarch64
    runs-on: ubuntu-24.04-arm
    timeout-minutes: 30
    defaults:
      run:
        shell: bash
    strategy:
      matrix:
        include:
          - test_crate: integration
            test_package: integration_tests
            shard_index: '0'
            shard_total: '2'
            shard_label: '(1/2) '
          - test_crate: integration
            test_package: integration_tests
            shard_index: '1'
            shard_total: '2'
            shard_label: '(2/2) '
          - test_crate: node_compat
            test_package: node_compat_tests
            shard_index: '0'
            shard_total: '1'
            shard_label: ''
          - test_crate: specs
            test_package: specs_tests
            shard_index: '0'
            shard_total: '2'
            shard_label: '(1/2) '
          - test_crate: specs
            test_package: specs_tests
            shard_index: '1'
            shard_total: '2'
            shard_label: '(2/2) '
          - test_crate: unit
            test_package: unit_tests
            shard_index: '0'
            shard_total: '1'
            shard_label: ''
          - test_crate: unit_node
            test_package: unit_node_tests
            shard_index: '0'
            shard_total: '1'
            shard_label: ''
      fail-fast: false
    env:
      CARGO_TERM_COLOR: always
      RUST_BACKTRACE: full
      RUST_LIB_BACKTRACE: 0
    steps:
      - name: Configure git
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        run: |-
          git config --global core.symlinks true
          git config --global fetch.parallel 32
      - name: Clone repository
        uses: actions/checkout@v6
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        with:
          fetch-depth: 5
          submodules: false
      - name: Clone submodule ./tests/node_compat/runner/suite
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && matrix.test_crate == ''node_compat'''
        run: git submodule update --init --recursive --depth=1 -- ./tests/node_compat/runner/suite
      - name: Clone submodule ./tests/util/std
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        run: git submodule update --init --recursive --depth=1 -- ./tests/util/std
      - name: Restore cache cargo home
        uses: actions/cache/restore@v4
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        with:
          path: |-
            ~/.cargo/.crates.toml
            ~/.cargo/.crates2.json
            ~/.cargo/bin
            ~/.cargo/registry/index
            ~/.cargo/registry/cache
            ~/.cargo/git/db
          key: never_saved
          restore-keys: '106-cargo-home-linux-aarch64-test-${{ matrix.test_crate }}-'
      - name: Restore cache build output
        uses: actions/cache/restore@v4
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && github.ref != ''refs/heads/main'''
        with:
          path: |-
            ./target
            !./target/*/gn_out
            !./target/*/gn_root
            !./target/*/*.zip
            !./target/*/*.tar.gz
          key: never_saved
          restore-keys: '106-cargo-target-linux-aarch64-debug-test-${{ matrix.test_crate }}-'
      - name: Apply and update mtime cache
        uses: ./.github/mtime_cache
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        with:
          cache-path: ./target
      - name: Install Node
        uses: actions/setup-node@v6
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        with:
          node-version: 22
      - uses: dsherret/rust-toolchain-file@v1
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
      - name: Download artifact debug-linux-aarch64-deno
        uses: actions/download-artifact@v6
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        with:
          name: debug-linux-aarch64-deno
          path: target/debug
      - name: Set target/debug/deno permissions
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        run: chmod +x target/debug/deno
      - name: Download artifact debug-linux-aarch64-denort
        uses: actions/download-artifact@v6
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && (matrix.test_crate == ''integration'' || matrix.test_crate == ''specs'')'
        with:
          name: debug-linux-aarch64-denort
          path: target/debug
      - name: Set target/debug/denort permissions
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && (matrix.test_crate == ''integration'' || matrix.test_crate == ''specs'')'
        run: chmod +x target/debug/denort
      - name: Download artifact debug-linux-aarch64-test-server
        uses: actions/download-artifact@v6
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && (matrix.test_crate == ''integration'' || matrix.test_crate == ''specs'' || matrix.test_crate == ''unit'' || matrix.test_crate == ''unit_node'')'
        with:
          name: debug-linux-aarch64-test-server
          path: target/debug
      - name: Set target/debug/test_server permissions
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && (matrix.test_crate == ''integration'' || matrix.test_crate == ''specs'' || matrix.test_crate == ''unit'' || matrix.test_crate == ''unit_node'')'
        run: chmod +x target/debug/test_server
      - name: Set up playwright cache
        uses: actions/cache@v5
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        with:
          path: ./.ms-playwright
          key: 'playwright-${{ runner.os }}-${{ runner.arch }}'
      - name: Load 'vsock_loopback; kernel module
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        run: sudo modprobe vsock_loopback
      - name: Build ffi (debug)
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && matrix.test_crate == ''specs'''
        run: cargo build -p test_ffi
      - name: Test (debug)
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        env:
          CARGO_PROFILE_DEV_DEBUG: 0
          CI_SHARD_INDEX: '${{ github.event_name == ''pull_request'' && matrix.shard_index || '''' }}'
          CI_SHARD_TOTAL: '${{ github.event_name == ''pull_request'' && matrix.shard_total || '''' }}'
        run: 'cargo test -p ${{ matrix.test_package }} --test ${{ matrix.test_crate }}'
      - name: Ensure no git changes
        if: '!startsWith(github.ref, ''refs/tags/'') && github.event_name == ''pull_request'''
        run: "if [[ -n \"$(git status --porcelain)\" ]]; then\necho \"❌ Git working directory is dirty. Ensure `cargo test` is not modifying git tracked files.\"\necho \"\"\necho \"\U0001F4CB Status:\"\ngit status\necho \"\"\nexit 1\nfi"
      - name: Upload test results
        uses: actions/upload-artifact@v6
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && always()'
        with:
          name: 'test-results-linux-aarch64-debug-${{ matrix.test_crate }}${{ matrix.shard_total > 1 && format(''-shard-{0}'', matrix.shard_index) || '''' }}.json'
          path: 'target/test_results_${{ matrix.test_crate }}.json'
      - name: Cache cargo home
        uses: actions/cache/save@v4
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && github.ref == ''refs/heads/main'''
        with:
          path: |-
            ~/.cargo/.crates.toml
            ~/.cargo/.crates2.json
            ~/.cargo/bin
            ~/.cargo/registry/index
            ~/.cargo/registry/cache
            ~/.cargo/git/db
          key: '106-cargo-home-linux-aarch64-test-${{ matrix.test_crate }}-${{ github.sha }}'
      - name: Cache build output
        uses: actions/cache/save@v4
        if: '!startsWith(github.ref, ''refs/tags/'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && github.ref == ''refs/heads/main'''
        with:
          path: |-
            ./target
            !./target/*/gn_out
            !./target/*/gn_root
            !./target/*/*.zip
            !./target/*/*.tar.gz
          key: '106-cargo-target-linux-aarch64-debug-test-${{ matrix.test_crate }}-${{ github.sha }}'
  test-libs-debug-linux-aarch64:
    name: test libs debug linux-aarch64
    needs:
      - build-debug-linux-aarch64
    runs-on: ubuntu-24.04-arm
    timeout-minutes: 30
    steps:
      - name: Configure git
        if: '!startsWith(github.ref, ''refs/tags/'')'
        run: |-
          git config --global core.symlinks true
          git config --global fetch.parallel 32
      - name: Clone repository
        uses: actions/checkout@v6
        if: '!startsWith(github.ref, ''refs/tags/'')'
        with:
          fetch-depth: 5
          submodules: false
      - name: Restore cache cargo home
        uses: actions/cache/restore@v4
        if: '!startsWith(github.ref, ''refs/tags/'')'
        with:
          path: |-
            ~/.cargo/.crates.toml
            ~/.cargo/.crates2.json
            ~/.cargo/bin
            ~/.cargo/registry/index
            ~/.cargo/registry/cache
            ~/.cargo/git/db
          key: never_saved
          restore-keys: 106-cargo-home-linux-aarch64-test-libs-
      - name: Restore cache build output
        uses: actions/cache/restore@v4
        if: '!startsWith(github.ref, ''refs/tags/'') && github.ref != ''refs/heads/main'''
        with:
          path: |-
            ./target
            !./target/*/gn_out
            !./target/*/gn_root
            !./target/*/*.zip
            !./target/*/*.tar.gz
          key: never_saved
          restore-keys: 106-cargo-target-linux-aarch64-debug-test-libs-
      - name: Apply and update mtime cache
        uses: ./.github/mtime_cache
        if: '!startsWith(github.ref, ''refs/tags/'')'
        with:
          cache-path: ./target
      - name: Install Node
        uses: actions/setup-node@v6
        if: '!startsWith(github.ref, ''refs/tags/'')'
        with:
          node-version: 22
      - uses: dsherret/rust-toolchain-file@v1
        if: '!startsWith(github.ref, ''refs/tags/'')'
      - name: Download artifact debug-linux-aarch64-deno
        uses: actions/download-artifact@v6
        if: '!startsWith(github.ref, ''refs/tags/'')'
        with:
          name: debug-linux-aarch64-deno
          path: target/debug
      - name: Set target/debug/deno permissions
        if: '!startsWith(github.ref, ''refs/tags/'')'
        run: chmod +x target/debug/deno
      - name: Download artifact debug-linux-aarch64-test-server
        uses: actions/download-artifact@v6
        if: '!startsWith(github.ref, ''refs/tags/'')'
        with:
          name: debug-linux-aarch64-test-server
          path: target/debug
      - name: Set target/debug/test_server permissions
        if: '!startsWith(github.ref, ''refs/tags/'')'
        run: chmod +x target/debug/test_server
      - name: Test libs
        if: '!startsWith(github.ref, ''refs/tags/'')'
        env:
          CARGO_PROFILE_DEV_DEBUG: 0
        run: cargo test --locked --lib -p deno -p denort -p node_shim -p deno_lib -p deno_snapshots -p deno_bundle_runtime -p deno_cache -p deno_cron -p deno_crypto -p deno_fetch -p deno_ffi -p deno_fs -p deno_http -p deno_image -p deno_io -p deno_kv -p deno_napi -p napi_sym -p deno_net -p deno_node -p deno_node_crypto -p deno_node_sqlite -p denort_helper -p deno_signals -p deno_telemetry -p deno_url -p deno_web -p deno_webgpu -p deno_webidl -p deno_websocket -p deno_webstorage -p deno_cache_dir -p deno_config -p deno_crypto_provider -p deno_dotenv -p eszip -p deno_inspector_server -p deno_lockfile -p deno_maybe_sync -p napi_sys -p node_resolver -p deno_npm -p deno_npm_cache -p deno_npm_installer -p deno_npmrc -p deno_package_json -p deno_resolver -p deno_typescript_go_client_rust -p deno_runtime -p deno_features -p deno_permissions -p deno_subprocess_windows
      - name: Cache cargo home
        uses: actions/cache/save@v4
        if: '!startsWith(github.ref, ''refs/tags/'') && github.ref == ''refs/heads/main'''
        with:
          path: |-
            ~/.cargo/.crates.toml
            ~/.cargo/.crates2.json
            ~/.cargo/bin
            ~/.cargo/registry/index
            ~/.cargo/registry/cache
            ~/.cargo/git/db
          key: '106-cargo-home-linux-aarch64-test-libs-${{ github.sha }}'
      - name: Cache build output
        uses: actions/cache/save@v4
        if: '!startsWith(github.ref, ''refs/tags/'') && github.ref == ''refs/heads/main'''
        with:
          path: |-
            ./target
            !./target/*/gn_out
            !./target/*/gn_root
            !./target/*/*.zip
            !./target/*/*.tar.gz
          key: '106-cargo-target-linux-aarch64-debug-test-libs-${{ github.sha }}'
  build-release-linux-aarch64:
    name: build release linux-aarch64
    needs:
      - pre_build
    if: needs.pre_build.outputs.skip_build != 'true'
    runs-on: '${{ !contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'' && ''ubuntu-24.04'' || ''ubuntu-24.04-arm'' }}'
    environment:
      name: '${{ (github.ref == ''refs/heads/main'' || startsWith(github.ref, ''refs/tags/'')) && ''build'' || '''' }}'
    timeout-minutes: 240
    defaults:
      run:
        shell: bash
    env:
      CARGO_TERM_COLOR: always
      RUST_BACKTRACE: full
      RUST_LIB_BACKTRACE: 0
    steps:
      - name: Configure git
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'')'
        run: |-
          git config --global core.symlinks true
          git config --global fetch.parallel 32
      - name: Clone repository
        uses: actions/checkout@v6
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'')'
        with:
          fetch-depth: 5
          submodules: false
      - name: Clone submodule ./tests/util/std
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'')'
        run: git submodule update --init --recursive --depth=1 -- ./tests/util/std
      - name: Restore cache cargo home
        uses: actions/cache/restore@v4
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && !startsWith(github.ref, ''refs/tags/'')'
        with:
          path: |-
            ~/.cargo/.crates.toml
            ~/.cargo/.crates2.json
            ~/.cargo/bin
            ~/.cargo/registry/index
            ~/.cargo/registry/cache
            ~/.cargo/git/db
          key: never_saved
          restore-keys: 106-cargo-home-linux-aarch64-build-main-
      - name: Restore cache build output
        uses: actions/cache/restore@v4
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.ref != ''refs/heads/main'' && !startsWith(github.ref, ''refs/tags/'')'
        with:
          path: |-
            ./target
            !./target/*/gn_out
            !./target/*/gn_root
            !./target/*/*.zip
            !./target/*/*.tar.gz
          key: never_saved
          restore-keys: 106-cargo-target-linux-aarch64-release-build-main-
      - name: Apply and update mtime cache
        uses: ./.github/mtime_cache
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'')'
        with:
          cache-path: ./target
      - uses: dsherret/rust-toolchain-file@v1
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'')'
      - name: Set up incremental LTO and sysroot build
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'')'
        run: |-
          # Setting up sysroot
          export DEBIAN_FRONTEND=noninteractive
          # Avoid running man-db triggers, which sometimes takes several minutes
          # to complete.
          sudo apt-get -qq remove --purge -y man-db > /dev/null 2> /dev/null
          # Remove older clang before we install
          sudo apt-get -qq remove   'clang-12*' 'clang-13*' 'clang-14*' 'clang-15*' 'clang-16*' 'clang-17*' 'clang-18*' 'clang-19*' 'llvm-12*' 'llvm-13*' 'llvm-14*' 'llvm-15*' 'llvm-16*' 'llvm-17*' 'llvm-18*' 'llvm-19*' 'lld-12*' 'lld-13*' 'lld-14*' 'lld-15*' 'lld-16*' 'lld-17*' 'lld-18*' 'lld-19*' > /dev/null 2> /dev/null

          # Install clang-XXX, lld-XXX, and debootstrap.
          echo "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-21 main" |
            sudo dd of=/etc/apt/sources.list.d/llvm-toolchain-noble-21.list
          curl https://apt.llvm.org/llvm-snapshot.gpg.key |
            gpg --dearmor                                 |
          sudo dd of=/etc/apt/trusted.gpg.d/llvm-snapshot.gpg
          sudo apt-get update
          # this was unreliable sometimes, so try again if it fails
          sudo apt-get install -y --no-install-recommends clang-21 lld-21 clang-tools-21 clang-format-21 clang-tidy-21 || (echo 'Failed. Trying again.' && sudo apt-get clean && sudo apt-get update && sudo apt-get install -y --no-install-recommends clang-21 lld-21 clang-tools-21 clang-format-21 clang-tidy-21)
          # Fix alternatives
          (yes '' | sudo update-alternatives --force --all) > /dev/null 2> /dev/null || true

          clang-21 -c -o /tmp/memfd_create_shim.o tools/memfd_create_shim.c -fPIC

          echo "Decompressing sysroot..."
          wget -q https://github.com/denoland/deno_sysroot_build/releases/download/sysroot-20250207/sysroot-`uname -m`.tar.xz -O /tmp/sysroot.tar.xz
          cd /
          xzcat /tmp/sysroot.tar.xz | sudo tar -x
          sudo mount --rbind /dev /sysroot/dev
          sudo mount --rbind /sys /sysroot/sys
          sudo mount --rbind /home /sysroot/home
          sudo mount -t proc /proc /sysroot/proc
          cd

          echo "Done."

          # Configure the build environment. Both Rust and Clang will produce
          # llvm bitcode only, so we can use lld's incremental LTO support.

          # Load the sysroot's env vars
          echo "sysroot env:"
          cat /sysroot/.env
          . /sysroot/.env

          # Important notes:
          #   1. -ldl seems to be required to avoid a failure in FFI tests. This flag seems
          #      to be in the Rust default flags in the smoketest, so uncertain why we need
          #      to be explicit here.
          #   2. RUSTFLAGS and RUSTDOCFLAGS must be specified, otherwise the doctests fail
          #      to build because the object formats are not compatible.
          echo "
          CARGO_PROFILE_BENCH_INCREMENTAL=false
          CARGO_PROFILE_RELEASE_INCREMENTAL=false
          RUSTFLAGS<<__1
            -C linker-plugin-lto=true
            -C linker=clang-21
            -C link-arg=-fuse-ld=lld-21
            -C link-arg=-ldl
            -C link-arg=-Wl,--allow-shlib-undefined
            -C link-arg=-Wl,--thinlto-cache-dir=$(pwd)/target/release/lto-cache
            -C link-arg=-Wl,--thinlto-cache-policy,cache_size_bytes=700m
            -C link-arg=/tmp/memfd_create_shim.o
            --cfg tokio_unstable
            $RUSTFLAGS
          __1
          RUSTDOCFLAGS<<__1
            -C linker-plugin-lto=true
            -C linker=clang-21
            -C link-arg=-fuse-ld=lld-21
            -C link-arg=-ldl
            -C link-arg=-Wl,--allow-shlib-undefined
            -C link-arg=-Wl,--thinlto-cache-dir=$(pwd)/target/release/lto-cache
            -C link-arg=-Wl,--thinlto-cache-policy,cache_size_bytes=700m
            -C link-arg=/tmp/memfd_create_shim.o
            --cfg tokio_unstable
            $RUSTFLAGS
          __1
          CC=/usr/bin/clang-21
          CFLAGS=$CFLAGS
          " > $GITHUB_ENV
      - name: Configure canary build
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && !startsWith(github.ref, ''refs/tags/'')'
        run: echo "DENO_CANARY=true" >> $GITHUB_ENV
      - name: Build release
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'')'
        run: |-
          df -h
          cargo build --release --locked --bin deno --bin denort --bin test_server --features=panic-trace
          df -h
      - name: Generate symcache
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'')'
        env:
          NO_COLOR: 1
        run: |-
          target/release/deno -A tools/release/create_symcache.ts ./deno.symcache
          du -h deno.symcache
          du -h target/release/deno
      - name: Pre-release (linux)
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'''
        run: |-
          cd target/release
          ./deno -A ../../tools/release/create_symcache.ts deno-aarch64-unknown-linux-gnu.symcache
          strip ./deno
          zip -r deno-aarch64-unknown-linux-gnu.zip deno
          shasum -a 256 deno-aarch64-unknown-linux-gnu.zip > deno-aarch64-unknown-linux-gnu.zip.sha256sum
          strip ./denort
          zip -r denort-aarch64-unknown-linux-gnu.zip denort
          shasum -a 256 denort-aarch64-unknown-linux-gnu.zip > denort-aarch64-unknown-linux-gnu.zip.sha256sum
          ./deno types > lib.deno.d.ts
      - name: Authenticate with Google Cloud
        uses: google-github-actions/auth@v3
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'' && (github.ref == ''refs/heads/main'' || startsWith(github.ref, ''refs/tags/''))'
        with:
          project_id: denoland
          credentials_json: '${{ secrets.GCP_SA_KEY }}'
          export_environment_variables: true
          create_credentials_file: true
      - name: Setup gcloud (unix)
        uses: google-github-actions/setup-gcloud@v3
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'' && (github.ref == ''refs/heads/main'' || startsWith(github.ref, ''refs/tags/''))'
        with:
          project_id: denoland
      - name: Log versions
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'')'
        run: |-
          echo '*** Python'
          command -v python && python --version || echo 'No python found or bad executable'
          echo '*** Rust'
          command -v rustc && rustc --version || echo 'No rustc found or bad executable'
          echo '*** Cargo'
          command -v cargo && cargo --version || echo 'No cargo found or bad executable'
          echo '*** Deno'
          command -v deno && deno --version || echo 'No deno found or bad executable'
          echo '*** Node'
          command -v node && node --version || echo 'No node found or bad executable'
          echo '*** Installed packages'
          command -v dpkg && dpkg -l || echo 'No dpkg found or bad executable'
      - name: Upload canary to dl.deno.land
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'' && github.ref == ''refs/heads/main'''
        env:
          AWS_ACCESS_KEY_ID: '${{ vars.S3_ACCESS_KEY_ID }}'
          AWS_SECRET_ACCESS_KEY: '${{ secrets.S3_SECRET_ACCESS_KEY }}'
          AWS_ENDPOINT_URL_S3: '${{ vars.S3_ENDPOINT }}'
          AWS_DEFAULT_REGION: '${{ vars.S3_REGION }}'
        run: |-
          gsutil -h "Cache-Control: public, max-age=3600" cp ./target/release/*.zip gs://dl.deno.land/canary/$(git rev-parse HEAD)/
          gsutil -h "Cache-Control: public, max-age=3600" cp ./target/release/*.sha256sum gs://dl.deno.land/canary/$(git rev-parse HEAD)/
          gsutil -h "Cache-Control: public, max-age=3600" cp ./target/release/*.symcache gs://dl.deno.land/canary/$(git rev-parse HEAD)/
          aws s3 sync ./target/release/ s3://dl-deno-land/canary/$(git rev-parse HEAD)/ --exclude "*" --include "*.zip"
          aws s3 sync ./target/release/ s3://dl-deno-land/canary/$(git rev-parse HEAD)/ --exclude "*" --include "*.sha256sum"
          aws s3 sync ./target/release/ s3://dl-deno-land/canary/$(git rev-parse HEAD)/ --exclude "*" --include "*.symcache"
          echo ${{ github.sha }} > canary-latest.txt
          gsutil -h "Cache-Control: no-cache" cp canary-latest.txt gs://dl.deno.land/canary-$(rustc -vV | sed -n "s|host: ||p")-latest.txt
          aws s3 cp canary-latest.txt s3://dl-deno-land/canary-$(rustc -vV | sed -n "s|host: ||p")-latest.txt
          rm canary-latest.txt gha-creds-*.json
      - name: Build product size info
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (github.ref == ''refs/heads/main'' || startsWith(github.ref, ''refs/tags/''))'
        run: |-
          du -hd1 "./target/release"
          du -ha  "./target/release/deno"
          du -ha  "./target/release/denort"
      - name: Check deno binary
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'')'
        env:
          NO_COLOR: 1
        run: target/release/deno eval "console.log(1+2)" | grep 3
      - name: Check deno binary (in sysroot)
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'')'
        run: sudo chroot /sysroot "$(pwd)/target/release/deno" --version
      - name: Upload artifact release-linux-aarch64-deno
        uses: actions/upload-artifact@v6
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'')'
        with:
          name: release-linux-aarch64-deno
          path: target/release/deno
          retention-days: 3
      - name: Upload artifact release-linux-aarch64-denort
        uses: actions/upload-artifact@v6
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'')'
        with:
          name: release-linux-aarch64-denort
          path: target/release/denort
          retention-days: 3
      - name: Upload artifact release-linux-aarch64-test-server
        uses: actions/upload-artifact@v6
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'')'
        with:
          name: release-linux-aarch64-test-server
          path: target/release/test_server
          retention-days: 3
      - name: Upload release to dl.deno.land (unix)
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'' && startsWith(github.ref, ''refs/tags/'')'
        env:
          AWS_ACCESS_KEY_ID: '${{ vars.S3_ACCESS_KEY_ID }}'
          AWS_SECRET_ACCESS_KEY: '${{ secrets.S3_SECRET_ACCESS_KEY }}'
          AWS_ENDPOINT_URL_S3: '${{ vars.S3_ENDPOINT }}'
          AWS_DEFAULT_REGION: '${{ vars.S3_REGION }}'
        run: |-
          gsutil -h "Cache-Control: public, max-age=3600" cp ./target/release/*.zip gs://dl.deno.land/release/${GITHUB_REF#refs/*/}/
          gsutil -h "Cache-Control: public, max-age=3600" cp ./target/release/*.sha256sum gs://dl.deno.land/release/${GITHUB_REF#refs/*/}/
          gsutil -h "Cache-Control: public, max-age=3600" cp ./target/release/*.symcache gs://dl.deno.land/release/${GITHUB_REF#refs/*/}/
          aws s3 sync ./target/release/ s3://dl-deno-land/release/${GITHUB_REF#refs/*/}/ --exclude "*" --include "*.zip"
          aws s3 sync ./target/release/ s3://dl-deno-land/release/${GITHUB_REF#refs/*/}/ --exclude "*" --include "*.sha256sum"
          aws s3 sync ./target/release/ s3://dl-deno-land/release/${GITHUB_REF#refs/*/}/ --exclude "*" --include "*.symcache"
      - name: Create release notes
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'' && startsWith(github.ref, ''refs/tags/'')'
        run: |-
          export PATH=$PATH:$(pwd)/target/release
          ./tools/release/05_create_release_notes.ts
      - name: Upload release to GitHub
        uses: softprops/action-gh-release@v2
        if: '!(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.repository == ''denoland/deno'' && startsWith(github.ref, ''refs/tags/'')'
        env:
          GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
        with:
          files: |-
            target/release/deno-x86_64-pc-windows-msvc.zip
            target/release/deno-x86_64-pc-windows-msvc.zip.sha256sum
            target/release/denort-x86_64-pc-windows-msvc.zip
            target/release/denort-x86_64-pc-windows-msvc.zip.sha256sum
            target/release/deno-aarch64-pc-windows-msvc.zip
            target/release/deno-aarch64-pc-windows-msvc.zip.sha256sum
            target/release/denort-aarch64-pc-windows-msvc.zip
            target/release/denort-aarch64-pc-windows-msvc.zip.sha256sum
            target/release/deno-x86_64-unknown-linux-gnu.zip
            target/release/deno-x86_64-unknown-linux-gnu.zip.sha256sum
            target/release/denort-x86_64-unknown-linux-gnu.zip
            target/release/denort-x86_64-unknown-linux-gnu.zip.sha256sum
            target/release/deno-x86_64-apple-darwin.zip
            target/release/deno-x86_64-apple-darwin.zip.sha256sum
            target/release/denort-x86_64-apple-darwin.zip
            target/release/denort-x86_64-apple-darwin.zip.sha256sum
            target/release/deno-aarch64-unknown-linux-gnu.zip
            target/release/deno-aarch64-unknown-linux-gnu.zip.sha256sum
            target/release/denort-aarch64-unknown-linux-gnu.zip
            target/release/denort-aarch64-unknown-linux-gnu.zip.sha256sum
            target/release/deno-aarch64-apple-darwin.zip
            target/release/deno-aarch64-apple-darwin.zip.sha256sum
            target/release/denort-aarch64-apple-darwin.zip
            target/release/denort-aarch64-apple-darwin.zip.sha256sum
            target/release/deno_src.tar.gz
            target/release/lib.deno.d.ts
          body_path: target/release/release-notes.md
          draft: true
  test-release-linux-aarch64:
    name: 'test ${{ matrix.test_crate }} ${{ matrix.shard_label }}release linux-aarch64'
    needs:
      - build-release-linux-aarch64
    runs-on: '${{ !contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'' && ''ubuntu-24.04'' || ''ubuntu-24.04-arm'' }}'
    timeout-minutes: 30
    defaults:
      run:
        shell: bash
    strategy:
      matrix:
        include:
          - test_crate: integration
            test_package: integration_tests
            shard_index: '0'
            shard_total: '2'
            shard_label: '(1/2) '
          - test_crate: integration
            test_package: integration_tests
            shard_index: '1'
            shard_total: '2'
            shard_label: '(2/2) '
          - test_crate: node_compat
            test_package: node_compat_tests
            shard_index: '0'
            shard_total: '1'
            shard_label: ''
          - test_crate: specs
            test_package: specs_tests
            shard_index: '0'
            shard_total: '2'
            shard_label: '(1/2) '
          - test_crate: specs
            test_package: specs_tests
            shard_index: '1'
            shard_total: '2'
            shard_label: '(2/2) '
          - test_crate: unit
            test_package: unit_tests
            shard_index: '0'
            shard_total: '1'
            shard_label: ''
          - test_crate: unit_node
            test_package: unit_node_tests
            shard_index: '0'
            shard_total: '1'
            shard_label: ''
      fail-fast: false
    env:
      CARGO_TERM_COLOR: always
      RUST_BACKTRACE: full
      RUST_LIB_BACKTRACE: 0
    steps:
      - name: Configure git
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        run: |-
          git config --global core.symlinks true
          git config --global fetch.parallel 32
      - name: Clone repository
        uses: actions/checkout@v6
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        with:
          fetch-depth: 5
          submodules: false
      - name: Clone submodule ./tests/node_compat/runner/suite
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && matrix.test_crate == ''node_compat'''
        run: git submodule update --init --recursive --depth=1 -- ./tests/node_compat/runner/suite
      - name: Clone submodule ./tests/util/std
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        run: git submodule update --init --recursive --depth=1 -- ./tests/util/std
      - name: Restore cache cargo home
        uses: actions/cache/restore@v4
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        with:
          path: |-
            ~/.cargo/.crates.toml
            ~/.cargo/.crates2.json
            ~/.cargo/bin
            ~/.cargo/registry/index
            ~/.cargo/registry/cache
            ~/.cargo/git/db
          key: never_saved
          restore-keys: '106-cargo-home-linux-aarch64-test-${{ matrix.test_crate }}-'
      - name: Restore cache build output
        uses: actions/cache/restore@v4
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && github.ref != ''refs/heads/main'''
        with:
          path: |-
            ./target
            !./target/*/gn_out
            !./target/*/gn_root
            !./target/*/*.zip
            !./target/*/*.tar.gz
          key: never_saved
          restore-keys: '106-cargo-target-linux-aarch64-release-test-${{ matrix.test_crate }}-'
      - name: Apply and update mtime cache
        uses: ./.github/mtime_cache
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        with:
          cache-path: ./target
      - name: Install Node
        uses: actions/setup-node@v6
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        with:
          node-version: 22
      - uses: dsherret/rust-toolchain-file@v1
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
      - name: Set up incremental LTO and sysroot build
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        run: |-
          # Setting up sysroot
          export DEBIAN_FRONTEND=noninteractive
          # Avoid running man-db triggers, which sometimes takes several minutes
          # to complete.
          sudo apt-get -qq remove --purge -y man-db > /dev/null 2> /dev/null
          # Remove older clang before we install
          sudo apt-get -qq remove   'clang-12*' 'clang-13*' 'clang-14*' 'clang-15*' 'clang-16*' 'clang-17*' 'clang-18*' 'clang-19*' 'llvm-12*' 'llvm-13*' 'llvm-14*' 'llvm-15*' 'llvm-16*' 'llvm-17*' 'llvm-18*' 'llvm-19*' 'lld-12*' 'lld-13*' 'lld-14*' 'lld-15*' 'lld-16*' 'lld-17*' 'lld-18*' 'lld-19*' > /dev/null 2> /dev/null

          # Install clang-XXX, lld-XXX, and debootstrap.
          echo "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-21 main" |
            sudo dd of=/etc/apt/sources.list.d/llvm-toolchain-noble-21.list
          curl https://apt.llvm.org/llvm-snapshot.gpg.key |
            gpg --dearmor                                 |
          sudo dd of=/etc/apt/trusted.gpg.d/llvm-snapshot.gpg
          sudo apt-get update
          # this was unreliable sometimes, so try again if it fails
          sudo apt-get install -y --no-install-recommends clang-21 lld-21 clang-tools-21 clang-format-21 clang-tidy-21 || (echo 'Failed. Trying again.' && sudo apt-get clean && sudo apt-get update && sudo apt-get install -y --no-install-recommends clang-21 lld-21 clang-tools-21 clang-format-21 clang-tidy-21)
          # Fix alternatives
          (yes '' | sudo update-alternatives --force --all) > /dev/null 2> /dev/null || true

          clang-21 -c -o /tmp/memfd_create_shim.o tools/memfd_create_shim.c -fPIC

          echo "Decompressing sysroot..."
          wget -q https://github.com/denoland/deno_sysroot_build/releases/download/sysroot-20250207/sysroot-`uname -m`.tar.xz -O /tmp/sysroot.tar.xz
          cd /
          xzcat /tmp/sysroot.tar.xz | sudo tar -x
          sudo mount --rbind /dev /sysroot/dev
          sudo mount --rbind /sys /sysroot/sys
          sudo mount --rbind /home /sysroot/home
          sudo mount -t proc /proc /sysroot/proc
          cd

          echo "Done."

          # Configure the build environment. Both Rust and Clang will produce
          # llvm bitcode only, so we can use lld's incremental LTO support.

          # Load the sysroot's env vars
          echo "sysroot env:"
          cat /sysroot/.env
          . /sysroot/.env

          # Important notes:
          #   1. -ldl seems to be required to avoid a failure in FFI tests. This flag seems
          #      to be in the Rust default flags in the smoketest, so uncertain why we need
          #      to be explicit here.
          #   2. RUSTFLAGS and RUSTDOCFLAGS must be specified, otherwise the doctests fail
          #      to build because the object formats are not compatible.
          echo "
          CARGO_PROFILE_BENCH_INCREMENTAL=false
          CARGO_PROFILE_RELEASE_INCREMENTAL=false
          RUSTFLAGS<<__1
            -C linker-plugin-lto=true
            -C linker=clang-21
            -C link-arg=-fuse-ld=lld-21
            -C link-arg=-ldl
            -C link-arg=-Wl,--allow-shlib-undefined
            -C link-arg=-Wl,--thinlto-cache-dir=$(pwd)/target/release/lto-cache
            -C link-arg=-Wl,--thinlto-cache-policy,cache_size_bytes=700m
            -C link-arg=/tmp/memfd_create_shim.o
            --cfg tokio_unstable
            $RUSTFLAGS
          __1
          RUSTDOCFLAGS<<__1
            -C linker-plugin-lto=true
            -C linker=clang-21
            -C link-arg=-fuse-ld=lld-21
            -C link-arg=-ldl
            -C link-arg=-Wl,--allow-shlib-undefined
            -C link-arg=-Wl,--thinlto-cache-dir=$(pwd)/target/release/lto-cache
            -C link-arg=-Wl,--thinlto-cache-policy,cache_size_bytes=700m
            -C link-arg=/tmp/memfd_create_shim.o
            --cfg tokio_unstable
            $RUSTFLAGS
          __1
          CC=/usr/bin/clang-21
          CFLAGS=$CFLAGS
          " > $GITHUB_ENV
      - name: Download artifact release-linux-aarch64-deno
        uses: actions/download-artifact@v6
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        with:
          name: release-linux-aarch64-deno
          path: target/release
      - name: Set target/release/deno permissions
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        run: chmod +x target/release/deno
      - name: Download artifact release-linux-aarch64-denort
        uses: actions/download-artifact@v6
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && (matrix.test_crate == ''integration'' || matrix.test_crate == ''specs'')'
        with:
          name: release-linux-aarch64-denort
          path: target/release
      - name: Set target/release/denort permissions
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && (matrix.test_crate == ''integration'' || matrix.test_crate == ''specs'')'
        run: chmod +x target/release/denort
      - name: Download artifact release-linux-aarch64-test-server
        uses: actions/download-artifact@v6
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && (matrix.test_crate == ''integration'' || matrix.test_crate == ''specs'' || matrix.test_crate == ''unit'' || matrix.test_crate == ''unit_node'')'
        with:
          name: release-linux-aarch64-test-server
          path: target/release
      - name: Set target/release/test_server permissions
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && (matrix.test_crate == ''integration'' || matrix.test_crate == ''specs'' || matrix.test_crate == ''unit'' || matrix.test_crate == ''unit_node'')'
        run: chmod +x target/release/test_server
      - name: Set up playwright cache
        uses: actions/cache@v5
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        with:
          path: ./.ms-playwright
          key: 'playwright-${{ runner.os }}-${{ runner.arch }}'
      - name: Load 'vsock_loopback; kernel module
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        run: sudo modprobe vsock_loopback
      - name: Build ffi (release)
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && matrix.test_crate == ''specs'''
        run: cargo build --release -p test_ffi
      - name: Test (release)
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'')'
        env:
          CI_SHARD_INDEX: '${{ github.event_name == ''pull_request'' && matrix.shard_index || '''' }}'
          CI_SHARD_TOTAL: '${{ github.event_name == ''pull_request'' && matrix.shard_total || '''' }}'
        run: 'cargo test -p ${{ matrix.test_package }} --test ${{ matrix.test_crate }} --release'
      - name: Ensure no git changes
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && github.event_name == ''pull_request'''
        run: "if [[ -n \"$(git status --porcelain)\" ]]; then\necho \"❌ Git working directory is dirty. Ensure `cargo test` is not modifying git tracked files.\"\necho \"\"\necho \"\U0001F4CB Status:\"\ngit status\necho \"\"\nexit 1\nfi"
      - name: Upload test results
        uses: actions/upload-artifact@v6
        if: '!startsWith(github.ref, ''refs/tags/'') && !(!contains(github.event.pull_request.labels.*.name, ''ci-full'') && github.event_name == ''pull_request'') && (matrix.shard_index == 0 || github.event_name == ''pull_request'') && always()'
        with:
          name: 'test-results-linux-aarch64-release-${{ matrix.test_crate }}${{ matrix.shard_total > 1 && format(''-shard-{0}'', matrix.shard_index) || '''' }}.json'
          path: 'target/test_results_${{ matrix.test_crate }}.json'
  lint:
    name: 'lint ${{ matrix.profile }} ${{ matrix.os }}-${{ matrix.arch }}'
    needs:
      - pre_build
    if: needs.pre_build.outputs.skip_build != 'true'
    runs-on: '${{ matrix.runner }}'
    timeout-minutes: 30
    defaults:
      run:
        shell: bash
    strategy:
      matrix:
        include:
          - os: linux
            arch: x86_64
            runner: ubuntu-24.04
            profile: debug
            job: lint
          - os: macos
            arch: x86_64
            runner: macos-15-intel
            profile: debug
            job: lint
          - os: windows
            arch: x86_64
            runner: windows-2022
            profile: debug
            job: lint
    steps:
      - name: Configure git
        run: |-
          git config --global core.symlinks true
          git config --global fetch.parallel 32
      - name: Clone repository
        uses: actions/checkout@v6
        with:
          fetch-depth: 5
          submodules: false
      - name: Clone submodule ./tests/util/std
        run: git submodule update --init --recursive --depth=1 -- ./tests/util/std
      - name: Restore cache cargo home
        uses: actions/cache/restore@v4
        if: '!startsWith(github.ref, ''refs/tags/'')'
        with:
          path: |-
            ~/.cargo/.crates.toml
            ~/.cargo/.crates2.json
            ~/.cargo/bin
            ~/.cargo/registry/index
            ~/.cargo/registry/cache
            ~/.cargo/git/db
          key: never_saved
          restore-keys: '106-cargo-home-${{ matrix.os }}-${{ matrix.arch }}-lint-'
      - name: Restore cache build output
        uses: actions/cache/restore@v4
        if: 'github.ref != ''refs/heads/main'' && !startsWith(github.ref, ''refs/tags/'')'
        with:
          path: |-
            ./target
            !./target/*/gn_out
            !./target/*/gn_root
            !./target/*/*.zip
            !./target/*/*.tar.gz
          key: never_saved
          restore-keys: '106-cargo-target-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.profile }}-lint-'
      - name: Apply and update mtime cache
        uses: ./.github/mtime_cache
        with:
          cache-path: ./target
      - uses: dsherret/rust-toolchain-file@v1
      - name: Install Deno
        uses: denoland/setup-deno@v2
        with:
          deno-version: v2.x
      - name: test_format.js
        if: matrix.os == 'linux'
        run: deno run --allow-write --allow-read --allow-run --allow-net ./tools/format.js --check
      - name: jsdoc_checker.js
        if: matrix.os == 'linux'
        run: deno run --allow-read --allow-env --allow-sys ./tools/jsdoc_checker.js
      - name: lint.js
        env:
          GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
        run: deno run --allow-write --allow-read --allow-run --allow-net --allow-env ./tools/lint.js
      - name: Cache cargo home
        uses: actions/cache/save@v4
        if: 'github.ref == ''refs/heads/main'' && !startsWith(github.ref, ''refs/tags/'')'
        with:
          path: |-
            ~/.cargo/.crates.toml
            ~/.cargo/.crates2.json
            ~/.cargo/bin
            ~/.cargo/registry/index
            ~/.cargo/registry/cache
            ~/.cargo/git/db
          key: '106-cargo-home-${{ matrix.os }}-${{ matrix.arch }}-lint-${{ github.sha }}'
      - name: Cache build output
        uses: actions/cache/save@v4
        if: 'github.ref == ''refs/heads/main'' && !startsWith(github.ref, ''refs/tags/'')'
        with:
          path: |-
            ./target
            !./target/*/gn_out
            !./target/*/gn_root
            !./target/*/*.zip
            !./target/*/*.tar.gz
          key: '106-cargo-target-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.profile }}-lint-${{ github.sha }}'
  deno-core-test:
    name: deno_core test linux-x86_64
    needs:
      - pre_build
    if: needs.pre_build.outputs.skip_build != 'true' && needs.pre_build.outputs.skip_deno_core_test != 'true'
    runs-on: ubuntu-24.04
    timeout-minutes: 60
    defaults:
      run:
        shell: bash
    env:
      CARGO_TERM_COLOR: always
      RUST_BACKTRACE: full
      RUST_LIB_BACKTRACE: 0
    steps:
      - name: Configure git
        if: '!startsWith(github.ref, ''refs/tags/'')'
        run: |-
          git config --global core.symlinks true
          git config --global fetch.parallel 32
      - name: Clone repository
        uses: actions/checkout@v6
        if: '!startsWith(github.ref, ''refs/tags/'')'
        with:
          fetch-depth: 5
          submodules: false
      - name: Restore cache cargo home
        uses: actions/cache/restore@v4
        if: '!startsWith(github.ref, ''refs/tags/'')'
        with:
          path: |-
            ~/.cargo/.crates.toml
            ~/.cargo/.crates2.json
            ~/.cargo/bin
            ~/.cargo/registry/index
            ~/.cargo/registry/cache
            ~/.cargo/git/db
          key: never_saved
          restore-keys: 106-cargo-home-linux-x86_64-deno-core-test-
      - name: Restore cache build output
        uses: actions/cache/restore@v4
        if: '!startsWith(github.ref, ''refs/tags/'') && github.ref != ''refs/heads/main'''
        with:
          path: |-
            ./target
            !./target/*/gn_out
            !./target/*/gn_root
            !./target/*/*.zip
            !./target/*/*.tar.gz
          key: never_saved
          restore-keys: 106-cargo-target-linux-x86_64-release-deno-core-test-
      - name: Apply and update mtime cache
        uses: ./.github/mtime_cache
        if: '!startsWith(github.ref, ''refs/tags/'')'
        with:
          cache-path: ./target
      - uses: dsherret/rust-toolchain-file@v1
        if: '!startsWith(github.ref, ''refs/tags/'')'
      - name: Install Deno
        uses: denoland/setup-deno@v2
        if: '!startsWith(github.ref, ''refs/tags/'')'
        with:
          deno-version: v2.x
      - name: Set up incremental LTO and sysroot build
        if: '!startsWith(github.ref, ''refs/tags/'')'
        run: |-
          # Setting up sysroot
          export DEBIAN_FRONTEND=noninteractive
          # Avoid running man-db triggers, which sometimes takes several minutes
          # to complete.
          sudo apt-get -qq remove --purge -y man-db > /dev/null 2> /dev/null
          # Remove older clang before we install
          sudo apt-get -qq remove   'clang-12*' 'clang-13*' 'clang-14*' 'clang-15*' 'clang-16*' 'clang-17*' 'clang-18*' 'clang-19*' 'llvm-12*' 'llvm-13*' 'llvm-14*' 'llvm-15*' 'llvm-16*' 'llvm-17*' 'llvm-18*' 'llvm-19*' 'lld-12*' 'lld-13*' 'lld-14*' 'lld-15*' 'lld-16*' 'lld-17*' 'lld-18*' 'lld-19*' > /dev/null 2> /dev/null

          # Install clang-XXX, lld-XXX, and debootstrap.
          echo "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-21 main" |
            sudo dd of=/etc/apt/sources.list.d/llvm-toolchain-noble-21.list
          curl https://apt.llvm.org/llvm-snapshot.gpg.key |
            gpg --dearmor                                 |
          sudo dd of=/etc/apt/trusted.gpg.d/llvm-snapshot.gpg
          sudo apt-get update
          # this was unreliable sometimes, so try again if it fails
          sudo apt-get install -y --no-install-recommends clang-21 lld-21 clang-tools-21 clang-format-21 clang-tidy-21 || (echo 'Failed. Trying again.' && sudo apt-get clean && sudo apt-get update && sudo apt-get install -y --no-install-recommends clang-21 lld-21 clang-tools-21 clang-format-21 clang-tidy-21)
          # Fix alternatives
          (yes '' | sudo update-alternatives --force --all) > /dev/null 2> /dev/null || true

          clang-21 -c -o /tmp/memfd_create_shim.o tools/memfd_create_shim.c -fPIC

          echo "Decompressing sysroot..."
          wget -q https://github.com/denoland/deno_sysroot_build/releases/download/sysroot-20250207/sysroot-`uname -m`.tar.xz -O /tmp/sysroot.tar.xz
          cd /
          xzcat /tmp/sysroot.tar.xz | sudo tar -x
          sudo mount --rbind /dev /sysroot/dev
          sudo mount --rbind /sys /sysroot/sys
          sudo mount --rbind /home /sysroot/home
          sudo mount -t proc /proc /sysroot/proc
          cd

          echo "Done."

          # Configure the build environment. Both Rust and Clang will produce
          # llvm bitcode only, so we can use lld's incremental LTO support.

          # Load the sysroot's env vars
          echo "sysroot env:"
          cat /sysroot/.env
          . /sysroot/.env

          # Important notes:
          #   1. -ldl seems to be required to avoid a failure in FFI tests. This flag seems
          #      to be in the Rust default flags in the smoketest, so uncertain why we need
          #      to be explicit here.
          #   2. RUSTFLAGS and RUSTDOCFLAGS must be specified, otherwise the doctests fail
          #      to build because the object formats are not compatible.
          echo "
          CARGO_PROFILE_BENCH_INCREMENTAL=false
          CARGO_PROFILE_RELEASE_INCREMENTAL=false
          RUSTFLAGS<<__1
            -C linker-plugin-lto=true
            -C linker=clang-21
            -C link-arg=-fuse-ld=lld-21
            -C link-arg=-ldl
            -C link-arg=-Wl,--allow-shlib-undefined
            -C link-arg=-Wl,--thinlto-cache-dir=$(pwd)/target/release/lto-cache
            -C link-arg=-Wl,--thinlto-cache-policy,cache_size_bytes=700m
            -C link-arg=/tmp/memfd_create_shim.o
            --cfg tokio_unstable
            $RUSTFLAGS
          __1
          RUSTDOCFLAGS<<__1
            -C linker-plugin-lto=true
            -C linker=clang-21
            -C link-arg=-fuse-ld=lld-21
            -C link-arg=-ldl
            -C link-arg=-Wl,--allow-shlib-undefined
            -C link-arg=-Wl,--thinlto-cache-dir=$(pwd)/target/release/lto-cache
            -C link-arg=-Wl,--thinlto-cache-policy,cache_size_bytes=700m
            -C link-arg=/tmp/memfd_create_shim.o
            --cfg tokio_unstable
            $RUSTFLAGS
          __1
          CC=/usr/bin/clang-21
          CFLAGS=$CFLAGS
          " > $GITHUB_ENV
      - name: Install cargo-binstall
        uses: cargo-bins/cargo-binstall@main
        if: '!startsWith(github.ref, ''refs/tags/'')'
      - name: Install nextest
        if: '!startsWith(github.ref, ''refs/tags/'')'
        run: cargo binstall cargo-nextest --secure --locked
      - name: Cargo nextest (release)
        if: '!startsWith(github.ref, ''refs/tags/'')'
        run: |-
          cargo nextest run --release \
                --features "deno_core/default deno_core/include_js_files_for_snapshotting deno_core/unsafe_use_unprotected_platform" \
                --tests --examples \
                -p deno_core -p build-your-own-js-snapshot -p dcore -p deno_ops -p deno_ops_compile_test_runner -p serde_v8 -p deno_core_testing
      - name: Cargo nextest ops compile test runner (release)
        if: '!startsWith(github.ref, ''refs/tags/'')'
        run: cargo nextest run --release -p deno_ops_compile_test_runner
      - name: Cargo doc test
        if: '!startsWith(github.ref, ''refs/tags/'')'
        run: cargo test --doc --release -p deno_core -p build-your-own-js-snapshot -p deno_ops -p serde_v8 -p deno_core_testing
      - name: Run examples (regression tests)
        if: '!startsWith(github.ref, ''refs/tags/'')'
        run: |-
          cargo run -p deno_core --example op2
          cargo run -p deno_core --example op2 --features include_js_files_for_snapshotting
      - name: Cache cargo home
        uses: actions/cache/save@v4
        if: '!startsWith(github.ref, ''refs/tags/'') && github.ref == ''refs/heads/main'''
        with:
          path: |-
            ~/.cargo/.crates.toml
            ~/.cargo/.crates2.json
            ~/.cargo/bin
            ~/.cargo/registry/index
            ~/.cargo/registry/cache
            ~/.cargo/git/db
          key: '106-cargo-home-linux-x86_64-deno-core-test-${{ github.sha }}'
      - name: Cache build output
        uses: actions/cache/save@v4
        if: '!startsWith(github.ref, ''refs/tags/'') && github.ref == ''refs/heads/main'''
        with:
          path: |-
            ./target
            !./target/*/gn_out
            !./target/*/gn_root
            !./target/*/*.zip
            !./target/*/*.tar.gz
          key: '106-cargo-target-linux-x86_64-release-deno-core-test-${{ github.sha }}'
  deno-core-miri:
    name: deno_core miri linux-x86_64
    needs:
      - pre_build
    if: needs.pre_build.outputs.skip_build != 'true'
    runs-on: ubuntu-24.04
    timeout-minutes: 60
    defaults:
      run:
        shell: bash
    env:
      CARGO_TERM_COLOR: always
      RUST_BACKTRACE: full
      RUST_LIB_BACKTRACE: 0
    steps:
      - name: Configure git
        if: '!startsWith(github.ref, ''refs/tags/'')'
        run: |-
          git config --global core.symlinks true
          git config --global fetch.parallel 32
      - name: Clone repository
        uses: actions/checkout@v6
        if: '!startsWith(github.ref, ''refs/tags/'')'
        with:
          fetch-depth: 5
          submodules: false
      - name: Install Rust (nightly)
        uses: dtolnay/rust-toolchain@master
        if: '!startsWith(github.ref, ''refs/tags/'')'
        with:
          toolchain: nightly-2025-11-12
      - name: Cargo test (miri)
        if: '!startsWith(github.ref, ''refs/tags/'')'
        run: |-
          cargo clean
          rustup component add --toolchain nightly-2025-11-12 miri
          # This somehow prints errors in CI that don't show up locally
          RUSTFLAGS=-Awarnings cargo +nightly-2025-11-12 miri test -p deno_core
  ci-status:
    name: ci status
    needs:
      - bench
      - build-debug-macos-x86_64
      - test-debug-macos-x86_64
      - build-release-macos-x86_64
      - test-release-macos-x86_64
      - build-debug-macos-aarch64
      - test-debug-macos-aarch64
      - test-libs-debug-macos-aarch64
      - build-release-macos-aarch64
      - test-release-macos-aarch64
      - build-debug-windows-x86_64
      - test-debug-windows-x86_64
      - test-libs-debug-windows-x86_64
      - build-release-windows-x86_64
      - test-release-windows-x86_64
      - build-debug-windows-aarch64
      - test-debug-windows-aarch64
      - build-release-windows-aarch64
      - test-release-windows-aarch64
      - build-release-linux-x86_64
      - test-release-linux-x86_64
      - wpt-release-linux-x86_64
      - build-debug-linux-x86_64
      - test-debug-linux-x86_64
      - build-libs-debug-linux-x86_64
      - build-debug-linux-aarch64
      - test-debug-linux-aarch64
      - test-libs-debug-linux-aarch64
      - build-release-linux-aarch64
      - test-release-linux-aarch64
      - lint
      - deno-core-test
      - deno-core-miri
      - pre_build
    if: needs.pre_build.outputs.skip_build != 'true' && always()
    runs-on: ubuntu-latest
    steps:
      - name: Ensure CI success
        run: |-
          if [[ "${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}" == "true" ]]; then
            echo 'CI failed'
            exit 1
          fi
  publish-canary:
    name: publish canary
    needs:
      - build-debug-macos-x86_64
      - build-release-macos-x86_64
      - build-debug-macos-aarch64
      - build-release-macos-aarch64
      - build-debug-windows-x86_64
      - build-release-windows-x86_64
      - build-debug-windows-aarch64
      - build-release-windows-aarch64
      - build-release-linux-x86_64
      - build-debug-linux-x86_64
      - build-debug-linux-aarch64
      - build-release-linux-aarch64
    if: github.repository == 'denoland/deno' && github.ref == 'refs/heads/main'
    runs-on: ubuntu-24.04
    steps:
      - name: Authenticate with Google Cloud
        uses: google-github-actions/auth@v3
        with:
          project_id: denoland
          credentials_json: '${{ secrets.GCP_SA_KEY }}'
          export_environment_variables: true
          create_credentials_file: true
      - name: Setup gcloud (unix)
        uses: google-github-actions/setup-gcloud@v3
        with:
          project_id: denoland
      - name: Upload canary version file to dl.deno.land
        env:
          AWS_ACCESS_KEY_ID: '${{ vars.S3_ACCESS_KEY_ID }}'
          AWS_SECRET_ACCESS_KEY: '${{ secrets.S3_SECRET_ACCESS_KEY }}'
          AWS_ENDPOINT_URL_S3: '${{ vars.S3_ENDPOINT }}'
          AWS_DEFAULT_REGION: '${{ vars.S3_REGION }}'
        run: |-
          echo ${{ github.sha }} > canary-latest.txt
          gsutil -h "Cache-Control: no-cache" cp canary-latest.txt gs://dl.deno.land/canary-latest.txt
          aws s3 cp canary-latest.txt s3://dl-deno-land/canary-latest.txt
ecosystem_compat_test matrix .github/workflows/ecosystem_compat_test.yml
Triggers
schedule, workflow_dispatch
Runs on
${{ matrix.runner }}, ubuntu-latest
Jobs
test, summary
Matrix
include, include.os, include.runner→ darwin, linux, macos-latest, ubuntu-latest, windows, windows-latest
Actions
denoland/setup-deno, google-github-actions/auth, google-github-actions/setup-gcloud, denoland/setup-deno, google-github-actions/auth, google-github-actions/setup-gcloud
Commands
  • deno -A tools/ecosystem_compat_tests.ts
  • gsutil -h "Cache-Control: public, max-age=3600" cp tools/ecosystem_report.json gs://dl.deno.land/ecosystem-compat-test/$(date +%F)/report-${{matrix.os}}.json aws s3 cp tools/ecosystem_report.json s3://dl-deno-land/ecosystem-compat-test/$(date +%F)/report-${{matrix.os}}.json
  • deno -A tools/ecosystem_compat_slack.ts
View raw YAML
name: ecosystem_compat_test

on:
  schedule:
    - cron: '0 10 * * 1-5'
  workflow_dispatch:

jobs:
  test:
    runs-on: '${{ matrix.runner }}'
    strategy:
      matrix:
        include:
          - os: linux
            runner: ubuntu-latest
          - os: windows
            runner: windows-latest
          - os: darwin
            runner: macos-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v6
        with:
          submodules: true
      - name: Setup Deno
        uses: denoland/setup-deno@v2
        with:
          deno-version: canary
      - name: Install Python
        uses: actions/setup-python@v6
        with:
          python-version: 3.11
      - name: Authenticate with Google Cloud
        uses: google-github-actions/auth@v3
        with:
          project_id: denoland
          credentials_json: '${{ secrets.GCP_SA_KEY }}'
          export_environment_variables: true
          create_credentials_file: true
      - name: Setup gcloud
        uses: google-github-actions/setup-gcloud@v3
        with:
          project_id: denoland
      - name: Run tests
        run: deno -A tools/ecosystem_compat_tests.ts
      - name: Upload the report to dl.deno.land
        env:
          AWS_ACCESS_KEY_ID: ${{ vars.S3_ACCESS_KEY_ID }}
          AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_SECRET_ACCESS_KEY }}
          AWS_ENDPOINT_URL_S3: ${{ vars.S3_ENDPOINT }}
          AWS_DEFAULT_REGION: ${{vars.S3_REGION }}
        run: |-
          gsutil -h "Cache-Control: public, max-age=3600" cp tools/ecosystem_report.json gs://dl.deno.land/ecosystem-compat-test/$(date +%F)/report-${{matrix.os}}.json
          aws s3 cp tools/ecosystem_report.json s3://dl-deno-land/ecosystem-compat-test/$(date +%F)/report-${{matrix.os}}.json
  summary:
    runs-on: ubuntu-latest
    needs: test
    if: ${{ always() }}
    steps:
      - name: Checkout
        uses: actions/checkout@v6
        with:
          submodules: true
      - name: Setup Deno
        uses: denoland/setup-deno@v2
      - name: Install Python
        uses: actions/setup-python@v6
        with:
          python-version: 3.11
      - name: Authenticate with Google Cloud
        uses: google-github-actions/auth@v3
        with:
          project_id: denoland
          credentials_json: '${{ secrets.GCP_SA_KEY }}'
          export_environment_variables: true
          create_credentials_file: true
      - name: Setup gcloud
        uses: google-github-actions/setup-gcloud@v3
        with:
          project_id: denoland
      - name: Post message to slack channel
        run: deno -A tools/ecosystem_compat_slack.ts
        env:
          SLACK_TOKEN: ${{ secrets.NODE_COMPAT_SLACK_TOKEN }} # NodeCompat bot
          SLACK_CHANNEL: ${{ secrets.NODE_COMPAT_SLACK_CHANNEL }}
node_compat_test matrix .github/workflows/node_compat_test.yml
Triggers
schedule, workflow_dispatch
Runs on
${{ matrix.runner }}, ubuntu-latest
Jobs
test, summary
Matrix
include, include.os, include.runner→ darwin, linux, macos-latest, ubuntu-latest, windows, windows-latest
Actions
dsherret/rust-toolchain-file, denoland/setup-deno, google-github-actions/auth, google-github-actions/setup-gcloud, denoland/setup-deno, google-github-actions/auth, google-github-actions/setup-gcloud
Commands
  • deno task --cwd tests/node_compat/runner test --report
  • gzip tests/node_compat/report.json
  • gsutil -h "Cache-Control: public, max-age=3600" cp tests/node_compat/report.json.gz gs://dl.deno.land/node-compat-test/$(date +%F)/report-${{matrix.os}}.json.gz aws s3 cp tests/node_compat/report.json.gz s3://dl-deno-land/node-compat-test/$(date +%F)/report-${{matrix.os}}.json.gz
  • deno -A --config tests/config/deno.json tests/node_compat/add_day_summary_to_month_summary.ts
  • gzip tests/node_compat/summary.json -k
  • gsutil -h "Cache-Control: public, max-age=3600" cp tests/node_compat/summary.json.gz gs://dl.deno.land/node-compat-test/summary-$(date +%Y-%m).json.gz aws s3 cp tests/node_compat/summary.json.gz s3://dl-deno-land/node-compat-test/summary-$(date +%Y-%m).json.gz
  • deno -A --config tests/config/deno.json tests/node_compat/slack.ts
View raw YAML
name: node_compat_test

on:
  schedule:
    - cron: '0 10 * * 1-5'
  workflow_dispatch:

jobs:
  test:
    runs-on: '${{ matrix.runner }}'
    strategy:
      matrix:
        include:
          - os: linux
            runner: ubuntu-latest
          - os: windows
            runner: windows-latest
          - os: darwin
            runner: macos-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v6
        with:
          submodules: true
      - name: Setup Rust
        uses: dsherret/rust-toolchain-file@v1
      - name: Setup Deno
        uses: denoland/setup-deno@v2
        with:
          deno-version: canary
      - name: Install Python
        uses: actions/setup-python@v6
        with:
          python-version: 3.11
      - name: Authenticate with Google Cloud
        if: github.ref == 'refs/heads/main'
        uses: google-github-actions/auth@v3
        with:
          project_id: denoland
          credentials_json: '${{ secrets.GCP_SA_KEY }}'
          export_environment_variables: true
          create_credentials_file: true
      - name: Setup gcloud
        if: github.ref == 'refs/heads/main'
        uses: google-github-actions/setup-gcloud@v3
        with:
          project_id: denoland
      - name: Run tests
        env:
          # override using ldl in .cargo/config.toml
          CARGO_ENCODED_RUSTFLAGS: ''
        run: deno task --cwd tests/node_compat/runner test --report
      - name: Gzip the report
        run: gzip tests/node_compat/report.json
      - name: Upload the report to dl.deno.land
        if: github.ref == 'refs/heads/main'
        env:
          AWS_ACCESS_KEY_ID: ${{ vars.S3_ACCESS_KEY_ID }}
          AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_SECRET_ACCESS_KEY }}
          AWS_ENDPOINT_URL_S3: ${{ vars.S3_ENDPOINT }}
          AWS_DEFAULT_REGION: ${{vars.S3_REGION }}
        run: |-
          gsutil -h "Cache-Control: public, max-age=3600" cp tests/node_compat/report.json.gz gs://dl.deno.land/node-compat-test/$(date +%F)/report-${{matrix.os}}.json.gz
          aws s3 cp tests/node_compat/report.json.gz s3://dl-deno-land/node-compat-test/$(date +%F)/report-${{matrix.os}}.json.gz
  summary:
    runs-on: ubuntu-latest
    needs: test
    if: ${{ always() && github.ref == 'refs/heads/main' }}
    steps:
      - name: Checkout
        uses: actions/checkout@v6
        with:
          submodules: true
      - name: Setup Deno
        uses: denoland/setup-deno@v2
      - name: Install Python
        uses: actions/setup-python@v6
        with:
          python-version: 3.11
      - name: Authenticate with Google Cloud
        uses: google-github-actions/auth@v3
        with:
          project_id: denoland
          credentials_json: '${{ secrets.GCP_SA_KEY }}'
          export_environment_variables: true
          create_credentials_file: true
      - name: Setup gcloud
        uses: google-github-actions/setup-gcloud@v3
        with:
          project_id: denoland
      - name: Add the day summary to the month summary
        run: deno -A --config tests/config/deno.json tests/node_compat/add_day_summary_to_month_summary.ts
      - name: Gzip the month summary
        run: gzip tests/node_compat/summary.json -k
      - name: Upload the month summary
        env:
          AWS_ACCESS_KEY_ID: ${{ vars.S3_ACCESS_KEY_ID }}
          AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_SECRET_ACCESS_KEY }}
          AWS_ENDPOINT_URL_S3: ${{ vars.S3_ENDPOINT }}
          AWS_DEFAULT_REGION: ${{vars.S3_REGION }}
        run: |-
          gsutil -h "Cache-Control: public, max-age=3600" cp tests/node_compat/summary.json.gz gs://dl.deno.land/node-compat-test/summary-$(date +%Y-%m).json.gz
          aws s3 cp tests/node_compat/summary.json.gz s3://dl-deno-land/node-compat-test/summary-$(date +%Y-%m).json.gz
      - name: Post message to slack channel
        run: deno -A --config tests/config/deno.json tests/node_compat/slack.ts
        env:
          SLACK_TOKEN: ${{ secrets.NODE_COMPAT_SLACK_TOKEN }} # NodeCompat bot
          SLACK_CHANNEL: ${{ secrets.NODE_COMPAT_SLACK_CHANNEL }} # #node-compat channel
npm_publish matrix .github/workflows/npm_publish.yml
Triggers
workflow_dispatch, release
Runs on
ubuntu-latest, ${{ matrix.runner }}, ubuntu-latest
Jobs
build, test, publish
Matrix
runner→ macos-latest, ubuntu-latest, windows-latest
Actions
denoland/setup-deno, denoland/setup-deno
Commands
  • git config --global core.symlinks true git config --global fetch.parallel 32
  • ./tools/release/npm/build.ts ${{ inputs.version || '' }}
  • tar cf tools/release/npm/dist.tar -C tools/release/npm --exclude='node_modules' dist
  • tar xf tools/release/npm/dist.tar -C tools/release/npm
  • mkdir -p "${{ runner.temp }}/verdaccio/storage" cat > "${{ runner.temp }}/verdaccio/config.yaml" << 'HEREDOC' storage: ./storage uplinks: {} packages: '@deno/*': access: $all publish: $all 'deno': access: $all publish: $all '**': access: $all publish: $all max_body_size: 200mb log: { type: stdout, format: pretty, level: warn } HEREDOC
  • npx verdaccio@6 \ --config "${{ runner.temp }}/verdaccio/config.yaml" --listen 4873 & for i in $(seq 1 30); do if curl -s http://localhost:4873/-/ping > /dev/null 2>&1; then echo "Verdaccio is ready" break fi sleep 1 done
  • npm install -g pnpm PNPM_HOME="${{ runner.temp }}/pnpm-global" mkdir -p "$PNPM_HOME" echo "PNPM_HOME=$PNPM_HOME" >> "$GITHUB_ENV" echo "$PNPM_HOME" >> "$GITHUB_PATH"
  • npm config set registry http://localhost:4873/ npm config set //localhost:4873/:_authToken dummy-token
View raw YAML
name: npm_publish

on:
  workflow_dispatch:
    inputs:
      version:
        description: 'Version'
        type: string
      dry_run:
        description: 'Dry run (build and test, but skip publishing to npmjs.org)'
        type: boolean
        default: true
  release:
    types: [published]

jobs:
  build:
    name: npm build
    runs-on: ubuntu-latest
    timeout-minutes: 30

    steps:
      - name: Configure git
        run: |
          git config --global core.symlinks true
          git config --global fetch.parallel 32

      - name: Clone repository
        uses: actions/checkout@v6
        with:
          submodules: recursive

      - name: Install Deno
        uses: denoland/setup-deno@v2
        with:
          deno-version: v2.7.1

      - name: Build npm packages
        run: ./tools/release/npm/build.ts ${{ inputs.version || '' }}

      - name: Tar npm dist (preserves permissions)
        run: tar cf tools/release/npm/dist.tar -C tools/release/npm --exclude='node_modules' dist

      - name: Upload npm dist artifact
        uses: actions/upload-artifact@v6
        with:
          name: npm-dist
          path: tools/release/npm/dist.tar
          retention-days: 1

  test:
    name: 'npm test (${{ matrix.runner }})'
    needs: build
    runs-on: ${{ matrix.runner }}
    timeout-minutes: 15
    strategy:
      fail-fast: false
      matrix:
        runner: [ubuntu-latest, macos-latest, windows-latest]
    defaults:
      run:
        shell: bash

    steps:
      - name: Clone repository
        uses: actions/checkout@v6
        with:
          submodules: false

      - name: Install Node
        uses: actions/setup-node@v6
        with:
          node-version: '24.x'

      - name: Download npm dist artifact
        uses: actions/download-artifact@v6
        with:
          name: npm-dist
          path: tools/release/npm

      - name: Extract npm dist
        run: tar xf tools/release/npm/dist.tar -C tools/release/npm

      - name: Write Verdaccio config
        run: |
          mkdir -p "${{ runner.temp }}/verdaccio/storage"
          cat > "${{ runner.temp }}/verdaccio/config.yaml" << 'HEREDOC'
          storage: ./storage
          uplinks: {}
          packages:
            '@deno/*':
              access: $all
              publish: $all
            'deno':
              access: $all
              publish: $all
            '**':
              access: $all
              publish: $all
          max_body_size: 200mb
          log: { type: stdout, format: pretty, level: warn }
          HEREDOC

      - name: Start Verdaccio
        run: |
          npx verdaccio@6 \
            --config "${{ runner.temp }}/verdaccio/config.yaml" --listen 4873 &
          for i in $(seq 1 30); do
            if curl -s http://localhost:4873/-/ping > /dev/null 2>&1; then
              echo "Verdaccio is ready"
              break
            fi
            sleep 1
          done

      - name: Install pnpm
        run: |
          npm install -g pnpm
          PNPM_HOME="${{ runner.temp }}/pnpm-global"
          mkdir -p "$PNPM_HOME"
          echo "PNPM_HOME=$PNPM_HOME" >> "$GITHUB_ENV"
          echo "$PNPM_HOME" >> "$GITHUB_PATH"

      - name: Configure npm to use Verdaccio
        run: |
          npm config set registry http://localhost:4873/
          npm config set //localhost:4873/:_authToken dummy-token

      - name: Publish packages to Verdaccio
        id: publish-verdaccio
        run: |
          DIST_DIR="tools/release/npm/dist"
          for pkg_dir in "$DIST_DIR"/@deno/*/; do
            echo "Publishing $(basename "$pkg_dir") to Verdaccio..."
            (cd "$pkg_dir" && npm publish --registry http://localhost:4873/)
          done
          echo "Publishing deno to Verdaccio..."
          (cd "$DIST_DIR/deno" && npm publish --registry http://localhost:4873/)
          VERSION=$(node -p "require('./$DIST_DIR/deno/package.json').version")
          echo "version=$VERSION" >> "$GITHUB_OUTPUT"

      - name: Test npm install deno
        run: |
          TEST_DIR="${{ runner.temp }}/npm-test"
          mkdir -p "$TEST_DIR"
          cd "$TEST_DIR"
          npm init -y
          EXPECTED_VERSION="deno ${{ steps.publish-verdaccio.outputs.version }}"
          npm install deno@${{ steps.publish-verdaccio.outputs.version }}
          ACTUAL="$(npx deno -v)"
          echo "$ACTUAL"
          [ "$ACTUAL" = "$EXPECTED_VERSION" ] || { echo "Version mismatch: expected '$EXPECTED_VERSION', got '$ACTUAL'"; exit 1; }

      - name: Test deno via bin.cjs fallback
        run: |
          cd "${{ runner.temp }}/npm-test"
          node node_modules/deno/bin.cjs eval "console.log('npm package works')"

      - name: Test deno via simulated readonly file system
        run: |
          TEST_DIR="${{ runner.temp }}/readonly-test"
          mkdir -p "$TEST_DIR"
          cd "$TEST_DIR"
          npm init -y
          npm install deno@${{ steps.publish-verdaccio.outputs.version }}
          rm -f node_modules/deno/deno*
          DENO_SIMULATED_READONLY_FILE_SYSTEM=1 node node_modules/deno/bin.cjs -v

      - name: Test npm global install deno
        run: |
          EXPECTED_VERSION="deno ${{ steps.publish-verdaccio.outputs.version }}"
          npm install -g deno@${{ steps.publish-verdaccio.outputs.version }}
          ACTUAL="$(deno -v)"
          echo "$ACTUAL"
          [ "$ACTUAL" = "$EXPECTED_VERSION" ] || { echo "Version mismatch: expected '$EXPECTED_VERSION', got '$ACTUAL'"; exit 1; }
          deno eval "console.log('global npm install works')"
          # Verify the global bin entry points directly at the native binary, not bin.cjs
          if [ "$RUNNER_OS" = "Windows" ]; then
            DENO_CMD="$(npm prefix -g)/deno.cmd"
            grep -q "bin.cjs" "$DENO_CMD" && { echo "ERROR: deno.cmd still points to bin.cjs"; exit 1; }
            echo "deno.cmd correctly points to native binary"
          else
            DENO_LINK="$(which deno)"
            LINK_TARGET="$(readlink "$DENO_LINK")"
            echo "deno symlink target: $LINK_TARGET"
            echo "$LINK_TARGET" | grep -q "bin.cjs" && { echo "ERROR: deno symlink still points to bin.cjs"; exit 1; }
            echo "deno symlink correctly points to native binary"
          fi
          npm uninstall -g deno

      - name: Test npm global install deno (--ignore-scripts)
        run: |
          EXPECTED_VERSION="deno ${{ steps.publish-verdaccio.outputs.version }}"
          npm install -g --ignore-scripts deno@${{ steps.publish-verdaccio.outputs.version }}
          ACTUAL="$(deno -v)"
          echo "$ACTUAL"
          [ "$ACTUAL" = "$EXPECTED_VERSION" ] || { echo "Version mismatch: expected '$EXPECTED_VERSION', got '$ACTUAL'"; exit 1; }
          deno eval "console.log('global npm install works')"
          npm uninstall -g deno

      - name: Test pnpm local install deno (without postinstall)
        run: |
          TEST_DIR="${{ runner.temp }}/pnpm-test-no-scripts"
          mkdir -p "$TEST_DIR"
          cd "$TEST_DIR"
          npm init -y
          EXPECTED_VERSION="deno ${{ steps.publish-verdaccio.outputs.version }}"
          pnpm install deno@${{ steps.publish-verdaccio.outputs.version }} --registry http://localhost:4873/
          ACTUAL="$(node node_modules/deno/bin.cjs -v)"
          echo "$ACTUAL"
          [ "$ACTUAL" = "$EXPECTED_VERSION" ] || { echo "Version mismatch: expected '$EXPECTED_VERSION', got '$ACTUAL'"; exit 1; }

      - name: Test pnpm global install deno (without postinstall)
        run: |
          EXPECTED_VERSION="deno ${{ steps.publish-verdaccio.outputs.version }}"
          pnpm install -g deno@${{ steps.publish-verdaccio.outputs.version }} --registry http://localhost:4873/
          ACTUAL="$(node "$PNPM_HOME/global/5/node_modules/deno/bin.cjs" -v)"
          echo "$ACTUAL"
          [ "$ACTUAL" = "$EXPECTED_VERSION" ] || { echo "Version mismatch: expected '$EXPECTED_VERSION', got '$ACTUAL'"; exit 1; }
          pnpm uninstall -g deno

      - name: Allow pnpm build scripts
        run: pnpm config set --global onlyBuiltDependencies '["*"]'

      - name: Test pnpm local install deno (with postinstall)
        run: |
          TEST_DIR="${{ runner.temp }}/pnpm-test"
          mkdir -p "$TEST_DIR"
          cd "$TEST_DIR"
          npm init -y
          EXPECTED_VERSION="deno ${{ steps.publish-verdaccio.outputs.version }}"
          pnpm install deno@${{ steps.publish-verdaccio.outputs.version }} --registry http://localhost:4873/
          ACTUAL="$(pnpm exec deno -v)"
          echo "$ACTUAL"
          [ "$ACTUAL" = "$EXPECTED_VERSION" ] || { echo "Version mismatch: expected '$EXPECTED_VERSION', got '$ACTUAL'"; exit 1; }

      - name: Test pnpm global install deno (with postinstall)
        run: |
          EXPECTED_VERSION="deno ${{ steps.publish-verdaccio.outputs.version }}"
          pnpm install -g deno@${{ steps.publish-verdaccio.outputs.version }} --registry http://localhost:4873/
          ACTUAL="$(deno -v)"
          echo "$ACTUAL"
          [ "$ACTUAL" = "$EXPECTED_VERSION" ] || { echo "Version mismatch: expected '$EXPECTED_VERSION', got '$ACTUAL'"; exit 1; }
          deno eval "console.log('global pnpm install works')"
          pnpm uninstall -g deno

      - name: Test npm local install deno (PowerShell)
        if: runner.os == 'Windows'
        shell: pwsh
        run: |
          cd "${{ runner.temp }}/npm-test"
          npx deno -v
          npx deno eval "console.log('PowerShell npm local install works')"

      - name: Test npm global install deno (PowerShell)
        if: runner.os == 'Windows'
        shell: pwsh
        run: |
          npm install -g deno@${{ steps.publish-verdaccio.outputs.version }}
          deno -v
          deno eval "console.log('PowerShell npm global install works')"
          npm uninstall -g deno

      - name: Test npm local install deno (cmd)
        if: runner.os == 'Windows'
        shell: cmd
        run: |
          cd "${{ runner.temp }}/npm-test"
          npx deno -v
          npx deno eval "console.log('cmd npm local install works')"

      - name: Test npm global install deno (cmd)
        if: runner.os == 'Windows'
        shell: cmd
        run: |
          npm install -g deno@${{ steps.publish-verdaccio.outputs.version }}
          deno -v
          deno eval "console.log('cmd npm global install works')"
          npm uninstall -g deno

  publish:
    name: npm publish
    needs: [build, test]
    if: ${{ !(inputs.dry_run || false) }}
    runs-on: ubuntu-latest
    timeout-minutes: 15
    permissions:
      id-token: write

    steps:
      - name: Configure git
        run: |
          git config --global core.symlinks true
          git config --global fetch.parallel 32

      - name: Clone repository
        uses: actions/checkout@v6
        with:
          submodules: recursive

      - name: Install Deno
        uses: denoland/setup-deno@v2
        with:
          deno-version: v2.7.1

      - name: Install Node
        uses: actions/setup-node@v6
        with:
          node-version: '24.x'
          registry-url: 'https://registry.npmjs.org'

      - name: Download npm dist artifact
        uses: actions/download-artifact@v6
        with:
          name: npm-dist
          path: tools/release/npm

      - name: Extract npm dist
        run: tar xf tools/release/npm/dist.tar -C tools/release/npm

      - name: Publish to npm
        run: ./tools/release/npm/build.ts ${{ inputs.version || '' }} --publish-only
post_publish .github/workflows/post_publish.yml
Triggers
release
Runs on
ubuntu-latest
Jobs
update-dl-version
Actions
denoland/setup-deno, google-github-actions/auth, google-github-actions/setup-gcloud
Commands
  • echo ${GITHUB_REF#refs/*/} > release-latest.txt (deno run --allow-net tools/release/version_greater_latest.ts ${GITHUB_REF#refs/*/} || exit 0) && gsutil -h "Cache-Control: no-cache" cp release-latest.txt gs://dl.deno.land/release-latest.txt && aws s3 cp release-latest.txt s3://dl-deno-land/release-latest.txt
View raw YAML
name: post_publish

on:
  release:
    types: [published]

jobs:
  update-dl-version:
    name: update dl.deno.land version
    runs-on: ubuntu-latest
    if: github.repository == 'denoland/deno'
    steps:
      - name: Clone repository
        uses: actions/checkout@v6
      - uses: denoland/setup-deno@v2
        with:
          deno-version: v2.x
      - name: Authenticate with Google Cloud
        uses: google-github-actions/auth@v3
        with:
          project_id: denoland
          credentials_json: ${{ secrets.GCP_SA_KEY }}
          export_environment_variables: true
          create_credentials_file: true

      - name: Setup gcloud
        uses: google-github-actions/setup-gcloud@v3
        with:
          project_id: denoland

      - name: Upload version file to dl.deno.land
        env:
          AWS_ACCESS_KEY_ID: ${{ vars.S3_ACCESS_KEY_ID }}
          AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_SECRET_ACCESS_KEY }}
          AWS_ENDPOINT_URL_S3: ${{ vars.S3_ENDPOINT }}
          AWS_DEFAULT_REGION: ${{vars.S3_REGION }}
        run: |
          echo ${GITHUB_REF#refs/*/} > release-latest.txt
          (deno run --allow-net tools/release/version_greater_latest.ts ${GITHUB_REF#refs/*/} || exit 0) && gsutil -h "Cache-Control: no-cache" cp release-latest.txt gs://dl.deno.land/release-latest.txt && aws s3 cp release-latest.txt s3://dl-deno-land/release-latest.txt
pr .github/workflows/pr.yml
Triggers
pull_request_target
Runs on
ubuntu-latest
Jobs
main
Actions
denoland/setup-deno
Commands
  • deno run https://raw.githubusercontent.com/denoland/deno/refs/heads/main/tools/verify_pr_title.js "$PR_TITLE"
View raw YAML
name: 'pr'

on:
  pull_request_target:
    types:
      - opened
      - edited
      - synchronize

# WARNING: This workflow runs in the context of the base repository so the
# GITHUB_TOKEN it has access to has full write permissions to the repository.
jobs:
  main:
    name: lint title
    runs-on: ubuntu-latest
    steps:
      - name: Install Deno
        uses: denoland/setup-deno@v2
        with:
          deno-version: canary
      - name: Lint
        env:
          PR_TITLE: '${{ github.event.pull_request.title }}'
        run: deno run https://raw.githubusercontent.com/denoland/deno/refs/heads/main/tools/verify_pr_title.js "$PR_TITLE"
promote_to_release .github/workflows/promote_to_release.yml
Triggers
workflow_dispatch
Runs on
windows-2022, macOS-latest
Jobs
promote-to-release-windows, promote-to-release
Actions
denoland/setup-deno, azure/login, Azure/artifact-signing-action, google-github-actions/auth, google-github-actions/setup-gcloud, denoland/setup-deno
Commands
  • $CANARY_URL="https://dl.deno.land/canary/${{github.event.inputs.commitHash}}" Invoke-WebRequest -Uri "$CANARY_URL/deno-x86_64-pc-windows-msvc.zip" -OutFile "deno-windows.zip" Invoke-WebRequest -Uri "$CANARY_URL/denort-x86_64-pc-windows-msvc.zip" -OutFile "denort-windows.zip" Expand-Archive -Path "deno-windows.zip" -DestinationPath "." Expand-Archive -Path "denort-windows.zip" -DestinationPath "."
  • deno run -A ./tools/release/promote_to_release_windows.ts ${{github.event.inputs.releaseKind}}
  • $SignTool = Get-ChildItem -Path "C:\Program Files*\Windows Kits\*\bin\*\x64\signtool.exe" -Recurse -ErrorAction SilentlyContinue | Select-Object -First 1 $SignToolPath = $SignTool.FullName & $SignToolPath verify /pa /v "deno.exe"
  • Compress-Archive -Path "deno.exe" -DestinationPath "deno-x86_64-pc-windows-msvc.zip" -Force Compress-Archive -Path "denort.exe" -DestinationPath "denort-x86_64-pc-windows-msvc.zip" -Force
  • ./tools/install_prebuilt.js rcodesign echo $GITHUB_WORKSPACE/third_party/prebuilt/mac >> $GITHUB_PATH
  • deno run -A ./tools/release/promote_to_release.ts ${{github.event.inputs.releaseKind}} ${{github.event.inputs.commitHash}}
  • # Unzip a binary to get the version unzip -o deno-x86_64-apple-darwin.zip DENO_VERSION=$(./deno -V | cut -d ' ' -f 2 | cut -d '+' -f 1) echo "v${DENO_VERSION}" > release-${{github.event.inputs.releaseKind}}-latest.txt rm -f ./deno
  • gsutil -h "Cache-Control: public, max-age=3600" cp ./*.zip gs://dl.deno.land/release/$(cat release-${{github.event.inputs.releaseKind}}-latest.txt)/ gsutil -h "Cache-Control: no-cache" cp release-${{github.event.inputs.releaseKind}}-latest.txt gs://dl.deno.land/release-${{github.event.inputs.releaseKind}}-latest.txt aws s3 sync ./ s3://dl-deno-land/release/$(cat release-${{github.event.inputs.releaseKind}}-latest.txt)/ --exclude "*" --include "*.zip" aws s3 cp release-${{github.event.inputs.releaseKind}}-latest.txt s3://dl-deno-land/release-${{github.event.inputs.releaseKind}}-latest.txt
View raw YAML
name: promote_to_release

on:
  workflow_dispatch:
    inputs:
      releaseKind:
        description: 'Kind of release'
        type: choice
        options:
          - rc
          - lts
        required: true
      commitHash:
        description: Commit to promote to release
        required: true

jobs:
  # Handle Windows binary patching and re-signing in a separate job
  promote-to-release-windows:
    name: Promote Windows to Release
    runs-on: windows-2022
    if: github.repository == 'denoland/deno'
    permissions:
      contents: write
      id-token: write # Required for GitHub OIDC with Azure for code signing
    environment:
      name: build
    steps:
      - name: Clone repository
        uses: actions/checkout@v6
        with:
          token: ${{ secrets.DENOBOT_PAT }}
          submodules: false

      - name: Install deno
        uses: denoland/setup-deno@v2
        with:
          deno-version: v2.x

      - name: Download Windows binaries
        run: |
          $CANARY_URL="https://dl.deno.land/canary/${{github.event.inputs.commitHash}}"
          Invoke-WebRequest -Uri "$CANARY_URL/deno-x86_64-pc-windows-msvc.zip" -OutFile "deno-windows.zip"
          Invoke-WebRequest -Uri "$CANARY_URL/denort-x86_64-pc-windows-msvc.zip" -OutFile "denort-windows.zip"
          Expand-Archive -Path "deno-windows.zip" -DestinationPath "."
          Expand-Archive -Path "denort-windows.zip" -DestinationPath "."

      - name: Run patchver for Windows
        run: |
          deno run -A ./tools/release/promote_to_release_windows.ts ${{github.event.inputs.releaseKind}}

      - name: Authenticate with Azure
        uses: azure/login@v1
        with:
          client-id: ${{ secrets.AZURE_CLIENT_ID }}
          tenant-id: ${{ secrets.AZURE_TENANT_ID }}
          subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
          enable-AzPSSession: true

      - name: Code sign deno.exe
        uses: Azure/artifact-signing-action@v0
        with:
          cache-dependencies: false
          trace: true
          endpoint: https://eus.codesigning.azure.net/
          trusted-signing-account-name: deno-cli-code-signing
          certificate-profile-name: deno-cli-code-signing-cert
          files-folder: .
          files-folder-filter: deno.exe
          file-digest: SHA256
          timestamp-rfc3161: http://timestamp.acs.microsoft.com
          timestamp-digest: SHA256
          exclude-environment-credential: true
          exclude-workload-identity-credential: true
          exclude-managed-identity-credential: true
          exclude-shared-token-cache-credential: true
          exclude-visual-studio-credential: true
          exclude-visual-studio-code-credential: true
          exclude-azure-cli-credential: false

      - name: Verify signature
        shell: pwsh
        run: |
          $SignTool = Get-ChildItem -Path "C:\Program Files*\Windows Kits\*\bin\*\x64\signtool.exe" -Recurse -ErrorAction SilentlyContinue | Select-Object -First 1
          $SignToolPath = $SignTool.FullName
          & $SignToolPath verify /pa /v "deno.exe"

      - name: Create archives
        run: |
          Compress-Archive -Path "deno.exe" -DestinationPath "deno-x86_64-pc-windows-msvc.zip" -Force
          Compress-Archive -Path "denort.exe" -DestinationPath "denort-x86_64-pc-windows-msvc.zip" -Force

      - name: Upload Windows archives
        uses: actions/upload-artifact@v6
        with:
          name: windows-binaries
          path: |
            deno-x86_64-pc-windows-msvc.zip
            denort-x86_64-pc-windows-msvc.zip

  # Handle all other binaries on macOS
  promote-to-release:
    name: Promote to Release
    runs-on: macOS-latest
    if: github.repository == 'denoland/deno'
    needs: promote-to-release-windows
    steps:
      - name: Clone repository
        uses: actions/checkout@v6
        with:
          token: ${{ secrets.DENOBOT_PAT }}
          submodules: recursive

      - name: Authenticate with Google Cloud
        uses: google-github-actions/auth@v3
        with:
          project_id: denoland
          credentials_json: ${{ secrets.GCP_SA_KEY }}
          export_environment_variables: true
          create_credentials_file: true

      - name: Setup gcloud
        uses: google-github-actions/setup-gcloud@v3
        with:
          project_id: denoland

      - name: Install deno
        uses: denoland/setup-deno@v2
        with:
          deno-version: v2.x

      - name: Install rust-codesign
        run: |-
          ./tools/install_prebuilt.js rcodesign
          echo $GITHUB_WORKSPACE/third_party/prebuilt/mac >> $GITHUB_PATH

      - name: Promote to Release (non-Windows)
        env:
          APPLE_CODESIGN_KEY: '${{ secrets.APPLE_CODESIGN_KEY }}'
          APPLE_CODESIGN_PASSWORD: '${{ secrets.APPLE_CODESIGN_PASSWORD }}'
        run: |
          deno run -A ./tools/release/promote_to_release.ts ${{github.event.inputs.releaseKind}} ${{github.event.inputs.commitHash}}

      - name: Download Windows binaries
        uses: actions/download-artifact@v7
        with:
          name: windows-binaries
          path: .

      - name: Create version file
        run: |
          # Unzip a binary to get the version
          unzip -o deno-x86_64-apple-darwin.zip
          DENO_VERSION=$(./deno -V | cut -d ' ' -f 2 | cut -d '+' -f 1)
          echo "v${DENO_VERSION}" > release-${{github.event.inputs.releaseKind}}-latest.txt
          rm -f ./deno

      - name: Upload archives to dl.deno.land
        env:
          AWS_ACCESS_KEY_ID: ${{ vars.S3_ACCESS_KEY_ID }}
          AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_SECRET_ACCESS_KEY }}
          AWS_ENDPOINT_URL_S3: ${{ vars.S3_ENDPOINT }}
          AWS_DEFAULT_REGION: ${{vars.S3_REGION }}
        run: |
          gsutil -h "Cache-Control: public, max-age=3600" cp ./*.zip gs://dl.deno.land/release/$(cat release-${{github.event.inputs.releaseKind}}-latest.txt)/
          gsutil -h "Cache-Control: no-cache" cp release-${{github.event.inputs.releaseKind}}-latest.txt gs://dl.deno.land/release-${{github.event.inputs.releaseKind}}-latest.txt
          aws s3 sync ./ s3://dl-deno-land/release/$(cat release-${{github.event.inputs.releaseKind}}-latest.txt)/ --exclude "*" --include "*.zip"
          aws s3 cp release-${{github.event.inputs.releaseKind}}-latest.txt s3://dl-deno-land/release-${{github.event.inputs.releaseKind}}-latest.txt
start_release .github/workflows/start_release.yml
Triggers
workflow_dispatch
Runs on
ubuntu-24.04
Jobs
build
Actions
denoland/setup-deno
Commands
  • git config --global core.symlinks true git config --global fetch.parallel 32
  • ./tools/release/00_start_release.ts --${{github.event.inputs.releaseKind}}
View raw YAML
name: start_release

on:
  workflow_dispatch:
    inputs:
      releaseKind:
        description: 'Kind of release'
        default: 'patch'
        type: choice
        options:
          - patch
          - minor
          - major
        required: true

jobs:
  build:
    name: start release
    runs-on: ubuntu-24.04
    timeout-minutes: 30

    env:
      CARGO_TERM_COLOR: always
      RUST_BACKTRACE: full
      RUSTC_FORCE_INCREMENTAL: 1

    steps:
      - name: Configure git
        run: |
          git config --global core.symlinks true
          git config --global fetch.parallel 32

      - name: Clone repository
        uses: actions/checkout@v6

      - name: Install deno
        uses: denoland/setup-deno@v2
        with:
          deno-version: v2.x

      - name: Create Gist URL
        env:
          GITHUB_TOKEN: ${{ secrets.DENOBOT_GIST_PAT }}
          GH_WORKFLOW_ACTOR: ${{ github.actor }}
        run: ./tools/release/00_start_release.ts --${{github.event.inputs.releaseKind}}
version_bump .github/workflows/version_bump.yml
Triggers
workflow_dispatch
Runs on
ubuntu-24.04
Jobs
build
Actions
dsherret/rust-toolchain-file, denoland/setup-deno
Commands
  • git config --global core.symlinks true git config --global fetch.parallel 32
  • git remote add upstream https://github.com/denoland/deno ./tools/release/01_bump_crate_versions.ts --${{github.event.inputs.releaseKind}}
  • git config user.email "${{ github.actor }}@users.noreply.github.com" git config user.name "${{ github.actor }}" ./tools/release/02_create_pr.ts
View raw YAML
name: version_bump

on:
  workflow_dispatch:
    inputs:
      releaseKind:
        description: 'Kind of version bump'
        default: 'patch'
        type: choice
        options:
          - patch
          - minor
          - major
          - rc
        required: true

jobs:
  build:
    name: version bump
    runs-on: ubuntu-24.04
    timeout-minutes: 90

    env:
      CARGO_TERM_COLOR: always
      RUST_BACKTRACE: full
      RUSTC_FORCE_INCREMENTAL: 1

    steps:
      - name: Configure git
        run: |
          git config --global core.symlinks true
          git config --global fetch.parallel 32

      - name: Clone repository
        uses: actions/checkout@v6
        with:
          token: ${{ secrets.DENOBOT_PAT }}
          submodules: recursive

      - uses: dsherret/rust-toolchain-file@v1

      - name: Install deno
        uses: denoland/setup-deno@v2
        with:
          deno-version: v2.x

      - name: Run version bump
        run: |
          git remote add upstream https://github.com/denoland/deno
          ./tools/release/01_bump_crate_versions.ts --${{github.event.inputs.releaseKind}}

      - name: Create PR
        env:
          GITHUB_TOKEN: ${{ secrets.DENOBOT_PAT }}
          GH_WORKFLOW_ACTOR: ${{ github.actor }}
        run: |
          git config user.email "${{ github.actor }}@users.noreply.github.com"
          git config user.name "${{ github.actor }}"
          ./tools/release/02_create_pr.ts