@mandors/cli 0.0.21 → 0.0.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Binary file
Binary file
Binary file
Binary file
package/npm/bin/mandor CHANGED
File without changes
@@ -11,8 +11,6 @@ const os = require('os');
11
11
 
12
12
  const ROOT_DIR = path.join(__dirname, '..', '..');
13
13
  const BINARIES_DIR = path.join(ROOT_DIR, 'binaries');
14
- const NPM_DIR = path.join(ROOT_DIR, 'npm');
15
- const NPM_BINARIES_DIR = path.join(NPM_DIR, 'binaries');
16
14
 
17
15
  const PLATFORMS = [
18
16
  { os: 'darwin', arch: 'x64' },
@@ -73,17 +71,37 @@ function createArchive(platform) {
73
71
  }
74
72
  }
75
73
 
76
- function copyToNpm() {
77
- fs.mkdirSync(NPM_BINARIES_DIR, { recursive: true });
74
+ function uploadToGithubReleases(results) {
75
+ let version;
76
+ try {
77
+ version = execSync('git describe --tags --abbrev=0', { encoding: 'utf8' }).trim();
78
+ } catch {
79
+ const pkg = require(path.join(ROOT_DIR, 'package.json'));
80
+ version = pkg.version;
81
+ }
78
82
 
79
- for (const platform of PLATFORMS) {
80
- const { os, arch } = platform;
81
- const archivePath = path.join(BINARIES_DIR, `${os}-${arch}.tar.gz`);
82
- const destPath = path.join(NPM_BINARIES_DIR, `${os}-${arch}.tar.gz`);
83
+ const archives = results.filter(r => r.archivePath && fs.existsSync(r.archivePath));
83
84
 
84
- if (fs.existsSync(archivePath)) {
85
- fs.cpSync(archivePath, destPath);
86
- console.log(`Copied ${os}-${arch}.tar.gz to npm/`);
85
+ if (archives.length === 0) {
86
+ console.log('No archives to upload');
87
+ return;
88
+ }
89
+
90
+ console.log(`\nUploading ${archives.length} binaries to GitHub release ${version}...`);
91
+
92
+ for (const archive of archives) {
93
+ const assetPath = archive.archivePath;
94
+ const assetName = `${path.basename(path.dirname(assetPath))}.tar.gz`;
95
+
96
+ try {
97
+ console.log(` Uploading ${assetName}...`);
98
+ execSync(`gh release upload "${version}" "${assetPath}" --repo "${process.env.GITHUB_REPOSITORY || 'sanxzy/mandor'}"`, {
99
+ stdio: 'pipe',
100
+ shell: true
101
+ });
102
+ console.log(` Uploaded ${assetName}`);
103
+ } catch (error) {
104
+ console.error(` Failed to upload ${assetName}:`, error.message);
87
105
  }
88
106
  }
89
107
  }
@@ -103,7 +121,6 @@ function mainBuild() {
103
121
  console.log('Building cross-platform binaries...\n');
104
122
 
105
123
  cleanBuildDirs();
106
- fs.mkdirSync(NPM_BINARIES_DIR, { recursive: true });
107
124
 
108
125
  const results = [];
109
126
  const unsupported = [];
@@ -130,9 +147,6 @@ function mainBuild() {
130
147
  }
131
148
  }
132
149
 
133
- console.log('Copying archives to npm/binaries/ for npm package...');
134
- copyToNpm();
135
-
136
150
  console.log('─'.repeat(50));
137
151
  console.log(`Build complete!`);
138
152
  console.log(` Built: ${results.length} platforms`);
@@ -146,7 +160,8 @@ function mainBuild() {
146
160
  }
147
161
 
148
162
  console.log(`\nArchives location: ${BINARIES_DIR}/`);
149
- console.log(`NPM package binaries: ${NPM_BINARIES_DIR}/`);
163
+
164
+ uploadToGithubReleases(results);
150
165
 
151
166
  return results;
152
167
  }
@@ -162,4 +177,4 @@ if (require.main === module) {
162
177
  }
163
178
  }
164
179
 
165
- module.exports = { PLATFORMS, buildForPlatform, createArchive, mainBuild, copyToNpm };
180
+ module.exports = { PLATFORMS, buildForPlatform, createArchive, mainBuild };
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@mandors/cli",
3
- "version": "0.0.21",
3
+ "version": "0.0.22",
4
4
  "description": "Event-based task manager CLI for AI agent workflows",
5
- "main": "npm/lib/index.js",
5
+ "main": "lib/index.js",
6
6
  "bin": {
7
- "mandor": "./npm/bin/mandor"
7
+ "mandor": "./bin/mandor"
8
8
  },
9
9
  "os": [
10
10
  "darwin",