ci: switch npm publish to OIDC trusted publishing (#8454)

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Jack Amadeo
2026-04-10 16:30:45 -04:00
committed by GitHub
parent b1eff5f7f9
commit 9cf178265b
17 changed files with 237 additions and 374 deletions
-11
View File
@@ -1,11 +0,0 @@
---
"@aaif/goose-acp": minor
"@aaif/goose": minor
"@aaif/goose-binary-darwin-arm64": minor
"@aaif/goose-binary-darwin-x64": minor
"@aaif/goose-binary-linux-arm64": minor
"@aaif/goose-binary-linux-x64": minor
"@aaif/goose-binary-win32-x64": minor
---
Initial release of Goose npm packages
+3 -4
View File
@@ -1,6 +1,6 @@
{
"name": "@aaif/goose-acp",
"version": "0.2.0",
"version": "0.16.0",
"description": "Agent Client Protocol (ACP) SDK for Goose AI agent",
"license": "Apache-2.0",
"repository": {
@@ -21,12 +21,11 @@
"dist"
],
"scripts": {
"build": "npm run build:schema && npm run build:ts",
"build:schema": "tsx scripts/build-schema.ts",
"build": "npm run generate && npm run build:ts",
"build:ts": "tsc",
"build:native": "tsx scripts/build-native.ts",
"build:native:all": "tsx scripts/build-native.ts --all",
"generate": "npm run build:schema && npm run build:ts",
"generate": "tsx generate-schema.ts",
"lint": "tsc --noEmit",
"format": "prettier --write src/"
},
-73
View File
@@ -1,73 +0,0 @@
#!/usr/bin/env node
/**
* Builds the generate-acp-schema Rust binary and runs it to generate
* acp-schema.json and acp-meta.json, then generates TypeScript types.
*
* Usage:
* npm run build:schema
*/
import { execSync } from "child_process";
import { dirname, resolve } from "path";
import { fileURLToPath } from "url";
import { existsSync, copyFileSync, mkdirSync } from "fs";
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
const ROOT = resolve(__dirname, "../../..");
const ACP_CRATE = resolve(ROOT, "crates/goose-acp");
const SCHEMA_PATH = resolve(ACP_CRATE, "acp-schema.json");
const META_PATH = resolve(ACP_CRATE, "acp-meta.json");
const LOCAL_SCHEMA_PATH = resolve(__dirname, "..", "acp-schema.json");
const LOCAL_META_PATH = resolve(__dirname, "..", "acp-meta.json");
main().catch((err) => {
console.error(err);
process.exit(1);
});
async function main() {
console.log("==> Building generate-acp-schema binary...");
try {
execSync(
"cargo build --release --bin generate-acp-schema",
{
cwd: ROOT,
stdio: "inherit",
}
);
} catch (err) {
console.error("Failed to build generate-acp-schema binary");
throw err;
}
console.log("==> Running generate-acp-schema...");
try {
execSync(
"cargo run --release --bin generate-acp-schema",
{
cwd: ACP_CRATE,
stdio: "inherit",
}
);
} catch (err) {
console.error("Failed to generate schema");
throw err;
}
// Copy schema files to ui/acp for reference
console.log("==> Copying schema files to ui/acp...");
mkdirSync(dirname(LOCAL_SCHEMA_PATH), { recursive: true });
copyFileSync(SCHEMA_PATH, LOCAL_SCHEMA_PATH);
copyFileSync(META_PATH, LOCAL_META_PATH);
console.log("==> Generating TypeScript types...");
// Import and run the generate-schema logic
const { default: generateSchema } = await import("../generate-schema.js");
await generateSchema();
console.log("✅ Schema generation complete");
}
+1 -1
View File
@@ -217,7 +217,7 @@ export const zImportSessionResponse = z.object({
z.string(),
z.null()
]).optional(),
messageCount: z.coerce.bigint().gte(BigInt(0)).max(BigInt('18446744073709551615'), { message: 'Invalid value: Expected uint64 to be <= 18446744073709551615' })
messageCount: z.number().int().gte(0)
});
/**
@@ -1,6 +1,6 @@
{
"name": "@aaif/goose-binary-darwin-arm64",
"version": "0.2.0",
"version": "0.16.0",
"description": "Goose binary for macOS ARM64",
"license": "Apache-2.0",
"repository": {
@@ -1,6 +1,6 @@
{
"name": "@aaif/goose-binary-darwin-x64",
"version": "0.2.0",
"version": "0.16.0",
"description": "Goose binary for macOS x64",
"license": "Apache-2.0",
"repository": {
@@ -1,6 +1,6 @@
{
"name": "@aaif/goose-binary-linux-arm64",
"version": "0.2.0",
"version": "0.16.0",
"description": "Goose binary for Linux ARM64",
"license": "Apache-2.0",
"repository": {
@@ -1,6 +1,6 @@
{
"name": "@aaif/goose-binary-linux-x64",
"version": "0.2.0",
"version": "0.16.0",
"description": "Goose binary for Linux x64",
"license": "Apache-2.0",
"repository": {
@@ -1,6 +1,6 @@
{
"name": "@aaif/goose-binary-win32-x64",
"version": "0.2.0",
"version": "0.16.0",
"description": "Goose binary for Windows x64",
"license": "Apache-2.0",
"repository": {
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@aaif/goose",
"version": "0.2.0",
"version": "0.16.0",
"description": "Goose - an open-source AI agent",
"license": "Apache-2.0",
"repository": {
+8 -1
View File
@@ -4,7 +4,7 @@
// optional dependency. Writes the result to a JSON file that the CLI reads at
// startup so it can spawn the server automatically.
import { writeFileSync, mkdirSync } from "node:fs";
import { writeFileSync, mkdirSync, chmodSync } from "node:fs";
import { createRequire } from "node:module";
import { dirname, join } from "node:path";
import { fileURLToPath } from "node:url";
@@ -46,6 +46,13 @@ try {
process.exit(0);
}
// Ensure the binary is executable (npm may strip permissions during packaging)
if (process.platform !== "win32") {
try {
chmodSync(binaryPath, 0o755);
} catch {}
}
const outDir = join(__dirname, "..");
mkdirSync(outDir, { recursive: true });
writeFileSync(