0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-02-08 07:16:56 -05:00

chore: upgrade CI workflows to use Node 20 (#22304)

No longer uses Node 16, which is deprecated.
This commit is contained in:
Asher Gomez 2024-02-07 08:47:44 +11:00 committed by GitHub
parent c8b2af8ed1
commit 9955cbdb56
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 15 additions and 15 deletions

View file

@ -1,9 +1,9 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
// This file contains the implementation of a Github Action. Github uses // This file contains the implementation of a Github Action. Github uses
// Node.js v12.x to run actions, so this is Node code and not Deno code. // Node.js v20.x to run actions, so this is Node code and not Deno code.
const { spawn } = require("child_process"); const { spawn } = require("child_process");
const fs = require("fs"); const { existsSync } = require("fs");
const { utimes, mkdir, readFile, writeFile } = require("fs/promises"); const { utimes, mkdir, readFile, writeFile } = require("fs/promises");
const { dirname, resolve } = require("path"); const { dirname, resolve } = require("path");
const { StringDecoder } = require("string_decoder"); const { StringDecoder } = require("string_decoder");
@ -147,7 +147,7 @@ async function* ls(dir = "") {
break; break;
case "160000": // Git submodule. case "160000": // Git submodule.
// sometimes we don't checkout all submodules // sometimes we don't checkout all submodules
if (fs.existsSync(path)) { if (existsSync(path)) {
yield* ls(path); yield* ls(path);
} }
break; break;

View file

@ -7,4 +7,4 @@ inputs:
required: true required: true
runs: runs:
main: action.js main: action.js
using: node16 using: node20

View file

@ -24,7 +24,7 @@ jobs:
steps: steps:
- name: Clone repository - name: Clone repository
uses: actions/checkout@v3 uses: actions/checkout@v4
with: with:
submodules: true submodules: true
persist-credentials: false persist-credentials: false
@ -32,7 +32,7 @@ jobs:
- uses: dsherret/rust-toolchain-file@v1 - uses: dsherret/rust-toolchain-file@v1
- name: Install protoc - name: Install protoc
uses: arduino/setup-protoc@v2 uses: arduino/setup-protoc@v3
with: with:
version: "21.12" version: "21.12"
repo-token: ${{ secrets.GITHUB_TOKEN }} repo-token: ${{ secrets.GITHUB_TOKEN }}

View file

@ -20,7 +20,7 @@ jobs:
git config --global fetch.parallel 32 git config --global fetch.parallel 32
- name: Clone repository - name: Clone repository
uses: actions/checkout@v3 uses: actions/checkout@v4
with: with:
token: ${{ secrets.DENOBOT_PAT }} token: ${{ secrets.DENOBOT_PAT }}
submodules: recursive submodules: recursive
@ -35,7 +35,7 @@ jobs:
deno-version: v1.31.3 deno-version: v1.31.3
- name: Install protoc - name: Install protoc
uses: arduino/setup-protoc@v2 uses: arduino/setup-protoc@v3
with: with:
version: '21.12' version: '21.12'
repo-token: '${{ secrets.GITHUB_TOKEN }}' repo-token: '${{ secrets.GITHUB_TOKEN }}'

View file

@ -141,7 +141,7 @@ const cloneRepoStep = [{
].join("\n"), ].join("\n"),
}, { }, {
name: "Clone repository", name: "Clone repository",
uses: "actions/checkout@v3", uses: "actions/checkout@v4",
with: { with: {
// Use depth > 1, because sometimes we need to rebuild main and if // Use depth > 1, because sometimes we need to rebuild main and if
// other commits have landed it will become impossible to rebuild if // other commits have landed it will become impossible to rebuild if
@ -181,7 +181,7 @@ const installNodeStep = {
}; };
const installProtocStep = { const installProtocStep = {
name: "Install protoc", name: "Install protoc",
uses: "arduino/setup-protoc@v2", uses: "arduino/setup-protoc@v3",
with: { "version": "21.12", "repo-token": "${{ secrets.GITHUB_TOKEN }}" }, with: { "version": "21.12", "repo-token": "${{ secrets.GITHUB_TOKEN }}" },
}; };
const installDenoStep = { const installDenoStep = {
@ -558,7 +558,7 @@ const ci = {
}, },
{ {
name: "Cache Cargo home", name: "Cache Cargo home",
uses: "actions/cache@v3", uses: "actions/cache@v4",
with: { with: {
// See https://doc.rust-lang.org/cargo/guide/cargo-home.html#caching-the-cargo-home-in-ci // See https://doc.rust-lang.org/cargo/guide/cargo-home.html#caching-the-cargo-home-in-ci
// Note that with the new sparse registry format, we no longer have to cache a `.git` dir // Note that with the new sparse registry format, we no longer have to cache a `.git` dir
@ -990,7 +990,7 @@ const ci = {
{ {
// In main branch, always create a fresh cache // In main branch, always create a fresh cache
name: "Save cache build output (main)", name: "Save cache build output (main)",
uses: "actions/cache/save@v3", uses: "actions/cache/save@v4",
if: if:
"(matrix.job == 'test' || matrix.job == 'lint') && github.ref == 'refs/heads/main'", "(matrix.job == 'test' || matrix.job == 'lint') && github.ref == 'refs/heads/main'",
with: { with: {

View file

@ -31,7 +31,7 @@ jobs:
git config --global fetch.parallel 32 git config --global fetch.parallel 32
- name: Clone repository - name: Clone repository
uses: actions/checkout@v3 uses: actions/checkout@v4
- name: Install deno - name: Install deno
uses: denoland/setup-deno@v1 uses: denoland/setup-deno@v1

View file

@ -31,7 +31,7 @@ jobs:
git config --global fetch.parallel 32 git config --global fetch.parallel 32
- name: Clone repository - name: Clone repository
uses: actions/checkout@v3 uses: actions/checkout@v4
with: with:
token: ${{ secrets.DENOBOT_PAT }} token: ${{ secrets.DENOBOT_PAT }}
submodules: recursive submodules: recursive

View file

@ -24,7 +24,7 @@ jobs:
steps: steps:
- name: Clone repository - name: Clone repository
uses: actions/checkout@v3 uses: actions/checkout@v4
with: with:
submodules: true submodules: true
persist-credentials: false persist-credentials: false