From ea63f9c018f647b1453c22c422d76e652d77110e Mon Sep 17 00:00:00 2001 From: Kazumi Inada Date: Wed, 27 Mar 2024 00:55:53 +0900 Subject: [PATCH] feat: Test for os detection --- package-lock.json | 72 +++++++++++++++++++++++++++++++++++++++++++++++ package.json | 4 +++ src/index.ts | 10 +++++++ 3 files changed, 86 insertions(+) diff --git a/package-lock.json b/package-lock.json index ba93db1..aa6329f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,10 +8,32 @@ "name": "@nandenjin/setup-openframeworks-action", "version": "0.0.0", "license": "MIT", + "dependencies": { + "@actions/core": "^1.10.1" + }, "devDependencies": { + "@types/node": "^20.11.30", "esbuild": "^0.20.2" } }, + "node_modules/@actions/core": { + "version": "1.10.1", + "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.10.1.tgz", + "integrity": "sha512-3lBR9EDAY+iYIpTnTIXmWcNbX3T2kCkAEQGIQx4NVQ0575nk2k3GRZDTPQG+vVtS2izSLmINlxXf0uLtnrTP+g==", + "dependencies": { + "@actions/http-client": "^2.0.1", + "uuid": "^8.3.2" + } + }, + "node_modules/@actions/http-client": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.2.1.tgz", + "integrity": "sha512-KhC/cZsq7f8I4LfZSJKgCvEwfkE8o1538VoBeoGzokVLLnbFDEAdFD3UhoMklxo2un9NJVBdANOresx7vTHlHw==", + "dependencies": { + "tunnel": "^0.0.6", + "undici": "^5.25.4" + } + }, "node_modules/@esbuild/aix-ppc64": { "version": "0.20.2", "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.20.2.tgz", @@ -380,6 +402,23 @@ "node": ">=12" } }, + "node_modules/@fastify/busboy": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.1.1.tgz", + "integrity": "sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==", + "engines": { + "node": ">=14" + } + }, + "node_modules/@types/node": { + "version": "20.11.30", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.30.tgz", + "integrity": "sha512-dHM6ZxwlmuZaRmUPfv1p+KrdD1Dci04FbdEm/9wEMouFqxYoFl5aMkt0VMAUtYRQDyYvD41WJLukhq/ha3YuTw==", + "dev": true, + "dependencies": { + "undici-types": "~5.26.4" + } + }, "node_modules/esbuild": { "version": "0.20.2", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.20.2.tgz", @@ -417,6 +456,39 @@ "@esbuild/win32-ia32": "0.20.2", "@esbuild/win32-x64": "0.20.2" } + }, + "node_modules/tunnel": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", + "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==", + "engines": { + "node": ">=0.6.11 <=0.7.0 || >=0.7.3" + } + }, + "node_modules/undici": { + "version": "5.28.3", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.28.3.tgz", + "integrity": "sha512-3ItfzbrhDlINjaP0duwnNsKpDQk3acHI3gVJ1z4fmwMK31k5G9OVIAMLSIaP6w4FaGkaAkN6zaQO9LUvZ1t7VA==", + "dependencies": { + "@fastify/busboy": "^2.0.0" + }, + "engines": { + "node": ">=14.0" + } + }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + }, + "node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "bin": { + "uuid": "dist/bin/uuid" + } } } } diff --git a/package.json b/package.json index 164d0f7..2a82881 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,10 @@ "author": "Kazumi Inada ", "license": "MIT", "devDependencies": { + "@types/node": "^20.11.30", "esbuild": "^0.20.2" + }, + "dependencies": { + "@actions/core": "^1.10.1" } } diff --git a/src/index.ts b/src/index.ts index e69de29..84f4a65 100644 --- a/src/index.ts +++ b/src/index.ts @@ -0,0 +1,10 @@ +import { platform } from "os"; +import * as core from "@actions/core"; + +const isPlatformMacOS = platform() === "darwin"; +const isPlatformLinux = platform() === "linux"; +const isPlatformWindows = platform() === "win32"; + +core.info(`isPlatformMacOS: ${isPlatformMacOS}`); +core.info(`isPlatformLinux: ${isPlatformLinux}`); +core.info(`isPlatformWindows: ${isPlatformWindows}`);