Skip to content

Commit 83d061c

Browse files
jason-rlclaude
andcommitted
feat: add architecture input to deploy-agent action
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent b8c9e3a commit 83d061c

6 files changed

Lines changed: 44 additions & 1 deletion

File tree

action.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@ inputs:
7676
required: false
7777
# default is 'undefined' => don't auto-delete
7878

79+
architecture:
80+
description: 'Target architecture for the agent (x86_64 or arm64). If unset, agent is universal.'
81+
required: false
82+
7983
outputs:
8084
agent-id:
8185
description: 'The ID of the created agent (e.g., agt_xxxx)'
@@ -86,6 +90,9 @@ outputs:
8690
agent-name:
8791
description: 'The final name of the created agent'
8892

93+
architecture:
94+
description: 'The architecture of the created agent (if specified)'
95+
8996
runs:
9097
using: 'node20'
9198
main: 'dist/index.js'

dist/index.js

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/agent-deployer.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ async function deployGitAgent(
9292
name: agentName,
9393
version: inputs.agentVersion,
9494
is_public: inputs.isPublic,
95+
...(inputs.architecture && { architecture: inputs.architecture }),
9596
source: {
9697
type: 'git',
9798
git: {
@@ -135,6 +136,7 @@ async function deployTarAgent(
135136
name: agentName,
136137
version: inputs.agentVersion,
137138
is_public: inputs.isPublic,
139+
...(inputs.architecture && { architecture: inputs.architecture }),
138140
source: {
139141
type: 'object',
140142
object: {
@@ -178,6 +180,7 @@ async function deployFileAgent(
178180
name: agentName,
179181
version: inputs.agentVersion,
180182
is_public: inputs.isPublic,
183+
...(inputs.architecture && { architecture: inputs.architecture }),
181184
source: {
182185
type: 'object',
183186
object: {
@@ -224,6 +227,7 @@ async function deployNpmAgent(
224227
name: agentName,
225228
version: inputs.agentVersion,
226229
is_public: inputs.isPublic,
230+
...(inputs.architecture && { architecture: inputs.architecture }),
227231
source: {
228232
type: 'npm',
229233
npm: npmSource,
@@ -266,6 +270,7 @@ async function deployPipAgent(
266270
name: agentName,
267271
version: inputs.agentVersion,
268272
is_public: inputs.isPublic,
273+
...(inputs.architecture && { architecture: inputs.architecture }),
269274
source: {
270275
type: 'pip',
271276
pip: pipSource,

src/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ async function run(): Promise<void> {
4141
if (result.objectId) {
4242
core.setOutput('object-id', result.objectId);
4343
}
44+
if (inputs.architecture) {
45+
core.setOutput('architecture', inputs.architecture);
46+
}
4447

4548
core.info('');
4649
core.info('✅ Deployment completed successfully!');

src/validators.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export interface ActionInputs {
1818
isPublic: boolean;
1919
apiUrl: string;
2020
objectTtlDays?: number;
21+
architecture?: string;
2122
}
2223

2324
export type SourceType = 'git' | 'tar' | 'file' | 'npm' | 'pip';
@@ -50,6 +51,7 @@ export function getInputs(): ActionInputs {
5051
isPublic: isPublicRaw === 'true',
5152
apiUrl: core.getInput('api-url') || 'https://api.runloop.ai',
5253
objectTtlDays: objectTtlDaysRaw ? parseInt(objectTtlDaysRaw, 10) : undefined,
54+
architecture: core.getInput('architecture') || undefined,
5355
};
5456

5557
return inputs;
@@ -106,6 +108,16 @@ export function validateInputs(inputs: ActionInputs): void {
106108
// Validate agentVersion format (semver or SHA)
107109
validateAgentVersion(inputs.agentVersion);
108110

111+
// Validate architecture if provided
112+
if (inputs.architecture) {
113+
const validArchitectures = ['x86_64', 'arm64'];
114+
if (!validArchitectures.includes(inputs.architecture)) {
115+
throw new Error(
116+
`Invalid architecture: ${inputs.architecture}. Must be one of: ${validArchitectures.join(', ')}`
117+
);
118+
}
119+
}
120+
109121
// Validate objectTtlDays if provided
110122
if (inputs.objectTtlDays !== undefined) {
111123
if (isNaN(inputs.objectTtlDays) || inputs.objectTtlDays <= 0) {

0 commit comments

Comments
 (0)