diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..23da817 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,27 @@ +name: ci + +on: + pull_request: + workflow_dispatch: + +jobs: + ci: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: pnpm/action-setup@v2 + with: + version: 8.x.x + + - uses: actions/setup-node@v3 + with: + node-version: '18' + cache: pnpm + + - name: install dependencies + run: pnpm install --frozen-lockfile + - name: lint + run: pnpm lint + - name: build + run: pnpm 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..b6ca64e --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,22 @@ +name: Publish + +on: + release: + types: [published] + +jobs: + publish-npm: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: '18.x' + registry-url: 'https://registry.npmjs.org' + cache: pnpm + + - run: pnpm install --frozen-lockfile + - run: pnpm build + - run: npm publish --access public + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} \ No newline at end of file diff --git a/README.md b/README.md index 6191a3b..3c4d492 100644 --- a/README.md +++ b/README.md @@ -7,12 +7,12 @@ Prisma driver adapter for [TiDB Cloud Serverless Driver](https://github.com/tidb Before you start, make sure you have: - A TiDB Cloud account -- Node >= 18 +- Node >= 18 - [Prisma CLI](https://www.prisma.io/docs/concepts/components/prisma-cli) installed ## Install -You will need to install the `@tidbcloud/prisma-adapter` driver adapter, the `@tidbcloud/serverless` serverless driver and the prisma CLI. +You will need to install the `@tidbcloud/prisma-adapter` driver adapter and the `@tidbcloud/serverless` serverless driver. ``` npm install @tidbcloud/prisma-adapter diff --git a/dev_guide.md b/dev_guide.md new file mode 100644 index 0000000..470ef8a --- /dev/null +++ b/dev_guide.md @@ -0,0 +1,8 @@ +# Test + +Now, we test the adapter by this [pull request](https://github.com/prisma/prisma-engines/pull/4342) as a temporary solution. + +# Release + +Just publish a new GitHub release, then the GitHub Action will publish the package to npm. +