orchstep 0.1.0
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.
- package/README.md +24 -0
- package/bin/orchstep +6 -0
- package/install.js +99 -0
- package/package.json +26 -0
- package/publish.sh +12 -0
package/README.md
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# orchstep
|
|
2
|
+
|
|
3
|
+
**YAML-first workflow orchestration engine.**
|
|
4
|
+
|
|
5
|
+
This package installs the OrchStep binary for your platform.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install -g orchstep
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
orchstep run deploy --var env=staging
|
|
17
|
+
orchstep lint my-workflow.yml
|
|
18
|
+
orchstep list-tasks
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Documentation
|
|
22
|
+
|
|
23
|
+
- [GitHub](https://github.com/orchstep/orchstep)
|
|
24
|
+
- [Docs](https://orchstep.dev)
|
package/bin/orchstep
ADDED
package/install.js
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { execSync } = require("child_process");
|
|
4
|
+
const fs = require("fs");
|
|
5
|
+
const path = require("path");
|
|
6
|
+
const https = require("https");
|
|
7
|
+
|
|
8
|
+
const REPO = "orchstep/orchstep";
|
|
9
|
+
const BIN_DIR = path.join(__dirname, "bin");
|
|
10
|
+
|
|
11
|
+
function getPlatform() {
|
|
12
|
+
const platform = process.platform;
|
|
13
|
+
const arch = process.arch;
|
|
14
|
+
|
|
15
|
+
const osMap = { darwin: "darwin", linux: "linux", win32: "windows" };
|
|
16
|
+
const archMap = { x64: "amd64", arm64: "arm64" };
|
|
17
|
+
|
|
18
|
+
const os = osMap[platform];
|
|
19
|
+
const cpu = archMap[arch];
|
|
20
|
+
|
|
21
|
+
if (!os || !cpu) {
|
|
22
|
+
console.error(`Unsupported platform: ${platform}/${arch}`);
|
|
23
|
+
process.exit(1);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return { os, arch: cpu };
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function getLatestVersion() {
|
|
30
|
+
return new Promise((resolve, reject) => {
|
|
31
|
+
https.get(
|
|
32
|
+
`https://api.github.com/repos/${REPO}/releases/latest`,
|
|
33
|
+
{ headers: { "User-Agent": "orchstep-npm" } },
|
|
34
|
+
(res) => {
|
|
35
|
+
let data = "";
|
|
36
|
+
res.on("data", (chunk) => (data += chunk));
|
|
37
|
+
res.on("end", () => {
|
|
38
|
+
try {
|
|
39
|
+
const json = JSON.parse(data);
|
|
40
|
+
resolve(json.tag_name.replace(/^v/, ""));
|
|
41
|
+
} catch (e) {
|
|
42
|
+
reject(new Error("Failed to parse version"));
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
).on("error", reject);
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
async function install() {
|
|
51
|
+
const { os, arch } = getPlatform();
|
|
52
|
+
|
|
53
|
+
let version;
|
|
54
|
+
try {
|
|
55
|
+
version = await getLatestVersion();
|
|
56
|
+
} catch (e) {
|
|
57
|
+
console.error("Failed to fetch latest version:", e.message);
|
|
58
|
+
process.exit(1);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const ext = os === "windows" ? "zip" : "tar.gz";
|
|
62
|
+
const filename = `orchstep_${version}_${os}_${arch}.${ext}`;
|
|
63
|
+
const url = `https://github.com/${REPO}/releases/download/v${version}/${filename}`;
|
|
64
|
+
|
|
65
|
+
console.log(`Installing OrchStep v${version} (${os}/${arch})...`);
|
|
66
|
+
|
|
67
|
+
// Create bin directory
|
|
68
|
+
fs.mkdirSync(BIN_DIR, { recursive: true });
|
|
69
|
+
|
|
70
|
+
// Download and extract
|
|
71
|
+
const tmpFile = path.join(BIN_DIR, filename);
|
|
72
|
+
|
|
73
|
+
try {
|
|
74
|
+
execSync(`curl -fsSL "${url}" -o "${tmpFile}"`, { stdio: "inherit" });
|
|
75
|
+
|
|
76
|
+
if (ext === "tar.gz") {
|
|
77
|
+
execSync(`tar -xzf "${tmpFile}" -C "${BIN_DIR}"`, { stdio: "inherit" });
|
|
78
|
+
} else {
|
|
79
|
+
execSync(`unzip -o "${tmpFile}" -d "${BIN_DIR}"`, { stdio: "inherit" });
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// Cleanup archive
|
|
83
|
+
fs.unlinkSync(tmpFile);
|
|
84
|
+
|
|
85
|
+
// Make executable
|
|
86
|
+
const binPath = path.join(BIN_DIR, os === "windows" ? "orchstep.exe" : "orchstep");
|
|
87
|
+
if (os !== "windows") {
|
|
88
|
+
fs.chmodSync(binPath, 0o755);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
console.log(`OrchStep v${version} installed successfully.`);
|
|
92
|
+
} catch (e) {
|
|
93
|
+
console.error("Installation failed:", e.message);
|
|
94
|
+
console.error(`Download manually from: https://github.com/${REPO}/releases`);
|
|
95
|
+
process.exit(1);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
install();
|
package/package.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "orchstep",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "OrchStep — YAML-first workflow orchestration engine",
|
|
5
|
+
"homepage": "https://orchstep.dev",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/orchstep/orchstep.git"
|
|
9
|
+
},
|
|
10
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
11
|
+
"bin": {
|
|
12
|
+
"orchstep": "bin/orchstep"
|
|
13
|
+
},
|
|
14
|
+
"scripts": {
|
|
15
|
+
"postinstall": "node install.js"
|
|
16
|
+
},
|
|
17
|
+
"keywords": [
|
|
18
|
+
"orchstep",
|
|
19
|
+
"workflow",
|
|
20
|
+
"orchestration",
|
|
21
|
+
"yaml",
|
|
22
|
+
"automation",
|
|
23
|
+
"devops",
|
|
24
|
+
"ci-cd"
|
|
25
|
+
]
|
|
26
|
+
}
|
package/publish.sh
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
set -e
|
|
3
|
+
# Publish orchstep npm package
|
|
4
|
+
# Requires: npm login (one-time)
|
|
5
|
+
# Usage: ./publish.sh
|
|
6
|
+
|
|
7
|
+
VERSION=$(node -e "console.log(require('./package.json').version)")
|
|
8
|
+
echo "Publishing orchstep@$VERSION to npm..."
|
|
9
|
+
|
|
10
|
+
npm publish --access public
|
|
11
|
+
|
|
12
|
+
echo "Published! Verify: npm info orchstep"
|