From 57b9383e90926dba03380d2bd0c8807c841b05ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20GARCIA?= Date: Tue, 25 Feb 2025 09:48:22 +0100 Subject: [PATCH 1/4] feat: add plugin for cocogitto --- cog/README.md | 21 +++++++++++++++++++++ cog/plugin.test.ts | 8 ++++++++ cog/plugin.toml | 28 ++++++++++++++++++++++++++++ 3 files changed, 57 insertions(+) create mode 100644 cog/README.md create mode 100644 cog/plugin.test.ts create mode 100644 cog/plugin.toml diff --git a/cog/README.md b/cog/README.md new file mode 100644 index 0000000..222b990 --- /dev/null +++ b/cog/README.md @@ -0,0 +1,21 @@ +# cocogitto plugin + +[cocogitto](https://docs.cocogitto.io/) plugin for [proto](https://github.com/moonrepo/proto). + +## Installation + +This is a community plugin and is thus not built-in to proto. In order to use it, first either add it to your global or project-based `.prototools` by running: + +### Global install + +```shell +proto plugin add cog "source:https://raw.githubusercontent.com/appthrust/proto-toml-plugins/main/cog/plugin.toml" --global +proto install cog +``` + +### Per-project install + +```shell +proto plugin add cog "source:https://raw.githubusercontent.com/appthrust/proto-toml-plugins/main/cog/plugin.toml" +proto pin cog latest --resolve +``` diff --git a/cog/plugin.test.ts b/cog/plugin.test.ts new file mode 100644 index 0000000..50ca466 --- /dev/null +++ b/cog/plugin.test.ts @@ -0,0 +1,8 @@ +import { run } from "../testkit.js"; + +run({ + name: "cog", + afterInstall: async ($) => { + await $`cog --version`; + }, +}); diff --git a/cog/plugin.toml b/cog/plugin.toml new file mode 100644 index 0000000..f0baaf1 --- /dev/null +++ b/cog/plugin.toml @@ -0,0 +1,28 @@ +# A TOML plugin for cocogitto: +# https://moonrepo.dev/docs/proto/plugins#toml-plugin + +name = "cog" +type = "cli" + +[platform.linux] +archive-prefix = "cocogitto-{version}-{arch}-unknown-linux-{libc}" +exe-path = "{arch}-unknown-linux-{libc}/cog" +download-file = "cocogitto-{version}-{arch}-unknown-linux-{libc}.tar.gz" + +[platform.macos] +archive-prefix = "cocogitto-{version}-{arch}-apple-darwin" +exe-path = "{arch}-apple-darwin/cog" +download-file = "cocogitto-{version}-{arch}-apple-darwin.tar.gz" + +[platform.windows] +archive-prefix = "cocogitto-{version}-{arch}-pc-windows-msvc" +exe-path = "{arch}-pc-windows-msvc/cog.exe" +download-file = "cocogitto-{version}-{arch}-pc-windows-msvc.tar.gz" + + +[install] +download-url = "https://github.com/cocogitto/cocogitto/releases/download/{version}/{download_file}" + +[resolve] +git-url = "https://github.com/cocogitto/cocogitto" + From d10bdf56b7be65d9f5550f1897e10afcd60deef3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20GARCIA?= Date: Fri, 28 Feb 2025 14:42:17 +0100 Subject: [PATCH 2/4] fix: add supported archs --- cog/plugin.toml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cog/plugin.toml b/cog/plugin.toml index f0baaf1..2b46594 100644 --- a/cog/plugin.toml +++ b/cog/plugin.toml @@ -8,17 +8,19 @@ type = "cli" archive-prefix = "cocogitto-{version}-{arch}-unknown-linux-{libc}" exe-path = "{arch}-unknown-linux-{libc}/cog" download-file = "cocogitto-{version}-{arch}-unknown-linux-{libc}.tar.gz" +archs = ["aarch64", "x86_64", "armv7"] [platform.macos] archive-prefix = "cocogitto-{version}-{arch}-apple-darwin" exe-path = "{arch}-apple-darwin/cog" download-file = "cocogitto-{version}-{arch}-apple-darwin.tar.gz" +archs = ["aarch64"] [platform.windows] archive-prefix = "cocogitto-{version}-{arch}-pc-windows-msvc" exe-path = "{arch}-pc-windows-msvc/cog.exe" download-file = "cocogitto-{version}-{arch}-pc-windows-msvc.tar.gz" - +archs = ["aarch64"] [install] download-url = "https://github.com/cocogitto/cocogitto/releases/download/{version}/{download_file}" From 3b370ed2f75e606517d65efbed500a67ed74871e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20GARCIA?= Date: Fri, 28 Feb 2025 14:47:39 +0100 Subject: [PATCH 3/4] fix: arm architecture --- cog/plugin.toml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cog/plugin.toml b/cog/plugin.toml index 2b46594..3f27801 100644 --- a/cog/plugin.toml +++ b/cog/plugin.toml @@ -8,7 +8,7 @@ type = "cli" archive-prefix = "cocogitto-{version}-{arch}-unknown-linux-{libc}" exe-path = "{arch}-unknown-linux-{libc}/cog" download-file = "cocogitto-{version}-{arch}-unknown-linux-{libc}.tar.gz" -archs = ["aarch64", "x86_64", "armv7"] +archs = ["aarch64", "x86_64", "arm"] [platform.macos] archive-prefix = "cocogitto-{version}-{arch}-apple-darwin" @@ -25,6 +25,9 @@ archs = ["aarch64"] [install] download-url = "https://github.com/cocogitto/cocogitto/releases/download/{version}/{download_file}" +[install.arch] +arm = "armv7" + [resolve] git-url = "https://github.com/cocogitto/cocogitto" From 3ef27a115085271a881cb9e8b7f855b386ee4b6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20GARCIA?= Date: Fri, 28 Feb 2025 15:08:32 +0100 Subject: [PATCH 4/4] fix: only set x86_64 arch --- cog/plugin.toml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cog/plugin.toml b/cog/plugin.toml index 3f27801..1920cfc 100644 --- a/cog/plugin.toml +++ b/cog/plugin.toml @@ -5,22 +5,22 @@ name = "cog" type = "cli" [platform.linux] -archive-prefix = "cocogitto-{version}-{arch}-unknown-linux-{libc}" -exe-path = "{arch}-unknown-linux-{libc}/cog" -download-file = "cocogitto-{version}-{arch}-unknown-linux-{libc}.tar.gz" -archs = ["aarch64", "x86_64", "arm"] +archive-prefix = "cocogitto-{version}-{arch}-unknown-linux-musl" +exe-path = "{arch}-unknown-linux-musl/cog" +download-file = "cocogitto-{version}-{arch}-unknown-linux-musl.tar.gz" +archs = ["x86_64"] [platform.macos] archive-prefix = "cocogitto-{version}-{arch}-apple-darwin" exe-path = "{arch}-apple-darwin/cog" download-file = "cocogitto-{version}-{arch}-apple-darwin.tar.gz" -archs = ["aarch64"] +archs = ["x86_64"] [platform.windows] archive-prefix = "cocogitto-{version}-{arch}-pc-windows-msvc" exe-path = "{arch}-pc-windows-msvc/cog.exe" download-file = "cocogitto-{version}-{arch}-pc-windows-msvc.tar.gz" -archs = ["aarch64"] +archs = ["x86_64"] [install] download-url = "https://github.com/cocogitto/cocogitto/releases/download/{version}/{download_file}"