diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..b74b397 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,16 @@ +name: Build +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: 16 + - run: npm install + - run: npm run build \ No newline at end of file diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..2081790 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,24 @@ +name: Publish +on: + release: + types: [created] +jobs: + publish: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: 16 + - run: npm install + - run: npm run build + - run: | + echo @lexacode:https://npm.pkg.github.com/ > build/.npmrc + echo '//npm.pkg.github.com/:_authToken=${NPM_TOKEN}' >> build/.npmrc + - run: npm publish + working-directory: ./build + env: + NPM_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..43c97e7 --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +package-lock=false diff --git a/package.json b/package.json index 6a341cf..ade8b8c 100644 --- a/package.json +++ b/package.json @@ -1,17 +1,22 @@ { - "name": "mahbod", + "name": "@nurutomo/mahbod", "version": "1.0.0", "description": "Typescript WhatsApp Bot", + "homepage": "https://github.com/Nurutomo/mahbod", "main": "./lib/index.js", + "types": "./lib/index.d.ts", "scripts": { "start": "node ./lib/index.js", "test": "echo \"Error: no test specified\" && exit 1", "prepare": "tsc", "build": "tsc" }, - "keywords": [], + "keywords": ["whatsapp", "bot"], "author": "Nurutomo", "license": "ISC", + "repository": { + "url": "git@github.com:nurutomo/mahbod.git" + }, "dependencies": { "@adiwajshing/baileys": "github:adiwajshing/Baileys", "@adiwajshing/keyed-db": "^0.2.4", @@ -25,5 +30,11 @@ "@types/ws": "^8.5.3", "ts-node": "^10.7.0", "typescript": "^4.6.4" - } + }, + "files": [ + "database/*", + "lib/*", + "lang/*", + "sessions/*" + ] }