mirror of
https://github.com/denoland/deno.git
synced 2025-02-23 13:43:31 -05:00
ci: update Windows runner, update Google Cloud integration, update Node (#17358)
This commit rolls up following PRs into a single one: - https://github.com/denoland/deno/pull/16672 - https://github.com/denoland/deno/pull/16674 - https://github.com/denoland/deno/pull/16972 Generation script was updated to take into account these changes. Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com> Co-authored-by: Geert-Jan Zwiers <geertjanzwiers@protonmail.com> Co-authored-by: David Sherret <dsherret@gmail.com>
This commit is contained in:
parent
92a4ecd938
commit
9e5949fa52
5 changed files with 83 additions and 45 deletions
9
.github/mtime_cache/action.js
vendored
9
.github/mtime_cache/action.js
vendored
|
@ -3,15 +3,10 @@
|
||||||
// Node.js v12.x to run actions, so this is Node code and not Deno code.
|
// Node.js v12.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 { 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");
|
||||||
const { promisify } = require("util");
|
|
||||||
|
|
||||||
const fs = require("fs");
|
|
||||||
const utimes = promisify(fs.utimes);
|
|
||||||
const mkdir = promisify(fs.mkdir);
|
|
||||||
const readFile = promisify(fs.readFile);
|
|
||||||
const writeFile = promisify(fs.writeFile);
|
|
||||||
|
|
||||||
process.on("unhandledRejection", abort);
|
process.on("unhandledRejection", abort);
|
||||||
main().catch(abort);
|
main().catch(abort);
|
||||||
|
|
2
.github/mtime_cache/action.yml
vendored
2
.github/mtime_cache/action.yml
vendored
|
@ -7,4 +7,4 @@ inputs:
|
||||||
required: true
|
required: true
|
||||||
runs:
|
runs:
|
||||||
main: action.js
|
main: action.js
|
||||||
using: node12
|
using: node16
|
||||||
|
|
43
.github/workflows/ci.generate.ts
vendored
Normal file → Executable file
43
.github/workflows/ci.generate.ts
vendored
Normal file → Executable file
|
@ -7,7 +7,7 @@ const Runners = {
|
||||||
"${{ github.repository == 'denoland/deno' && 'ubuntu-20.04-xl' || 'ubuntu-20.04' }}",
|
"${{ github.repository == 'denoland/deno' && 'ubuntu-20.04-xl' || 'ubuntu-20.04' }}",
|
||||||
macos: "macos-12",
|
macos: "macos-12",
|
||||||
windows:
|
windows:
|
||||||
"${{ github.repository == 'denoland/deno' && 'windows-2019-xl' || 'windows-2019' }}",
|
"${{ github.repository == 'denoland/deno' && 'windows-2022-xl' || 'windows-2022' }}",
|
||||||
};
|
};
|
||||||
|
|
||||||
const sysRootStep = {
|
const sysRootStep = {
|
||||||
|
@ -106,6 +106,24 @@ const installDenoStep = {
|
||||||
with: { "deno-version": "v1.x" },
|
with: { "deno-version": "v1.x" },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const authenticateWithGoogleCloud = {
|
||||||
|
name: "Authenticate with Google Cloud",
|
||||||
|
if: [
|
||||||
|
"matrix.profile == 'release' &&",
|
||||||
|
"matrix.job == 'test' &&",
|
||||||
|
"github.repository == 'denoland/deno' &&",
|
||||||
|
"(github.ref == 'refs/heads/main' ||",
|
||||||
|
"startsWith(github.ref, 'refs/tags/'))",
|
||||||
|
].join("\n"),
|
||||||
|
uses: "google-github-actions/auth@v1",
|
||||||
|
with: {
|
||||||
|
"project_id": "denoland",
|
||||||
|
"credentials_json": "${{ secrets.GCP_SA_KEY }}",
|
||||||
|
"export_environment_variables": true,
|
||||||
|
"create_credentials_file": true,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
function cancelEarlyIfDraftPr(
|
function cancelEarlyIfDraftPr(
|
||||||
nextSteps: Record<string, unknown>[],
|
nextSteps: Record<string, unknown>[],
|
||||||
): Record<string, unknown>[] {
|
): Record<string, unknown>[] {
|
||||||
|
@ -306,6 +324,7 @@ const ci = {
|
||||||
},
|
},
|
||||||
...installPythonSteps,
|
...installPythonSteps,
|
||||||
installNodeStep,
|
installNodeStep,
|
||||||
|
authenticateWithGoogleCloud,
|
||||||
{
|
{
|
||||||
name: "Setup gcloud (unix)",
|
name: "Setup gcloud (unix)",
|
||||||
if: [
|
if: [
|
||||||
|
@ -316,11 +335,9 @@ const ci = {
|
||||||
"(github.ref == 'refs/heads/main' ||",
|
"(github.ref == 'refs/heads/main' ||",
|
||||||
"startsWith(github.ref, 'refs/tags/'))",
|
"startsWith(github.ref, 'refs/tags/'))",
|
||||||
].join("\n"),
|
].join("\n"),
|
||||||
uses: "google-github-actions/setup-gcloud@v0",
|
uses: "google-github-actions/setup-gcloud@v1",
|
||||||
with: {
|
with: {
|
||||||
project_id: "denoland",
|
project_id: "denoland",
|
||||||
service_account_key: "${{ secrets.GCP_SA_KEY }}",
|
|
||||||
export_default_credentials: true,
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -333,14 +350,12 @@ const ci = {
|
||||||
"(github.ref == 'refs/heads/main' ||",
|
"(github.ref == 'refs/heads/main' ||",
|
||||||
"startsWith(github.ref, 'refs/tags/'))",
|
"startsWith(github.ref, 'refs/tags/'))",
|
||||||
].join("\n"),
|
].join("\n"),
|
||||||
uses: "google-github-actions/setup-gcloud@v0",
|
uses: "google-github-actions/setup-gcloud@v1",
|
||||||
env: {
|
env: {
|
||||||
CLOUDSDK_PYTHON: "${{env.pythonLocation}}\\python.exe",
|
CLOUDSDK_PYTHON: "${{env.pythonLocation}}\\python.exe",
|
||||||
},
|
},
|
||||||
with: {
|
with: {
|
||||||
project_id: "denoland",
|
project_id: "denoland",
|
||||||
service_account_key: "${{ secrets.GCP_SA_KEY }}",
|
|
||||||
export_default_credentials: true,
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -825,21 +840,23 @@ const ci = {
|
||||||
needs: ["build"],
|
needs: ["build"],
|
||||||
if:
|
if:
|
||||||
"github.repository == 'denoland/deno' && github.ref == 'refs/heads/main'",
|
"github.repository == 'denoland/deno' && github.ref == 'refs/heads/main'",
|
||||||
steps: [{
|
steps: [
|
||||||
|
authenticateWithGoogleCloud,
|
||||||
|
{
|
||||||
name: "Setup gcloud",
|
name: "Setup gcloud",
|
||||||
uses: "google-github-actions/setup-gcloud@v0",
|
uses: "google-github-actions/setup-gcloud@v1",
|
||||||
with: {
|
with: {
|
||||||
project_id: "denoland",
|
project_id: "denoland",
|
||||||
service_account_key: "${{ secrets.GCP_SA_KEY }}",
|
|
||||||
export_default_credentials: true,
|
|
||||||
},
|
},
|
||||||
}, {
|
},
|
||||||
|
{
|
||||||
name: "Upload canary version file to dl.deno.land",
|
name: "Upload canary version file to dl.deno.land",
|
||||||
run: [
|
run: [
|
||||||
"echo ${{ github.sha }} > canary-latest.txt",
|
"echo ${{ github.sha }} > canary-latest.txt",
|
||||||
'gsutil -h "Cache-Control: no-cache" cp canary-latest.txt gs://dl.deno.land/canary-latest.txt',
|
'gsutil -h "Cache-Control: no-cache" cp canary-latest.txt gs://dl.deno.land/canary-latest.txt',
|
||||||
].join("\n"),
|
].join("\n"),
|
||||||
}],
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
44
.github/workflows/ci.yml
vendored
44
.github/workflows/ci.yml
vendored
|
@ -34,10 +34,10 @@ jobs:
|
||||||
job: test
|
job: test
|
||||||
profile: release
|
profile: release
|
||||||
skip_pr: true
|
skip_pr: true
|
||||||
- os: '${{ github.repository == ''denoland/deno'' && ''windows-2019-xl'' || ''windows-2019'' }}'
|
- os: '${{ github.repository == ''denoland/deno'' && ''windows-2022-xl'' || ''windows-2022'' }}'
|
||||||
job: test
|
job: test
|
||||||
profile: fastci
|
profile: fastci
|
||||||
- os: '${{ github.repository == ''denoland/deno'' && ''windows-2019-xl'' || ''windows-2019'' }}'
|
- os: '${{ github.repository == ''denoland/deno'' && ''windows-2022-xl'' || ''windows-2022'' }}'
|
||||||
job: test
|
job: test
|
||||||
profile: release
|
profile: release
|
||||||
skip_pr: true
|
skip_pr: true
|
||||||
|
@ -125,6 +125,19 @@ jobs:
|
||||||
with:
|
with:
|
||||||
node-version: 18
|
node-version: 18
|
||||||
if: '!(github.event_name == ''pull_request'' && matrix.skip_pr) && (steps.exit_early.outputs.EXIT_EARLY != ''true'')'
|
if: '!(github.event_name == ''pull_request'' && matrix.skip_pr) && (steps.exit_early.outputs.EXIT_EARLY != ''true'')'
|
||||||
|
- name: Authenticate with Google Cloud
|
||||||
|
if: |-
|
||||||
|
!(github.event_name == 'pull_request' && matrix.skip_pr) && (steps.exit_early.outputs.EXIT_EARLY != 'true' && (matrix.profile == 'release' &&
|
||||||
|
matrix.job == 'test' &&
|
||||||
|
github.repository == 'denoland/deno' &&
|
||||||
|
(github.ref == 'refs/heads/main' ||
|
||||||
|
startsWith(github.ref, 'refs/tags/'))))
|
||||||
|
uses: google-github-actions/auth@v1
|
||||||
|
with:
|
||||||
|
project_id: denoland
|
||||||
|
credentials_json: '${{ secrets.GCP_SA_KEY }}'
|
||||||
|
export_environment_variables: true
|
||||||
|
create_credentials_file: true
|
||||||
- name: Setup gcloud (unix)
|
- name: Setup gcloud (unix)
|
||||||
if: |-
|
if: |-
|
||||||
!(github.event_name == 'pull_request' && matrix.skip_pr) && (steps.exit_early.outputs.EXIT_EARLY != 'true' && (runner.os != 'Windows' &&
|
!(github.event_name == 'pull_request' && matrix.skip_pr) && (steps.exit_early.outputs.EXIT_EARLY != 'true' && (runner.os != 'Windows' &&
|
||||||
|
@ -133,11 +146,9 @@ jobs:
|
||||||
github.repository == 'denoland/deno' &&
|
github.repository == 'denoland/deno' &&
|
||||||
(github.ref == 'refs/heads/main' ||
|
(github.ref == 'refs/heads/main' ||
|
||||||
startsWith(github.ref, 'refs/tags/'))))
|
startsWith(github.ref, 'refs/tags/'))))
|
||||||
uses: google-github-actions/setup-gcloud@v0
|
uses: google-github-actions/setup-gcloud@v1
|
||||||
with:
|
with:
|
||||||
project_id: denoland
|
project_id: denoland
|
||||||
service_account_key: '${{ secrets.GCP_SA_KEY }}'
|
|
||||||
export_default_credentials: true
|
|
||||||
- name: Setup gcloud (windows)
|
- name: Setup gcloud (windows)
|
||||||
if: |-
|
if: |-
|
||||||
!(github.event_name == 'pull_request' && matrix.skip_pr) && (steps.exit_early.outputs.EXIT_EARLY != 'true' && (runner.os == 'Windows' &&
|
!(github.event_name == 'pull_request' && matrix.skip_pr) && (steps.exit_early.outputs.EXIT_EARLY != 'true' && (runner.os == 'Windows' &&
|
||||||
|
@ -146,13 +157,11 @@ jobs:
|
||||||
github.repository == 'denoland/deno' &&
|
github.repository == 'denoland/deno' &&
|
||||||
(github.ref == 'refs/heads/main' ||
|
(github.ref == 'refs/heads/main' ||
|
||||||
startsWith(github.ref, 'refs/tags/'))))
|
startsWith(github.ref, 'refs/tags/'))))
|
||||||
uses: google-github-actions/setup-gcloud@v0
|
uses: google-github-actions/setup-gcloud@v1
|
||||||
env:
|
env:
|
||||||
CLOUDSDK_PYTHON: '${{env.pythonLocation}}\python.exe'
|
CLOUDSDK_PYTHON: '${{env.pythonLocation}}\python.exe'
|
||||||
with:
|
with:
|
||||||
project_id: denoland
|
project_id: denoland
|
||||||
service_account_key: '${{ secrets.GCP_SA_KEY }}'
|
|
||||||
export_default_credentials: true
|
|
||||||
- name: Configure canary build
|
- name: Configure canary build
|
||||||
if: |-
|
if: |-
|
||||||
!(github.event_name == 'pull_request' && matrix.skip_pr) && (steps.exit_early.outputs.EXIT_EARLY != 'true' && (matrix.job == 'test' &&
|
!(github.event_name == 'pull_request' && matrix.skip_pr) && (steps.exit_early.outputs.EXIT_EARLY != 'true' && (matrix.job == 'test' &&
|
||||||
|
@ -543,12 +552,23 @@ jobs:
|
||||||
- build
|
- build
|
||||||
if: github.repository == 'denoland/deno' && github.ref == 'refs/heads/main'
|
if: github.repository == 'denoland/deno' && github.ref == 'refs/heads/main'
|
||||||
steps:
|
steps:
|
||||||
- name: Setup gcloud
|
- name: Authenticate with Google Cloud
|
||||||
uses: google-github-actions/setup-gcloud@v0
|
if: |-
|
||||||
|
matrix.profile == 'release' &&
|
||||||
|
matrix.job == 'test' &&
|
||||||
|
github.repository == 'denoland/deno' &&
|
||||||
|
(github.ref == 'refs/heads/main' ||
|
||||||
|
startsWith(github.ref, 'refs/tags/'))
|
||||||
|
uses: google-github-actions/auth@v1
|
||||||
|
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@v1
|
||||||
with:
|
with:
|
||||||
project_id: denoland
|
project_id: denoland
|
||||||
service_account_key: '${{ secrets.GCP_SA_KEY }}'
|
|
||||||
export_default_credentials: true
|
|
||||||
- name: Upload canary version file to dl.deno.land
|
- name: Upload canary version file to dl.deno.land
|
||||||
run: |-
|
run: |-
|
||||||
echo ${{ github.sha }} > canary-latest.txt
|
echo ${{ github.sha }} > canary-latest.txt
|
||||||
|
|
14
.github/workflows/post_publish.yml
vendored
14
.github/workflows/post_publish.yml
vendored
|
@ -10,12 +10,18 @@ jobs:
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
if: github.repository == 'denoland/deno'
|
if: github.repository == 'denoland/deno'
|
||||||
steps:
|
steps:
|
||||||
- name: Setup gcloud
|
- name: Authenticate with Google Cloud
|
||||||
uses: google-github-actions/setup-gcloud@v0
|
uses: google-github-actions/auth@v1
|
||||||
|
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@v1
|
||||||
with:
|
with:
|
||||||
project_id: denoland
|
project_id: denoland
|
||||||
service_account_key: ${{ secrets.GCP_SA_KEY }}
|
|
||||||
export_default_credentials: true
|
|
||||||
|
|
||||||
- name: Upload version file to dl.deno.land
|
- name: Upload version file to dl.deno.land
|
||||||
run: |
|
run: |
|
||||||
|
|
Loading…
Add table
Reference in a new issue