Skip to content

Commit b897d92

Browse files
committed
💚 ci: Fix continuous integration pipeline
1 parent 6cd8d74 commit b897d92

File tree

4 files changed

+33
-3
lines changed

4 files changed

+33
-3
lines changed

.github/workflows/update_views.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@ on:
99
- "src/**/*.ts"
1010
- "src/system_prompts/**/*.md"
1111
- "src/application/templates/*.md.njk"
12-
12+
workflow_dispatch:
13+
inputs:
14+
reason:
15+
description: 'Reason for manual run'
16+
required: false
17+
1318
jobs:
1419
update_views:
1520
runs-on: ubuntu-latest
@@ -74,6 +79,8 @@ jobs:
7479
env:
7580
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
7681
FORCE_REGENERATE: ${{ env.FORCE_REGENERATE }}
82+
MODEL_PROVIDER: 'anthropic'
83+
OPENAI_API_KEY: ''
7784
run: prompt-library-cli prompt refresh-metadata --all --nonInteractive
7885

7986
- name: Update views via CLI

build.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/bin/env node
2+
const fs = require('fs');
3+
const path = require('path');
4+
const { execSync } = require('child_process');
5+
6+
// Run TypeScript compiler
7+
console.log('Running TypeScript compiler...');
8+
execSync('tsc', { stdio: 'inherit' });
9+
10+
// Add shebang to main.js
11+
console.log('Adding shebang to main.js...');
12+
const mainJsPath = path.join(__dirname, 'dist', 'main.js');
13+
const content = fs.readFileSync(mainJsPath, 'utf8');
14+
const shebang = '#!/usr/bin/env node\n';
15+
fs.writeFileSync(mainJsPath, shebang + content);
16+
17+
// Make executable
18+
console.log('Making main.js executable...');
19+
execSync(`chmod +x ${mainJsPath}`, { stdio: 'inherit' });
20+
21+
console.log('Build complete!');

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"prompt-library-cli": "./dist/main.js"
1010
},
1111
"scripts": {
12-
"build": "tsc && chmod +x dist/main.js",
12+
"build": "node build.js",
1313
"dev": "ts-node src/main.ts",
1414
"format": "npm run lint:fix && npm run prettify",
1515
"lint": "eslint '**/*.ts'",

tsconfig.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
"forceConsistentCasingInFileNames": true,
1515
"resolveJsonModule": true,
1616
"baseUrl": ".",
17-
"typeRoots": ["./node_modules/@types"]
17+
"typeRoots": ["./node_modules/@types"],
18+
"preserveSymlinks": true,
19+
"preserveConstEnums": true
1820
},
1921
"include": ["src/**/*"],
2022
"exclude": ["node_modules", "dist", "**/__tests__/**"]

0 commit comments

Comments
 (0)