diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 00000000..141747a2 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,21 @@ +name: Publish to NPM +on: + release: + types: [created] +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Setup Node + uses: actions/setup-node@v2 + with: + node-version: "18.x" + registry-url: "https://registry.npmjs.org" + - name: Install dependencies and build 🔧 + run: npm ci && npm run build + - name: Publish package on NPM 📦 + run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.npmignore b/.npmignore new file mode 100644 index 00000000..ecfd994a --- /dev/null +++ b/.npmignore @@ -0,0 +1,5 @@ +dist/**/* +node_modules/**/* +src/test/**/* +docs/**/* +__tests__/**/* \ No newline at end of file diff --git a/package.json b/package.json index 1d66308c..8b0432b7 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,11 @@ { - "name": "filen-sdk", + "name": "@filen/filen-sdk", "version": "1.0.0", "description": "Filen SDK", "main": "dist/bundle.node.js", "browser": "dist/bundle.browser.js", "types": "dist/types/index.d.ts", + "private": false, "scripts": { "test": "jest --forceExit ./__tests__", "dev": "ts-node src/test/index.ts",