Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,12 @@ jobs:
cp -R /tmp/release/cli-linux-x64/. packages/cli-linux-x64/
- name: Publish platform packages
run: |
VERSION="${{ github.ref_name }}"
VERSION="${VERSION#v}"
for pkg in cli-darwin-arm64 cli-darwin-x64 cli-linux-arm64 cli-linux-x64; do
npm publish --access public --workspace "@tpsdev-ai/$pkg" || {
if npm view "@tpsdev-ai/$pkg@${{ github.ref_name }}" version 2>/dev/null; then
echo "⏭️ @tpsdev-ai/$pkg already published, skipping"
if npm view "@tpsdev-ai/$pkg@$VERSION" version 2>/dev/null; then
echo "⏭️ @tpsdev-ai/$pkg@$VERSION already published, skipping"
else
echo "❌ Failed to publish @tpsdev-ai/$pkg" && exit 1
fi
Expand All @@ -102,9 +104,11 @@ jobs:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish meta package
run: |
VERSION="${{ github.ref_name }}"
VERSION="${VERSION#v}"
npm publish --access public --workspace @tpsdev-ai/cli || {
if npm view "@tpsdev-ai/cli@${{ github.ref_name }}" version 2>/dev/null; then
echo "⏭️ @tpsdev-ai/cli already published, skipping"
if npm view "@tpsdev-ai/cli@$VERSION" version 2>/dev/null; then
echo "⏭️ @tpsdev-ai/cli@$VERSION already published, skipping"
else
exit 1
fi
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
bun-version: latest
- run: bun install --frozen-lockfile
- name: Check for known vulnerabilities
run: bunx audit-ci --high
run: bun audit

docker:
name: Docker Integration
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
"packages/*"
],
"scripts": {
"build": "npm run build --workspaces --if-present",
"test": "npm run test --workspaces --if-present",
"lint": "npm run lint --workspaces --if-present",
"lint:ci": "npm run lint:ci --workspaces --if-present",
"build": "cd packages/agent && bun run build && cd ../cli && bun run build",
"test": "cd packages/agent && bun test && cd ../cli && bun test",
"lint": "cd packages/cli && bun run lint",
"lint:ci": "cd packages/cli && bun run lint:ci",
"tps": "node packages/cli/dist/bin/tps.js"
},
"devDependencies": {
Expand Down
5 changes: 4 additions & 1 deletion packages/cli/bin/tps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -429,4 +429,7 @@ async function main() {
}
}

main();
main().catch((err) => {
console.error(err?.message || err);
process.exit(1);
});
5 changes: 3 additions & 2 deletions packages/cli/src/commands/backup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,9 @@ function readManifestFromArchive(tmpDir: string): Manifest {
function runTarCreate(stagingDir: string, archivePath: string): void {
const cmd = ["tar", "-czf", archivePath, "-C", stagingDir, "."];
const res = spawnSync(cmd[0], cmd.slice(1), { encoding: "utf-8" });
if (res.status !== 0) {
throw new Error(`tar create failed: ${res.stderr || res.stdout}`);
// GNU tar exits 1 for "file changed as we read it" — archive is still valid
if (res.status !== 0 && res.status !== 1) {
throw new Error(`tar create failed (exit ${res.status}): ${res.stderr || res.stdout}`);
}
}

Expand Down
4 changes: 3 additions & 1 deletion packages/cli/test/backup.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,13 @@ exit 0
});

function run(args: string[]) {
return spawnSync("bun", [TPS_BIN, ...args], {
const result = spawnSync("bun", [TPS_BIN, ...args], {
cwd: tempRoot,
encoding: "utf-8",
env: process.env,
});

return result;
}

function createWorkspace(agent: string) {
Expand Down
Loading