Skip to content

Commit

Permalink
chore: add aarch64 builds to deno
Browse files Browse the repository at this point in the history
  • Loading branch information
mmastrac committed Nov 17, 2023
1 parent daab366 commit 4e9c82b
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 10 deletions.
38 changes: 30 additions & 8 deletions .github/workflows/ci.generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,23 @@ import * as yaml from "https://deno.land/[email protected]/encoding/yaml.ts";
// automatically via regex, so ensure that this line maintains this format.
const cacheVersion = 59;

const ubuntuRunner = "ubuntu-22.04";
const ubuntuXlRunner = "ubuntu-22.04-xl";
const windowsRunner = "windows-2022";
const windowsXlRunner = "windows-2022-xl";
const macosX86Runner = "macos-12";
// https://github.blog/2023-10-02-introducing-the-new-apple-silicon-powered-m1-macos-larger-runner-for-github-actions/
const macosArmRunner = "macos-13-xlarge";

const Runners = (() => {
const ubuntuRunner = "ubuntu-22.04";
const ubuntuXlRunner = "ubuntu-22.04-xl";
const windowsRunner = "windows-2022";
const windowsXlRunner = "windows-2022-xl";

return {
ubuntuXl:
`\${{ github.repository == 'denoland/deno' && '${ubuntuXlRunner}' || '${ubuntuRunner}' }}`,
ubuntu: ubuntuRunner,
linux: ubuntuRunner,
macos: "macos-12",
macos: macosX86Runner,
macosArm: macosArmRunner,
windows: windowsRunner,
windowsXl:
`\${{ github.repository == 'denoland/deno' && '${windowsXlRunner}' || '${windowsRunner}' }}`,
Expand Down Expand Up @@ -246,8 +251,10 @@ function handleMatrixItems(items: {
return "ubuntu-x86_64";
} else if (os.includes("windows")) {
return "windows-x86_64";
} else if (os.includes("macos")) {
} else if (os == macosX86Runner) {
return "macos-x86_64";
} else if (os == macosArmRunner) {
return "macos-aarch64";
} else {
throw new Error(`Display name not found: ${os}`);
}
Expand Down Expand Up @@ -642,9 +649,9 @@ const ci = {
].join("\n"),
},
{
name: "Pre-release (mac)",
name: "Pre-release (mac intel)",
if: [
"startsWith(matrix.os, 'macOS') &&",
`matrix.os == '${macosX86Runner}' &&`,
"matrix.job == 'test' &&",
"matrix.profile == 'release' &&",
"github.repository == 'denoland/deno' &&",
Expand All @@ -656,6 +663,21 @@ const ci = {
]
.join("\n"),
},
{
name: "Pre-release (mac aarch64)",
if: [
`matrix.os == '${macosArmRunner}' &&`,
"matrix.job == 'test' &&",
"matrix.profile == 'release' &&",
"github.repository == 'denoland/deno' &&",
"(github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/'))",
].join("\n"),
run: [
"cd target/release",
"zip -r deno-aarch64-apple-darwin.zip deno",
]
.join("\n"),
},
{
name: "Pre-release (windows)",
if: [
Expand Down
14 changes: 12 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -388,16 +388,26 @@ jobs:
cd target/release
zip -r deno-x86_64-unknown-linux-gnu.zip deno
./deno types > lib.deno.d.ts
- name: Pre-release (mac)
- name: Pre-release (mac intel)
if: |-
!(github.event_name == 'pull_request' && matrix.skip_pr) && (startsWith(matrix.os, 'macOS') &&
!(github.event_name == 'pull_request' && matrix.skip_pr) && (matrix.os == 'macos-12' &&
matrix.job == 'test' &&
matrix.profile == 'release' &&
github.repository == 'denoland/deno' &&
(github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')))
run: |-
cd target/release
zip -r deno-x86_64-apple-darwin.zip deno
- name: Pre-release (mac aarch64)
if: |-
!(github.event_name == 'pull_request' && matrix.skip_pr) && (matrix.os == 'macos-13-xlarge' &&
matrix.job == 'test' &&
matrix.profile == 'release' &&
github.repository == 'denoland/deno' &&
(github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')))
run: |-
cd target/release
zip -r deno-aarch64-apple-darwin.zip deno
- name: Pre-release (windows)
if: |-
!(github.event_name == 'pull_request' && matrix.skip_pr) && (startsWith(matrix.os, 'windows') &&
Expand Down

0 comments on commit 4e9c82b

Please sign in to comment.