Skip to content

Commit ff2aac2

Browse files
committed
chore: Add NPM packages and workflow
1 parent bd2fe8c commit ff2aac2

File tree

2 files changed

+82
-2
lines changed

2 files changed

+82
-2
lines changed

.github/workflows/cd.yml

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ jobs:
103103
steps:
104104
- name: Checkout repository
105105
uses: actions/checkout@v4
106-
106+
with:
107+
fetch-depth: 0
107108
- name: Set up Docker Buildx
108109
uses: docker/setup-buildx-action@v3
109110

@@ -121,4 +122,39 @@ jobs:
121122
file: Dockerfile
122123
push: true
123124
tags: "${{ secrets.DOCKER_USER }}/huly-coder:${{ env.VERSION }},${{ secrets.DOCKER_USER }}/huly-coder:latest"
124-
platforms: linux/amd64,linux/arm64
125+
platforms: linux/amd64,linux/arm64
126+
127+
publish-npm:
128+
name: Publish the base package to NPM
129+
needs: upload-assets
130+
runs-on: ubuntu-22.04
131+
steps:
132+
- name: Checkout
133+
uses: actions/checkout@v4
134+
with:
135+
fetch-depth: 0
136+
- name: Set the release version
137+
shell: bash
138+
# Extract the version number from the "refs/tags/huly-coder-vx.x.x"
139+
run: echo "RELEASE_VERSION=${GITHUB_REF:22}" >> $GITHUB_ENV
140+
- name: Install node
141+
uses: actions/setup-node@v4
142+
with:
143+
node-version: 18
144+
registry-url: "https://registry.npmjs.org"
145+
- name: Publish the package
146+
shell: bash
147+
working-directory: npm/huly-coder
148+
run: |
149+
export version="${{ env.RELEASE_VERSION }}"
150+
envsubst < ../main-package.json.tmpl > "package.json"
151+
yarn config set npmAuthToken ${NODE_AUTH_TOKEN}
152+
yarn config set npmPublishRegistry "https://registry.npmjs.org"
153+
yarn install
154+
yarn build
155+
cp ../../README.md .
156+
cp ../../CHANGELOG.md .
157+
yarn npm publish
158+
env:
159+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
160+
YARN_ENABLE_IMMUTABLE_INSTALLS: false

npm/main-package.json.tmpl

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"name": "huly-coder",
3+
"version": "${version}",
4+
"bin": "lib/index.js",
5+
"description": "A lightweight autonomous AI coding agent with terminal-based UI, inspired by Codex and Cline.",
6+
"repository": {
7+
"type": "git",
8+
"url": "git+https://github.com/hcengineering/huly-coder.git"
9+
},
10+
"keywords": [
11+
"ai-agents",
12+
"rag",
13+
"agentic-ai",
14+
"rust"
15+
],
16+
"author": "Konstantin Zaitsev <[email protected]>",
17+
"license": "MIT",
18+
"bugs": {
19+
"url": "https://github.com/hcengineering/huly-coder/issues"
20+
},
21+
"homepage": "https://github.com/hcengineering/huly-coder?tab=readme-ov-file",
22+
"scripts": {
23+
"typecheck": "tsc --noEmit",
24+
"build": "tsc",
25+
"dev": "yarn build && node lib/index.js"
26+
},
27+
"devDependencies": {
28+
"@types/node": "^18.11.18",
29+
"@typescript-eslint/eslint-plugin": "^5.48.0",
30+
"@typescript-eslint/parser": "^5.48.0",
31+
"eslint": "^8.31.0",
32+
"typescript": "^4.9.4"
33+
},
34+
"optionalDependencies": {
35+
"huly-coder-darwin-arm64": "${version}",
36+
"huly-coder-darwin-x64": "${version}",
37+
"huly-coder-linux-x64": "${version}",
38+
"huly-coder-windows-x64": "${version}"
39+
},
40+
"packageManager": "[email protected]",
41+
"publishConfig": {
42+
"access": "public"
43+
}
44+
}

0 commit comments

Comments
 (0)