a
Push to main / Reset-Version-Tag (push) Successful in 6s

This commit is contained in:
2026-05-18 15:14:35 -06:00
parent 771561bb7d
commit 3a79dadc03
+9 -17
View File
@@ -7,43 +7,35 @@ const tarName = `${libName}-${version}.tar`;
const repoBaseUrl = `${process.env.INPUT_REPO_URL}/${libName}/${version}`; const repoBaseUrl = `${process.env.INPUT_REPO_URL}/${libName}/${version}`;
const packageJsonUrls = []; const packageJsonUrls = [];
// Get system utils
execSync("apt update", { encoding: "utf8" });
execSync("apt install -y pipx", { encoding: "utf8" });
execSync("pipx install mpy-cross-v6.3", { encoding: "utf8" });
// create base lib dir // create base lib dir
mkdirSync(libName); mkdirSync(libName);
// Add base lib file to repo // Add base lib file to repo
writeFileSync(`${libName}/__init__.mpy`, ""); writeFileSync(`${libName}/__init__.py`, "");
// Update urls // Update urls
packageJsonUrls.push([`${libName}/__init__.mpy`, `__init__.mpy`]); packageJsonUrls.push([`${libName}/__init__.py`, `__init__.py`]);
// Generate module folders/files // Generate module folders/files
for (let modPy of readdirSync(".").filter((f) => f.slice(-3) == ".py")) { for (let modPy of readdirSync(".").filter((f) => f.slice(-3) == ".py")) {
const modName = modPy.slice(0, -3); const modName = modPy.slice(0, -3);
const modInitPath = `${modName}/__init__.mpy`; const modInitPath = `${modName}/__init__.py`;
const modMpyPath = `${modName}/${modName}.mpy`; const modPyPath = `${modName}/${modName}.py`;
// create mod dir // create mod dir
mkdirSync(`${libName}/${modName}`); mkdirSync(`${libName}/${modName}`);
// compile mpy file // move py file
execSync( copyFileSync(modPy, `${libName}/${modPyPath}`, {
`pipx run mpy-cross -march=armv6m ${modPy} -o ${libName}/${modMpyPath}`, encoding: "utf8",
{ });
encoding: "utf8",
},
);
// Add module files to repo // Add module files to repo
writeFileSync(`${libName}/${modInitPath}`, ""); writeFileSync(`${libName}/${modInitPath}`, "");
// Update urls // Update urls
packageJsonUrls.push([`${libName}/${modInitPath}`, `${modInitPath}`]); packageJsonUrls.push([`${libName}/${modInitPath}`, `${modInitPath}`]);
packageJsonUrls.push([`${libName}/${modMpyPath}`, `${modMpyPath}`]); packageJsonUrls.push([`${libName}/${modPyPath}`, `${modPyPath}`]);
} }
// Add package.json to repo // Add package.json to repo