diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..17c13e3 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,30 @@ +name: deploy + +on: + push: + branches: + - master + pull_request: + branches: + - master + workflow_dispatch: {} + +jobs: + build: + runs-on: ubuntu-latest + timeout-minutes: 5 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: "18.18.2" + - run: npm install --frozen-lockfile + - run: npm run build + - run: npm run type:check + - run: npm run test + - name: Publish to NPM + if: github.ref == 'refs/heads/master' || github.event_name == 'workflow_dispatch' + uses: botpress/gh-actions/publish-if-not-exists@master + with: + path: "." + token: "${{ secrets.NPM_ACCESS_TOKEN }}" diff --git a/package.json b/package.json index 32ade78..68af906 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,8 @@ "build:types": "tsc -p tsconfig.types.json", "build:cjs": "tsc -p tsconfig.cjs.json && node postcjs.js", "build:esm": "tsc -p tsconfig.esm.json && node postesm.js", - "build": "npm i && npm run gen && npm test && rimraf ./dist && npm run build:types && npm run build:cjs && npm run build:esm", + "type:check": "tsc --noEmit", + "build": "rimraf ./dist && npm run gen && npm run build:types && npm run build:cjs && npm run build:esm", "dry": "npm run build && npm pub --dry-run", "dev": "tsx watch test/index.ts", "gen": "tsx ./createIndex.ts", @@ -56,4 +57,4 @@ "typescript": "^5.2.2", "zod": "^3.22.4" } -} \ No newline at end of file +}