Skip to content

Commit 7c04a2c

Browse files
committed
chore: prepare package for npm publishing
- add github actions workflow to publish v* tags to npm using node 20 - add npx usage and env example to readme for quick start - remove private flag and add bin entries for project-canis and canis - bump copyright year to 2026
1 parent 12d60b7 commit 7c04a2c

4 files changed

Lines changed: 71 additions & 5 deletions

File tree

.github/workflows/publish.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Publish to npm
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
12+
permissions:
13+
contents: read
14+
id-token: write
15+
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
20+
- name: Setup Node
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: 20
24+
registry-url: https://registry.npmjs.org
25+
26+
- name: Install dependencies
27+
run: npm ci
28+
29+
- name: Build
30+
run: npm run build
31+
32+
- name: Publish to npm (with provenance)
33+
run: npm publish --provenance --access public
34+
env:
35+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

README.md

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,38 @@ Canis supports multiple AI providers out of the box:
4141

4242
- Node.js (>=18.x)
4343
- MySQL
44-
45-
You can changed the db provider in `prisma/schema.prisma`
46-
4744
- Redis/Valkey
4845
- WhatsApp Account
4946
- Chrome browser
5047
- FFMPEG
5148

49+
50+
## Skip through this long setup and use NPX
51+
If you want to skip the setup and just want to run the bot, you can use NPX to run the bot without cloning the repo or installing dependencies.
52+
53+
```sh
54+
npx project-canis
55+
```
56+
57+
Once you install the bot using NPX, you configure the required environment variables in the `.env.example` using this command
58+
```sh
59+
export PROJECT_CANIS_ALIAS=Canis
60+
# automatically reboot canis, if a potential memory leak has been detected,
61+
# or the memory usage was just way too high
62+
export PROJECT_AUTO_RESTART=false
63+
export PROJECT_THRESHOLD_MEMORY=1024
64+
export PROJECT_MAX_MEMORY=2048 # 2GB
65+
export PROJECT_AUTO_DOWNLOAD_MEDIA=true
66+
export PROJECT_MAX_DOWNLOAD_MEDIA=25 # 25MB
67+
export PROJECT_ENABLE_BOT_FONT=true
68+
# for more configuration, please refer to the .env.example file
69+
```
70+
71+
Alternatively, you can also run the bot using this short command:
72+
```sh
73+
npx canis
74+
```
75+
5276
## Getting started
5377

5478
1. **Clone repo**
@@ -123,7 +147,7 @@ A Telegram version of Project Canis is available at [project-canis-tg](https://g
123147

124148
## License
125149

126-
Copyright 2025 Melvin Jones Repol
150+
Copyright 2026 Melvin Jones Repol
127151

128152
Licensed under the Apache License, Version 2.0 (the "License");
129153
you may not use this file except in compliance with the License.

package-lock.json

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"name": "project-canis",
33
"version": "11.1.0",
44
"description": "Canis Major and the constellation Canis Minor, the “lesser dog,” are widely regarded as two hunting hounds that follow Orion, the great hunter of ancient Greek legends.",
5-
"private": true,
65
"main": "src/index.ts",
76
"scripts": {
87
"build": "prisma generate && ts-node scripts/build.ts",
@@ -11,6 +10,10 @@
1110
"dev": "ts-node src/runner.ts src/index.ts",
1211
"test:sentry": "ts-node tests/sentry.ts"
1312
},
13+
"bin": {
14+
"project-canis": "./dist/runner.js",
15+
"canis": "./dist/runner.js"
16+
},
1417
"author": {
1518
"name": "Melvin Jones Repol",
1619
"email": "mrepol742@gmail.com",

0 commit comments

Comments
 (0)