Skip to content

Commit

Permalink
support macos arm64
Browse files Browse the repository at this point in the history
  • Loading branch information
skaji committed Mar 27, 2024
1 parent f105ad3 commit d688f28
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions __tests__/installer.test.ts
Expand Up @@ -25,9 +25,11 @@ describe("installer", () => {
jest.setTimeout(30 * 1000); // 30sec
it("gets latest", async () => {
const macos = await installer.getRelease("latest", "macos", "x86_64");
const macos2 = await installer.getRelease("latest", "macos", "arm64");
const linux = await installer.getRelease("latest", "linux", "x86_64");
const win = await installer.getRelease("latest", "win", "x86_64");
expect(macos).toBeDefined();
expect(macos2).toBeDefined();
expect(linux).toBeDefined();
expect(win).toBeDefined();
});
Expand Down
4 changes: 2 additions & 2 deletions src/installer.ts
Expand Up @@ -28,7 +28,7 @@ export async function getAllReleases(): Promise<Release[]> {
export async function getRelease(
version: string,
platform: "win" | "macos" | "linux",
arch: "x86_64"
arch: "x86_64" | "arm64"
): Promise<Release | null> {
const releases = (await getAllReleases())
.filter(
Expand Down Expand Up @@ -58,7 +58,7 @@ export async function getRelease(
export async function getRaku(
version: string,
platform: "win" | "macos" | "linux",
arch: "x86_64"
arch: "x86_64" | "arm64"
): Promise<void> {
const release = await getRelease(version, platform, arch);
if (release === null) {
Expand Down
3 changes: 2 additions & 1 deletion src/main.ts
Expand Up @@ -12,7 +12,8 @@ export async function run(): Promise<void> {
: os.platform() === "win32"
? "win"
: "linux";
await installer.getRaku(version, platform, "x86_64");
const arch = os.arch() === "arm64" ? "arm64" : "x86_64";
await installer.getRaku(version, platform, arch);

core.startGroup("raku -V");
await exec.exec("raku", ["-V"]);
Expand Down

0 comments on commit d688f28

Please sign in to comment.